Commit Graph

109 Commits

Author SHA1 Message Date
Aaron Culliney
e4e0c941d3 Refactor CPU assembly for simplicity and efficiency
- Variables needed in assembly now accessible in a struct pointer that  avoids __PIC__ nastiness
    - Reduces code size and execution time for CPU thread
2018-01-15 16:19:21 -08:00
Aaron Culliney
6b901dff07 Avoid thread race with testprefs.c 2017-12-03 11:34:11 -08:00
Aaron Culliney
11cf51753b Fix Desktop and Android builds after headless upheaval 2017-07-31 17:47:58 -07:00
Aaron Culliney
51a5f5fcf7 Excise ERRLOG() in favor of LOG() 2017-07-15 14:39:15 -10:00
Aaron Culliney
55cba116e4 Revert adding A2V3 format as it is unnecessary
- Re-gzipping ejected images is based solely on the file extension and not the actual file stream contents
    - Read/write disk images with extension ".gz" are re-gzipped in-place upon ejection
    - Read/write disk images without extension ".gz" are not changed upon ejection
    - Read-only disk images maintain current behavior (no modifications performed at all)
2017-07-06 19:36:37 -10:00
Aaron Culliney
c00a52cbc6 unbreak testui 2017-07-04 08:00:52 -10:00
Aaron Culliney
7411a987fa Disk chooser can now also choose .a2state files
- Internal save/restore API now uses file descriptors (supports restrictive app environments)
2017-07-01 11:03:15 -07:00
Aaron Culliney
2a263e2418 Avoid a crash in nativeStateExtractDiskPaths() 2017-06-07 02:21:48 -07:00
Aaron Culliney
b300e60e2a Persist disk image 'was_gzipped' state
- 'was_gzipped' state is persisted in .apple2.json preferences
    - This removes all file-renaming codepaths at the cost of temporarily nonconformance to naming convesion (e.g., disk
      images inserted read/write are still called 'foo.dsk.gz' although they are not compressed)
    - Unclean shutdown of emulator leaves any disk images that were inserted read/write in their non-gzipped state
      (regardless of file name extension) on disk until emulator restarted and disk images explictly ejected or clean
      shudown.  App removal after unclean shutdown will potentially leave mis-named disk images lingering.
    - Emulator will handle edge cases of non-gzipped disk images with '.gz' extension and gzipped disk images without
      '.gz' extension
2017-05-29 08:05:38 -10:00
Aaron Culliney
9bd59661ed Refactor disk image UI to use file descriptors and not paths
- Push path opening responsibility out of disk6 API in favor of using file descriptors
    - Improves handling of readonly gzipped disk images (now data is read without gunzipping or mmap()ing the file)
    - Currently represents an API-breaking change for macOS, iOS, GNU/Linux desktop ports (but should be easy to fix)
