Giter Club home page Giter Club logo

kegs's Introduction

Port of Kent Dickey's KEGS Apple IIgs Emulator to Android. Also includes OG ActiveGS patches as of kegs_3_0_242.

You can find a release version in Google Play: https://play.google.com/store/apps/details?id=com.froop.app.kegs

Usability notes: The touch screen acts as a big trackpad for the mouse.

To click and drag, either Long Press then drag or use one finger for movement and one finger for the mouse button.

It looks for disk images on the main sdcard or 'legacy' storage directory, and a few subdirectories under that: Downloads, KEGS, and Android/data/com.froop.app.kegs/files/

If you want to edit the KEGS 'config.kegs' directly, edit 'default' in the last directory mentioned above.

Input: Physical keyboards should work, though on some devices you may need to reset the input method to something like Hacker's Keyboard.

Sound: If you hear no sound, do something where sound should be playing (perhaps the X-MAS demo main menu) and then adjust the sound volume. If KEGS is not generating sound, the volume buttons adjust a different sound level (for example your ringer)

Source code: https://github.com/jamessanford/kegs/

To build from source, open this project in Android Studio.

Changes made to KEGS:

  • Various ifdefs for __ANDROID__ in the kegs 'core'
  • Addition of android_driver.c and android_sound_driver.c

Application structure:

  • The UI is coordinated via KegsMain
  • There is a KegsThread class that gets its own thread. This thread ends up calling mainLoop() in jni/android_driver.c and running KEGS in that thread.
  • The native thread gets two things from Java: a Bitmap, and a ConcurrentLinkedQueue.

All UI events are sent to the native thread by pushing events into the ConcurrentLinkedQueue (KegsEvent, MouseKegsEvent, KeyKegsEvent).

The native thread pulls events off the queue, writes updates into the bitmap object, then calls the Java "updateScreen" in the KegsThread object.

The native thread also calls support functions in Java, such as checkForPause(), which blocks the native thread while it should be paused. See comments in KegsThread.java for more details.

Android NDK samples were helpful when creating this port:

  • bitmap-plasma
  • JetBoy
  • native-audio
  • FireflyRenderer

kegs's People

Contributors

jamessanford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kegs's Issues

Physical keyboard input glitchy

When using a keyboard with this emulator, holding down a key isn't recognized and/or timing of the input is not correct. For example when moving a character in a game, holding down -> results in the character standing still and not moving, while tapping -> the character then moves.

reported crashes on launch

Something with onCreate and the ancient android.support.v4 is causing crashes in onCreate, preventing users from actually using the app.

Probably best to just get rid of all the legacy support libs and target Android 4.x+

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2416)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2476)
  at android.app.ActivityThread.access$900 (ActivityThread.java:150)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1344)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:171)
  at android.app.ActivityThread.main (ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Caused by: android.support.v4.app.Fragment$InstantiationException: 
  at android.support.v4.app.Fragment.instantiate (Fragment.java:399)
  at android.support.v4.app.FragmentState.instantiate (Fragment.java:96)
  at android.support.v4.app.FragmentManagerImpl.restoreAllState (FragmentManager.java:1726)
  at android.support.v4.app.FragmentActivity.onCreate (FragmentActivity.java:198)
  at com.froop.app.kegs.KegsMain.onCreate (KegsMain.java:525)
  at android.app.Activity.performCreate (Activity.java:6285)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1108)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2369)

joystick code causing crashes

Looks like the joystick code may have a bug (it needs to be rewritten anyhow, but right now it may crash!)

I suspect it's related to multitouch actions during joystick movement.

Three reports of this in the android developer console, with different phones and versions of android:

java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2148)
at com.froop.app.kegs.TouchSpecialZone.click(TouchSpecialZone.java:20)
at com.froop.app.kegs.TouchJoystick.onTouchEvent(TouchJoystick.java:142)
com.froop.app.kegs.KegsMain$11.onTouch(KegsMain.java:550)
at android.view.View.dispatchTouchEvent(View.java:8107)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.