2017-05-28 08:48:11 -10:00
Aaron Culliney
f6e2ebc028 Add testui target for Android 2016-10-15 19:29:15 -07:00
Aaron Culliney
c80e16de3b Unbreak tests on Android 2016-10-09 12:21:41 -07:00
Aaron Culliney
06f8015959 Misc fixes for test stubs 2016-07-23 17:23:36 -07:00
Aaron Culliney
b8ab6e2be0 Fix testcpu build break when targeting latest NDK 2016-05-08 12:33:00 -07:00
Aaron Culliney
7607126f7c Avoid resetting joystick buttons too soon (to allow for ClosedApple-Reset to trigger) 2016-04-17 12:51:23 -07:00
Aaron Culliney
76f29d0865 Allow emulator shutdown state to be queried as needed 2016-04-17 12:18:48 -07:00
Aaron Culliney
3ed159dd0b Lightly refactor joystick and button handling during reset
- Remove unused button2 variable
    - Remake little-used backend joystick reset function as function pointer
    - Allow soft reset and self-test on Android (although there is still a race condition due to code that directly sets
      joy_button[12] values
2016-04-17 11:42:13 -07:00
Aaron Culliney
2a405f028f Streamline and fix test codepaths on Desktop Linux and Android 2016-04-13 19:33:08 -07:00
Aaron Culliney
9c1cfedf7d Fix some envvars on Android 2016-04-12 22:16:01 -07:00
Aaron Culliney
db816ad502 Refactor Android variant to use common shared JSON preferences
- Eliminates a whole bunch of boilerplate setter/getter code in various places
    - Accesses preferences directly from JSON data through custom json_parse.h API
    - Improves code locality for Java menus/settings
2016-04-11 22:01:30 -07:00
Aaron Culliney
b87273e742 Expand coverage of heap memory checking of debug builds and simplify FREE() calls 2016-02-26 21:26:57 -08:00
Aaron Culliney
3120b75e00 Enforce module ctor priorities 2016-02-22 22:41:37 -08:00
Aaron Culliney
15d64cf24e Render thread will actually eject the disks through emulator_shutdown() 2016-02-20 11:09:24 -08:00
Aaron Culliney
dcbf1ace18 Remove an assertion that can be wrong if user is spamming app lifecycle backgrounding/foregrounding
- Unlikely to be a real problem if CPU thread is not paused when we are initializing the render thread
2016-02-20 11:07:29 -08:00
Aaron Culliney
545376b1be Improve testcpu on desktop and fix it on Android 2016-02-15 13:32:05 -08:00
Aaron Culliney
bd9b38cd65 Allow calibration of portrait mode on Android 2016-02-14 20:40:51 -08:00
Aaron Culliney
261ae2efae Refactor to not use video_backend in so many places 2016-02-07 14:42:32 -08:00
Aaron Culliney
5fec80a33a Refactor video_shutdown() to appease Valgrind
- This likely breaks Darwin ports ... will fix soon[ish]
2016-02-07 14:42:28 -08:00
Aaron Culliney
edaae0bc89 Refactor glvideo to be the root glnode, begin to privatize video_backend APIs 2016-02-07 14:42:16 -08:00
Aaron Culliney
1358a52eee Add but disable CPU trace on Android 2016-01-24 09:47:57 -08:00
Aaron Culliney
abae59767c Enable simple heap memory fencing/scribbling in debug builds 2015-12-31 22:50:43 -08:00
Aaron Culliney
145b6a6cef Refactor JNI plumbing for consistency 2015-12-20 12:54:27 -08:00
Aaron Culliney
22b1bc9ad8 Move key handling back to the Activity, otherwise we don't seem to receive onKeyUp() for the Android back button 2015-12-20 12:11:12 -08:00
Aaron Culliney
2f7f7bd359 Preliminary support for mapping an Android physical gamepad/joystick to emulated Apple //e joystick
- No support for custom joystick/gamepad configurations (yet)
2015-12-19 23:59:02 -08:00
Aaron Culliney
3ff877d80c Refactor : move event handling into custom view 2015-12-19 23:13:52 -08:00
Aaron Culliney
2c8284d41f Start running tests on Android after first resume
- This allows for a more consistent test environment (test disks copied out of APK and available, etc) and also
      mimics main app behavior
2015-12-16 20:59:20 -08:00
Aaron Culliney
cdb0f7b06b Shunt disk-state-change information back to the Java/Android menu system 2015-12-12 11:42:33 -08:00
Aaron Culliney
651ac246e3 Flush disk IO on backgrounding 2015-12-11 23:42:57 -08:00
Aaron Culliney
e1629095b6 Get crash symbolication working for x86 build 2015-11-29 14:35:01 -08:00
Aaron Culliney
b9d6d38b17 First cut at save/restore emulator state feature
- This adds to overall UX ... (you can finally finish some very difficult arcade games by strategically leveraging
      this feature)
    - Currently enabled for Android, but not Android-specific
2015-11-22 18:22:01 -10:00
Aaron Culliney
6de1cae478 Move nativeOnCreate back to proper position as first native call
- This runs discovery of CPU family
    - This sets up native crash handling
2015-11-01 19:26:34 -08:00
Aaron Culliney
9a2044f75e Apparently not possible to query this early on Gingerbread devices 2015-11-01 13:43:09 -08:00
Aaron Culliney
521d1daccf Refactor app startup
- Make sure crash checking is performed as early as possible
    - Minimize calling complex native functions until after splash screen is dimissed
    - Do not attempt to setup/resume OpenGL until after splash screen is dimissed
2015-11-01 10:14:40 -08:00
Aaron Culliney
cbe8a734d0 Move CPU feature discovery into CTOR 2015-10-31 23:00:45 -07:00
Aaron Culliney
acdc8da64f Refactor pause/resume functions to be strictly CPU thread pause/resume 2015-10-31 14:01:47 -07:00
Aaron Culliney
d4adabda93 SNEAKY BUGFIX race condition between UI thread and CPU thread on disk insertion
- Previously we would start the CPU thread and then insert, which has been a long standing race condition, but
      possibly better exposed since the recent disk.c rephactor to use mmap I/O
    - This directly manifested on a Kindle Fire 1st Gen as a crash, and, anecdotally on other devices as a "stalled"
      disk read requiring a reboot of the virtual machine.  Yay for crappy devices helping to expose crappy code! (git
      blame me). =P
2015-10-30 23:19:33 -07:00
Aaron Culliney
2cc23cf35d Upgrade to GPLv3 "or later" and update copyrights 2015-10-22 21:09:13 -07:00
Aaron Culliney
4e478d369c Refactor disk interface API function names 2015-10-15 22:51:44 -07:00
Aaron Culliney
f4fa5670b4 Add function-call time tracing for Linux/Android 2015-10-04 14:22:26 -07:00
Aaron Culliney
e161dce3c2 Make app shutdown happen on the GL thread to avoid crashing 2015-10-04 13:39:57 -07:00