Commit Graph

783 Commits

Author SHA1 Message Date
Aaron Culliney
1679b8e76a Refactor : excised more DS deadc0de 2015-06-14 14:07:33 -07:00
Aaron Culliney
3767f55846 Refactor : rename and coalesce audio buffer initialization structs 2015-06-14 14:07:33 -07:00
Aaron Culliney
49d2fe6e09 Refactor : excise deadc0de 2015-06-14 14:07:32 -07:00
Aaron Culliney
1707c60701 Refactor : completely excise win-shim
- Moves remaining shim code into mockingboard.c
    - Breaks Mac builds for now =P
2015-06-14 14:07:32 -07:00
Aaron Culliney
994e1a4568 Refactor FALSE -> false 2015-06-14 14:07:32 -07:00
Aaron Culliney
f89c734996 Refactor : excise various macro defs 2015-06-14 14:07:32 -07:00
Aaron Culliney
b9371d3a38 Refactor : LPDWORD > unsigned long* 2015-06-14 14:07:32 -07:00
Aaron Culliney
7513f5e938 Refactor UINT -> unsigned int 2015-06-14 14:07:32 -07:00
Aaron Culliney
92f21a65ca Refactor : LPVOID > void* 2015-06-14 14:07:32 -07:00
Aaron Culliney
e63afea069 Refactor : excise LPBYTE, LPLONG 2015-06-14 14:07:32 -07:00
Aaron Culliney
8cba7de872 Refactor : excise unused macro defs 2015-06-14 14:07:32 -07:00
Aaron Culliney
7263e161e4 Refactor : LONG -> long 2015-06-14 14:07:32 -07:00
Aaron Culliney
5312ddee00 Refactor : ULONG -> unsigned long 2015-06-14 14:07:32 -07:00
Aaron Culliney
109dfa855b Refactor : DWORD -> unsigned long 2015-06-14 14:07:32 -07:00
Aaron Culliney
7051e6d906 Refactor : SHORT -> int16_t 2015-06-14 14:07:32 -07:00
Aaron Culliney
57cd12f1cc Refactor : BYTE -> uint8_t 2015-06-14 14:07:32 -07:00
Aaron Culliney
6d252b0b3e Refactor : WORD -> uint16_t 2015-06-14 14:07:32 -07:00
Aaron Culliney
4b28e33906 Refactor USHORT -> uint16_t 2015-06-14 14:07:32 -07:00
Aaron Culliney
a5d36c7dff Refactor : remove unused macro defs 2015-06-14 14:07:32 -07:00
Aaron Culliney
a46a882a3d Refactor length types 2015-06-14 14:07:32 -07:00
Aaron Culliney
c5fb837314 Refactor BOOL -> bool 2015-06-14 14:07:32 -07:00
Aaron Culliney
87e7ec24ff Refactor HRESULT -> int 2015-06-14 14:07:32 -07:00
Aaron Culliney
20bbfcd286 Fixes for Tap Delay thread
- Now signals TD thread on each touch event that resulted in a change to the buttons.trackingIndex or a change to
      the chosen button (buttons.touchDownButton, buttons.northButton, or buttons.southButton)
    - Uses mutex (un)locking to avoid races around buttons.trackingIndex and chosen button
    - Adds an equal delay on TD thread loop finish to ensure the touchDown/touchUp or touchDown/move/touchUp event
      sequence is the same basic duration as received
2015-06-14 13:59:51 -07:00
Aaron Culliney
5e1d8552ef Ensure file globals are in file scope 2015-06-14 13:59:29 -07:00
Aaron Culliney
c47afc4ccb Bugfix disk selection on Linux desktop 2015-06-07 11:25:50 -07:00
Aaron Culliney
f28b708449 Delay joystick button touches FTW
- Previously a touch down event would trigger a joystick button, but now this slight delay in processing allows us
      to discard this if the user really issued a tap-move combo
2015-06-06 21:44:11 -07:00
Aaron Culliney
1da7acbaba Properly hook up Android shutdown paths 2015-06-06 21:18:27 -07:00
Aaron Culliney
26d7e7da3d Reminder for a future rethink/refactor 2015-06-06 13:00:53 -07:00
Aaron Culliney
3108e035ed Implement sticky-CTRL key for touch keyboard 2015-06-06 12:02:03 -07:00
Aaron Culliney
1cdbaa460a Change joystick glyph 2015-06-03 22:21:33 -07:00
Aaron Culliney
5773ef2e8d Simplify touch menu to just one model/texture
- Also seamlessly complements gltouchkbd layout
2015-06-03 22:13:19 -07:00
Aaron Culliney
f2abf4ce35 Fix emulator quit path on Android 2015-06-01 22:50:44 -07:00
Aaron Culliney
29006f9c5c path handling cleanups 2015-06-01 22:25:29 -07:00
Aaron Culliney
064070be7c Kill a magic number and ensure file_name is nul-terminated 2015-06-01 22:08:58 -07:00
Aaron Culliney
3f38467c93 Silence Valgrind complaint about gzread() 2015-06-01 22:04:01 -07:00
Aaron Culliney
adb09dc84e Avoid buffer overflow +1, thank you Valgrind 2015-06-01 21:17:48 -07:00
Aaron Culliney
9d26e2c6f0 Tweak comments 2015-05-31 16:33:39 -07:00
Aaron Culliney
4c8856fb04 Comment unused/untested codepaths 2015-05-31 16:31:57 -07:00
Aaron Culliney
3b13fc29a4 Don't leak stuff-n-things, thank you Valgrind =)
- Major : Previously leaking interface threads
    - Major : Leak of FILE* resources in inflate routine
    - Minor : previous leak-on-exit of enumerated sound devices
2015-05-31 14:11:57 -07:00
Aaron Culliney
80b880550f Fix shutdown codepaths
- Ensures various shutdown codepaths (interface, cpu/audio, main/video, ...) run on proper thread(s)
    - Actually now runs the CloseAL() code
    - Try to ensure all detached threads exit ... seems to help keep Valgrind happy =)
2015-05-31 13:43:51 -07:00
Aaron Culliney
a796a9f14c c_mygetch is strictly INTERFACE_CLASSIC 2015-05-31 12:57:33 -07:00
Aaron Culliney
6a453c3973 Don't exit in video_shutdown() 2015-05-31 11:25:23 -07:00
Aaron Culliney
a4f185d197 Bugfix: allow unsigned indexing 2015-05-31 11:23:49 -07:00
Aaron Culliney
5816962f32 Make RGBA_4444 codepaths available to HUD models 2015-05-30 23:18:08 -07:00
Aaron Culliney
bcb36a4801 add codepath for RGBA_4444 textures 2015-05-30 18:58:34 -07:00
Aaron Culliney
a3b2afe18f Adds a semi-opaque halo effect around keyboard and menu glyphs for better contrast 2015-05-30 12:18:42 -07:00
Aaron Culliney
31cef9eb58 Avoid overflowing when rerendering character. 2015-05-29 22:14:53 -07:00
Aaron Culliney
cb72d483c0 Refactor INTERPOLATED_PIXEL_ADJUSTMENT calculations just to codepaths actually touching the internal framebuffers 2015-05-29 21:47:49 -07:00
Aaron Culliney
aee1111cb0 Better derivation of framebuffer macros 2015-05-29 21:46:37 -07:00
Aaron Culliney
1ca1e7d2cc Use parens around SCANSTEP macro 2015-05-29 21:46:14 -07:00
Aaron Culliney
1506aba551 Refactor: rename to video_reset() for clarity 2015-05-29 21:46:07 -07:00
Aaron Culliney
27ade69757 Refactor various display initialization routines to CTOR 2015-05-29 21:46:01 -07:00
Aaron Culliney
966ba0a2d8 No disk in drive (or invalid track) should return 0xFF
- Bug introduced in e01e437
    - Bugfix allows U5 Journey Onward to work =P
2015-05-25 13:36:17 -07:00
Aaron Culliney
0cb3086622 gltouchjoy and keyboard are now toggle options 2015-05-23 23:30:18 -07:00
Aaron Culliney
692a6793cb Default enable touch joystick instead of keyboard 2015-05-23 23:25:32 -07:00
Aaron Culliney
4d3de200d9 Extra/configurable defaults to uppercase for U4 keys... 2015-05-21 22:32:38 -07:00
Aaron Culliney
13a7dbfbb0 defensive coding 2015-05-21 22:31:06 -07:00
Aaron Culliney
df218fed05 Improved keyboard with semi-inline arrows 2015-05-17 22:05:15 -07:00
Aaron Culliney
8e73b70f95 Touch keyboard now supports special keys 2015-05-10 15:25:50 -07:00
Aaron Culliney
68011fa8f2 First cut at touch menu HUD
- Enables choosing touch keyboard or touch joystick
    - Enables increasing/decreasing speed
    - Enables opening main popup menu
    - Also migrates all gesture responsibility away from Java side of things
2015-05-09 19:23:52 -07:00
Aaron Culliney
1126a319ec Misc tweaks to various GL interface objects 2015-04-26 18:12:56 -07:00
Aaron Culliney
e7c0d8fe48 Comments, and avoid NULL deref on app resume 2015-04-22 23:40:48 -07:00
Aaron Culliney
4e23795cfd First cut at GL touch keyboard 2015-04-22 23:32:36 -07:00
Aaron Culliney
725cf68011 Move common function to base class 2015-04-19 14:28:47 -07:00
Aaron Culliney
142f0181bc support showing hourglass pause animation 2015-04-19 14:28:09 -07:00
Aaron Culliney
eee0dd45e3 zero-initialize buffers 2015-04-19 14:26:40 -07:00
Aaron Culliney
2b658954f9 Various additions/changes to interface glyphs 2015-04-19 14:25:53 -07:00
Aaron Culliney
629e44b210 Slightly more idiomatic way to upload texture pixels 2015-04-18 15:29:55 -07:00
Aaron Culliney
c2bd14f9b5 REFACTOR : glcpuanim now manages all generic alert messages 2015-04-18 15:15:09 -07:00
Aaron Culliney
592c80344f Add new custom bitmap glyphs, and change load positions 2015-04-18 14:50:02 -07:00
Aaron Culliney
dcd0207525 Fix ctor load priorities 2015-04-17 22:12:13 -07:00
Aaron Culliney
2bc846d1fe Revert "Fix non-deterministic ctor load issues and use singleton for video_backend module access"
This reverts commit af95212a19.

    TODO : make ctor loads deterministic
2015-04-17 21:40:56 -07:00
Aaron Culliney
e2272132c2 Do not destroy OpenGL needful things for VAO codepath
- Gets Mac build rendering again
2015-04-16 21:53:44 -07:00
Aaron Culliney
af95212a19 Fix non-deterministic ctor load issues and use singleton for video_backend module access 2015-04-16 21:53:12 -07:00
Aaron Culliney
e2794070dd fix typos to allow gltouchjoy to build 2015-04-12 16:20:01 -07:00
Aaron Culliney
ca139ee94a REFACTOR : glanimation rechristend, touch handling genericized
- 'animation' was too constrained a name to what these do, so switch to the overloaded term 'node' ;-)
    - Touch handling is no longer the sole purview of the touchjoy, (in prep for touchable HUD elements)
2015-04-12 15:55:06 -07:00
Aaron Culliney
5b5c6fa533 REFACTOR : interface menus/HUDs
- menu/HUD creation functions moved to better location and renamed
    - CPU change animation now default displays on desktop Linux (exercise common HUD codepaths with mobile)
2015-04-12 14:23:35 -07:00
Aaron Culliney
121e250c62 REFACTOR : GLModel render pass is common for HUD models 2015-04-12 11:27:33 -07:00
Aaron Culliney
06051e44e7 REFACTOR : CPU animation is now a HUD model 2015-04-12 00:41:41 -07:00
Aaron Culliney
19e1a8e3d8 REFACTOR : beginnings of object-oriented approach for HUD models 2015-04-12 00:40:43 -07:00
Aaron Culliney
60d7e2b305 touchjoy render pass optimizations : avoid OpenGL calls if alpha is zero 2015-04-11 12:18:36 -07:00
Aaron Culliney
e876cd03b6 REFACTOR : begin consolidating common code for OpenGL HUD interfaces 2015-04-11 11:42:18 -07:00
Aaron Culliney
5712850e84 REFACTOR : demoModel -> GLModel 2015-04-11 11:42:18 -07:00
Aaron Culliney
9bbb180feb Bugfix touchjoy : make sure only the correct button is firing 2015-04-11 11:42:18 -07:00
Aaron Culliney
afc8c8bb24 Old Spamsung devices running Gingerbread cannot handle dangerous characters like backslash '\' in their OpenGL shader parsers 2015-04-07 23:17:13 -07:00
Aaron Culliney
985cec7725 Baseline GL touch joystick functionality (for AXIS_EMULATED_DEVICE type)
- Also updates GL touch joystick to allow dynamic HUD re-positioning
2015-04-04 20:35:34 -07:00
Aaron Culliney
23171c65fc unnecessary to send alpha parameter into function 2015-04-04 12:49:05 -07:00
Aaron Culliney
30236cb400 First cut at GL Touch Joystick 2015-04-01 19:59:38 -07:00
Aaron Culliney
d63bd7b412 macro defines for various mousetext characters 2015-04-01 19:57:12 -07:00
Aaron Culliney
c40f9f7487 X11 renderer : don't change XImage from different thread
- Only allow the X11 renderer thread to change the XImage
2015-03-23 22:05:08 -07:00
Aaron Culliney
30c59bd43f X11 renderer still works! 2015-03-23 21:45:46 -07:00
Aaron Culliney
5f210bfcf3 HACK around lingering issues with speed adjustment on mobile 2015-03-22 19:14:35 -07:00
Aaron Culliney
af42dc36b2 Squashed commit of the following:
CPU speed animation touch-ups, and enable building for desktop
    Rename/shuffle animation declarations and code
    Refactor backend video system to be a dynamically initialized module
    Basic CPU speed texture animation works on desktop Linux and Android
    Use static pixel buffers to avoid malloc/free churn
    Improve CPU animations
    First cut at CPU speed message animation
    Refactor some of the classic interface functions to be potentially reusable elsewhere
2015-03-22 18:53:13 -07:00
Aaron Culliney
358541b8cc Simplify BranchXCycles 2015-03-22 15:46:58 -07:00
Aaron Culliney
8c66a91e14 REFACTOR : shuffle some code for improved legibility 2015-03-14 15:52:15 -07:00
Aaron Culliney
e5fde057c9 Don't create new cpu_thread on app resume 2015-03-12 14:45:17 -07:00
Aaron Culliney
2965afe12e Two-finger-touch pops up softkeyboard and adjusts GL viewport 2015-03-11 12:54:50 -07:00
Aaron Culliney
e839baa931 Updates to prepare/support Android Studio / Gradle builds 2015-03-10 13:15:36 -07:00
Aaron Culliney
abe520d8b7 Remove unnecessary instructions in CPU tracing 2015-03-10 11:15:28 -07:00
Aaron Culliney
f12a4c7142 Bugfix : assure that ARM processor flags are cleared 2015-03-10 11:13:59 -07:00
Aaron Culliney
7e249745d8 Make disk loading faster on slow Android devices
- So for now we are not "conformant" on Android, but it appears to be worth the disk image loading times
2015-03-10 10:23:52 -07:00
Aaron Culliney
09ff973016 Work around lack of GLSL version string in older Android device(s) 2015-03-10 10:23:52 -07:00
Aaron Culliney
8d6961c0cb Callee is responsible for saving higher regs 2015-03-10 10:23:52 -07:00
Aaron Culliney
199300ba39 Bugfix bank maybewrite glue 2015-03-10 10:23:52 -07:00
Aaron Culliney
d30a7b8a38 Codepath is now similar to x86 variant 2015-03-10 10:23:52 -07:00
Aaron Culliney
ee73c5890b base_c4rom is a flexible pointer 2015-03-10 10:23:52 -07:00
Aaron Culliney
347ed76034 Mark some VM tests as needing attention 2015-03-10 10:23:52 -07:00
Aaron Culliney
36b78f657f Remove an uppity assert
- Manifesting on Mac ... believed to be spurious and more fallout from auto-speed adjustment refactor
2015-03-10 10:22:47 -07:00
Aaron Culliney
2855d15f9b Get graphics working again on Mac and add another snide Android compiler warning =P 2015-03-10 10:22:47 -07:00
Aaron Culliney
d657ab8c46 Unstick Mac builds and tests 2015-03-10 10:22:47 -07:00
Aaron Culliney
b329ac2bff Remove some redundant code 2015-03-05 21:25:14 -08:00
Aaron Culliney
e7ad98535a Correct order for CPU tracing arguments 2015-03-05 21:23:36 -08:00
Aaron Culliney
9cbceac80b Fix bug in GetZPage_X and GetZPage_Y macros 2015-03-05 21:06:42 -08:00
Aaron Culliney
2ec4e46012 Expose a test failure on ARM 2015-03-05 20:59:51 -08:00
Aaron Culliney
c3969f9d1d Fixes to get Android tests rendering 2015-02-24 20:53:19 -08:00
Aaron Culliney
fadb806c92 DSK image loading considered slow, Use NIB image for faster tests (not specifically exercising DSK codepaths)
- There may be some wins in optimizing the DSK codepaths, but I think these are inherently slow now that we have
      brought in Applewin's conformant code
    - It's possible that the best option will be to bring back the non-conformant-but-faster DSK codepaths originally in
      this emulator but ...
2015-02-24 20:42:30 -08:00
Aaron Culliney
1c7e707af9 Comment pthread_join()
- Blocks Android rendering
    - Unnecessary for GLUT/Linux renderer
    - Might need to be worked around for Mac tests
2015-02-24 15:49:57 -08:00
Aaron Culliney
560726728f bugfix CPU reinitialization 2015-02-24 12:11:16 -08:00
Aaron Culliney
48625458cf testdisk.c is starting to run on Android 2015-02-24 12:10:51 -08:00
Aaron Culliney
0c3121ac65 Android : copy stuff out of APK for ease of use, and pass data_dir to native side
- Also makes data_dir more useful for various platforms
2015-02-23 23:11:17 -08:00
Aaron Culliney
792c0a0b08 DAA & DAS algorithms in ARM assembly 2015-02-22 13:46:58 -08:00
Aaron Culliney
d517339842 All 65c02 CPU tests for ARM pass, except for decimal mode 2015-02-21 21:06:01 -08:00
Aaron Culliney
404d4cdb4f Various tweaks to CPU tests 2015-02-21 21:00:42 -08:00
Aaron Culliney
811df361a8 Fixes for ADC_b and AND on ARM 2015-02-19 23:25:33 -08:00
Aaron Culliney
41b8ca7700 More canonical test for oVerflow 2015-02-19 20:13:13 -08:00
Aaron Culliney
59d151d684 First cut at DAA and DAS algorithms in ARM and misc assembly cleanup 2015-02-19 16:03:29 -08:00
Aaron Culliney
86e8eeafe2 testcpu is beginning to run (with errors) 2015-02-18 23:09:16 -08:00
Aaron Culliney
3149914741 Get some CPU tests passing on ARM/Android 2015-02-18 23:08:16 -08:00
Aaron Culliney
0d7e81c7d4 Testing does not depend on olde prefs system 2015-02-18 16:17:12 -08:00
Aaron Culliney
1ac7c7e12d Remove OpenSSL dependency, use public source SHA1 2015-02-18 15:54:04 -08:00
Aaron Culliney
78325ad469 Silence compiler warning 2015-02-18 11:00:50 -08:00
Aaron Culliney
2a6d889309 test 16bit underflow/overflow in op_JSR and op_RTS 2015-02-18 10:51:26 -08:00
Aaron Culliney
f4bc218bd8 WIP : Misc optims/changes of ARM-variant 65c02 CPU 2015-02-17 20:33:27 -08:00
Aaron Culliney
829ee225e6 Android variant compiles/links 2015-02-17 20:28:23 -08:00
Aaron Culliney
602c2530e6 Stub a touch-based joystick in OpenGL 2015-02-17 20:23:06 -08:00
Aaron Culliney
43b280d3ba REFACTOR : glinput.c -> glutinput.c 2015-02-17 20:13:18 -08:00
Aaron Culliney
abf231711c Get zlib-helpers.c compiling/linking on Android 2015-02-17 20:09:13 -08:00
Aaron Culliney
604a325c6b Default to avoiding use of VAOs
- Default Android NDK does not have appear to have glGenVertexArrays, et al
2015-02-17 19:54:47 -08:00
Aaron Culliney
ada636f245 REFACTOR : migrate common preferences settings into misc.c
- prefs.c code should be unused on Android/iOS
2015-02-17 16:16:34 -08:00
Aaron Culliney
815b6f5a7c REFACTOR : soundcore to use logging macros 2015-02-17 16:14:25 -08:00
Aaron Culliney
0470cb8907 Remove deadc0de since ROMs should be pre-loaded 2015-02-17 16:06:41 -08:00
Aaron Culliney
28aea0bf14 Remove redundant code 2015-02-17 11:06:50 -08:00
Aaron Culliney
c4e3d93fd4 Fix underflow/overflow branch tests 2015-02-16 12:29:08 -08:00
Aaron Culliney
20d3a67db8 Increase testing of CPU branch logic, include 16bit underflow and overflow
- Unlikely that the original Apple //e ever saw this happen in reality?
    - TODO : test with valgrind for invalid code access ...
2015-02-16 12:18:59 -08:00
Aaron Culliney
d8ae71ddb0 WARNING : changes test to accommodate CPU implementation
- TODO : check the Apple //e Bible for this ...
    - Calculates 2-byte branch instructions (Bxx +OFF)--that sit right at page boundary (at 0x..fe 0x..ff)--as 3 cycles
      rather than 4, since PC has already advanced to the new page (matches logic currently in x86/cpu.S
2015-02-16 11:57:33 -08:00
Aaron Culliney
15dd90902c REFACTOR : more common code into macros 2015-02-16 10:28:57 -08:00
Aaron Culliney
5aa4c20249 REFACTOR : style+clarity changes 2015-02-16 09:42:13 -08:00
Aaron Culliney
d9ce113aa0 WIP : Android armeabi target compiles 2015-02-16 08:47:26 -08:00
Aaron Culliney
6439d303a8 Misc build tweaks 2015-02-16 08:47:26 -08:00
Aaron Culliney
35458b2839 Change LOG() macro to accommodate Android logging 2015-02-16 08:47:26 -08:00
Aaron Culliney
a61b7f5c39 properly brace INTERFACE_CLASSIC stuff 2015-02-16 08:47:26 -08:00
Aaron Culliney
1c31c1074d REFACTOR : macro defines into toggles 2015-02-16 08:47:26 -08:00
Aaron Culliney
00cec0dcae WIP : 65c02 CPU in ARM assembly 2015-02-16 08:47:26 -08:00
Aaron Culliney
0801050455 REFACTOR : move special case initialization codepath to C 2015-02-16 08:47:26 -08:00
Aaron Culliney
30c09da259 REFACTOR : simplified/streamlined some assembly 2015-02-16 08:47:26 -08:00
Aaron Culliney
12ba31f1af REFACTOR : whitespace, style, remove deadcode, extract code into macro 2015-02-16 08:47:26 -08:00
Aaron Culliney
9a87aa8a3d REFACTOR : migrate stack page offset into altzp configuration 2015-02-16 08:47:26 -08:00
Aaron Culliney
7bd7899325 REFACTOR : brace x86-specific defines, prep for __arm__ 2015-02-16 08:47:26 -08:00
Aaron Culliney
b246baa90d REFACTOR : macro renaming for clarity/readability 2015-02-16 08:47:26 -08:00
Aaron Culliney
cf79056b28 Merge x86-specific apple2.h stuff into cpu-regs.h 2015-02-16 08:47:26 -08:00
Aaron Culliney
cec638b959 Get threaded tests unstuck and rename/shuffle some code 2015-02-16 08:46:29 -08:00
Aaron Culliney
50cd4ac6fe Synchronize timing functions
- Avoids resetting critical speaker variables when CPU thread is churning
    - Moves pthread_* variable ownership into timing.c
2015-02-07 14:34:23 -08:00
Aaron Culliney
851d22568b Use 32bit counters to avoid overflow
- Previously there were cases where we could overflow cpu65_cycles_to_execute when adding the cycles_speaker_feedback
2015-02-03 22:10:47 -08:00
Aaron Culliney
1cbd426548 removed unused macros 2015-02-01 15:26:50 -08:00
Aaron Culliney
3d8a6ac23d PARTIAL Revert "Faster keyboard read"
This reverts commit 30b8f308c6.
(Generated assembly for apple_ii_64k ARRAY is wrong on Mac).

Conflicts:
	src/vm.c
2015-02-01 15:25:55 -08:00
Aaron Culliney
c332a89738 Don't run finicky or abusive tests by default
- But keep them around for such times as when we're not sure why a particular emulated program is not working =)
2015-01-31 14:27:13 -08:00
Aaron Culliney
eb534e17b5 Get CPU tests working again 2015-01-31 14:26:45 -08:00
Aaron Culliney
f234de116f Refactor speaker system to prevent audio glitches and to support CPU automatic speed switching
Squashed commit of the following:

    REFACTOR : fix comments, logging, and rename some variables
    REFACTOR : fix up some commentary, clean deadc0de
    REFACTOR : mostly fix all the audio glitches
        - amplitudes of samples are gradually shifted to zero when speaker has fallen silent
        - simplifies speaker state machine
        - fullspeed mode only enqueues quiet samples
    REFACTOR : fix up a number of other functions and comments
    REFACTOR : clean up code to submit normal speed wave buffer to OpenAL
    Move some initializations to the cpu_thread()
    REFACTOR : properly reset the speaker cycles access counter so we don't underflow and assert
    REFACTOR : should never get a split buffer from our soundcore implementation
    Fix warning from gcc ... static array size needs to be computed from integer values
    REFACTOR : gcc (but not clang) complains about these, so just make them preprocessor defines
    REFACTOR : use unsigned long long because we don't actually care that this counter is 64bit
    REFACTOR : remainder_buffer and miscellaneous tweaks
        - Adds implementation commentary to document remainder_buffer purpose
        - Also adds sample average for square wave boundary in case where remainder_buffer not used (whole-sample boundary)
        - Variable renaming and code shuffling
    REFACTOR : do not dynamically alloc remainder buffer
        - Never attribute to cache-coherancy bugs what is a simple thread race =P
    REFACTOR : comments and whitespace
    REFACTOR : rename public speaker API functions
    REFACTOR : clean up public speaker API
    REFACTOR : tabs to spaces
    REFACTOR : moar deadc0de clean up and renaming
    REFACTOR : remove deadc0de paths from soundcore
    REFACTOR : fully excise soundtype stuff now that we only support soundcard output
    Move a file static to function scope
    REFACTOR : rename more variables and remove deadc0de
    REFACTOR : samples_buffer naming and change to explict int16_t
    REFACTOR : removed deadc0de and shuffled code locations
    REFACTOR : remainder buffer naming and clarify type
    REFACTOR : move joystick timing to VM module and remove header visibility
    REFACTOR : clarify speaker variable name
    REFACTOR : clarify cycle counting codepaths
    REFACTOR : VBL/timing interfaces
        - eliminates passing around a common global
    REFACTOR : names and comments
    HACK around volume issue
    REFACTOR : rename speaker feedback variable
    REFACTOR : rename global total cycle count
    REFACTOR : rename a constant
    Fix test builds
    REFACTOR: rename to is_fullspeed
    REFACTOR : local variable naming changes
    REFACTOR : migrate cycle timing variables to correct location and remove header visibility
    Allow fullspeed codepath to update speaker
    REFACTOR : remove deadc0de paths in prep for cleanup
    REFACTOR : speaker now manages its own VM entry point
2015-01-31 13:57:10 -08:00
Aaron Culliney
780905155a Only render if necessary 2015-01-23 23:37:43 -08:00
Aaron Culliney
b4516b49df Add general-use branch-prediction macros 2015-01-23 23:34:03 -08:00
Aaron Culliney
b8c44b81ab Simple FPS logging 2015-01-18 11:10:16 -08:00
Aaron Culliney
30b8f308c6 Faster keyboard read 2015-01-18 11:06:02 -08:00
Aaron Culliney
191a1b7395 Fix Mac builds 2015-01-16 21:11:29 -08:00
Aaron Culliney
b4f91661d7 don't leak a buffer
- thank you, valgrind
2015-01-14 23:24:51 -08:00
Aaron Culliney
882eae4818 Ugh, GLUT idle func was chewing up CPU
- ugh, why is the millis parameter to glutTimerFunc() an int?! 1000ms/60Hz = 17ms
2015-01-14 23:24:33 -08:00
Aaron Culliney
87a2d081d3 CPU_TRACING now emits machine cycles 2015-01-11 18:37:57 -08:00
Aaron Culliney
643a431386 first cut at auto fast-loading of disk images
- automatically adjusts cpu timing to fastest if drive motor accessed recently and no audio/video
    - TODO: audio output clipping issue when (un)pausing audio outpu
2015-01-11 18:35:51 -08:00
Aaron Culliney
cce2bbb0cc timing code cleanup 2015-01-11 12:24:43 -08:00
Aaron Culliney
8d35cf1d2c Rename to motor_off and record motor access times 2015-01-11 12:04:06 -08:00
Aaron Culliney
bf4e920b1f should always be NI2 size for converted PO/DO 2015-01-10 20:45:07 -08:00
Aaron Culliney
dcafae8390 read_rand() is really just floating_bus() return 2015-01-10 19:42:00 -08:00
Aaron Culliney
1ba28db8d7 Varous VM switches return memory floating bus value 2015-01-10 18:46:49 -08:00
Aaron Culliney
381d97c485 Preliminary VBL support sourced from AppleWin 2015-01-10 16:17:18 -08:00
Aaron Culliney
a7cd281037 mark other INTERFACE_CLASSIC codepaths 2015-01-10 14:14:49 -08:00
Aaron Culliney
b031bdb4a6 Refactor private defines 2015-01-10 14:14:49 -08:00
Aaron Culliney
06011e2902 New disk tests and improvements
- Exercise various TRACING codepaths
    - Adds ProDOS-order tests
2015-01-03 16:24:02 -08:00
Aaron Culliney
ffd4647693 Make test_breakpoint() function work again 2014-12-29 21:36:21 -08:00
Aaron Culliney
fdd57f3095 Fix some tests and expose mdstr globally (easier debugger introspection) 2014-12-29 21:36:21 -08:00
Aaron Culliney
af706e7602 rename read_random to avoid namespace collison on Mac 2014-12-29 19:07:43 -08:00
Aaron Culliney
7bc0475a5d disable unstable random2 test 2014-12-28 15:06:59 -08:00
Aaron Culliney
7d3b39926c Disk testing is separate from vm testing
- Breaks out disk testing into its own suite
    - Misc testing and build-system tweaks
2014-12-28 14:50:43 -08:00
Aaron Culliney
cd9a9ad3cf Auto-eject disk if present in drive 2014-12-28 14:48:53 -08:00
Aaron Culliney
e01e437842 Massive disk refactoring sourced from AppleWin
- Attempts to be byte-stream compatible with how AppleWin handles DOS-order, ProDOS-order, and NIB images
    - Adds support for ProDOS-order images
    - First cut at VBL support: (//e FlappyBird boots now!)
2014-12-28 13:07:13 -08:00
asc
34d043330b Silence some valgrind complaints 2014-12-21 13:59:04 -08:00
Aaron Culliney
031a8f51f8 Prevent some segfaults when shutting down on Linux 2014-12-21 13:51:45 -08:00
Aaron Culliney
a24436e88f Gamepad clamp-beyond-radius implemented 2014-12-05 22:31:12 -08:00
Aaron Culliney
dd0085e3d7 key handling improvements
- keyboard joystick axes handled separately
    - discriminate more classic-interface-only codepaths
2014-12-01 22:00:45 -08:00
Aaron Culliney
0f25f6d9d1 srandom/random for PRNG should be "good enough" 2014-11-29 14:23:27 -08:00
Aaron Culliney
b6e329a3c6 Prevent segfault in glGetError() during app initialization 2014-11-29 13:31:21 -08:00
Aaron Culliney
4f0814ce42 Remove unstable __FILE__ output from vmtrace logging 2014-11-29 13:28:34 -08:00
Aaron Culliney
ad39463519 update vmtrace test 2014-11-29 10:04:21 -08:00
Aaron Culliney
6c1215dbb2 Tests build/run on Mac
- Fixes statistics printing
    - Some VM tests currently fail on Mac
2014-11-27 10:52:12 -08:00
Aaron Culliney
2aa2648d30 Fix for other VM/display tests 2014-11-25 22:01:46 -08:00
Aaron Culliney
bc643bfbdb joystick devices only supported under VIDEO_OPENGL 2014-11-25 21:59:05 -08:00
Aaron Culliney
e51a57b376 Fix PAGE2 display test 2014-11-25 21:57:57 -08:00
Aaron Culliney
050d1de389 HIRES PAGE2 test: shows moire on page2 2014-11-25 21:56:44 -08:00
Aaron Culliney
0ad98602fe Improved VM_TRACING syntax 2014-11-23 17:13:05 -08:00
Aaron Culliney
88b7db0387 unwedge test_PHP 2014-11-23 17:12:20 -08:00
Aaron Culliney
101e507add Adds a VM tracing facility and functionality test 2014-11-23 14:03:18 -08:00
Aaron Culliney
89fc5f6599 Display test improvements
* Removes hackish code in testdisplay.c in preparation for a bugfix
    * Adds function to output state of softswitches ... useful from GDB
2014-11-23 12:53:59 -08:00
Aaron Culliney
3536b6b65a Force a splash screen before allowing emulation to start 2014-11-22 14:28:38 -08:00
Aaron Culliney
c075460b76 Gets OpenGL output working with testing VM and display
* Refactors test routine to its own thread to not interfere with OpenGL on main thread
    * Misc TESTING/HEADLESS switch tweaks
2014-11-22 14:24:43 -08:00
Aaron Culliney
8416dd4d49 adds PRNG tests 2014-11-22 14:03:57 -08:00
Aaron Culliney
7ed5250392 new SHA1 to fix cputrace test 2014-11-21 22:27:10 -08:00
Aaron Culliney
4483105edb Don't reset joystick buttons on menu exit 2014-11-19 20:00:13 -08:00
Aaron Culliney
9f1c54e555 Expose c_read_random() 2014-11-19 19:59:39 -08:00
Aaron Culliney
3badb546d6 Annunciator is noop for the moment 2014-11-18 22:31:38 -08:00
Aaron Culliney
e6ca42be64 CPU fixes from tracing against AppleWin
- All regs are 0xFF on reboot
    - Stack pointer is 0xFC on reboot
    - Flags are set accordingly
    - Fix op_JMP_ind tracing display
2014-11-18 22:27:25 -08:00
Aaron Culliney
9bbe906f43 CPU_TRACING bugfix and more readable
- GetImm mode was not reporting correct arg
    - Converts it to a format easier to compare against similar CPU trace output from AppleWin
    - Sanity-check arg counts
2014-11-18 22:16:44 -08:00
Aaron Culliney
9b9ca39344 Improve disk tracing
- Disk trace is now ASCII output
    - Output track sector and file position data
    - Debugger command added
    - New preprocessor define
2014-11-17 20:52:29 -08:00
Aaron Culliney
e5e087c4e0 Refactor joystick handling
* Removes Linux-specific joystick handling
    * Adds cross-platform GLUT joystick handling; Caveats:
        - GLUT is not robust to joystick hot plugging like my old Linux-specific code was.  (Fix should be made in the
          GLUT driver and pushed upstream if we really care)
        - Deprecated X11 renderer now can only use keypad joystick
2014-11-09 15:48:05 -08:00
Aaron Culliney
2c12aa6112 Improve CPU_TRACING output 2014-11-09 13:06:25 -08:00
Aaron Culliney
30d7f88c21 Fix emulation problem manifesting as bug in cracked version of J---- 2014-11-08 00:21:52 -08:00
Aaron Culliney
2d6ca9ce89 don't busy-sleep when paused 2014-11-02 11:46:30 -10:00
Aaron Culliney
c1db658589 Balance EffectiveAddr_X ... CPU_TRACING test passes 2014-11-02 12:10:09 -08:00
Aaron Culliney
9144b48885 Enable abusive CPU_TRACING test 2014-11-02 12:09:30 -08:00
Aaron Culliney
c7c888d218 Refactor style/whitespace 2014-11-01 20:02:44 -07:00
Aaron Culliney
74943c71e5 Fix INITHELLO for dsk images
* This has apparently been broken since around the turn of the millenium from an ancient refactor.  Luckily I still
      have earlier pre-git code drops ;-)
2014-11-01 19:47:38 -07:00
Aaron Culliney
b3c1af9786 disk INITHELLO tests ... 2014-11-01 19:26:40 -07:00
Aaron Culliney
31b87f67e4 Refactor test_setup_boot_disk 2014-11-01 18:44:54 -07:00
Aaron Culliney
4ff57ab7dd Slightly improve CPU trace files 2014-10-31 16:32:34 -07:00
Aaron Culliney
6fdeee3896 Cleanup and fixes for compiler warnings 2014-10-31 16:27:39 -07:00
Aaron Culliney
65f991ebcc Build fixes for deprecated X11 variant 2014-10-30 00:11:17 -07:00
Aaron Culliney
5af194c56d Fixes main menu issue 2014-10-29 21:48:44 -07:00
Aaron Culliney
0eeb93820c Fix Open-Apple (joy button 0) stuck after reboot 2014-10-25 12:51:09 -07:00
Aaron Culliney
a2a55d53ed Fixes for various clang static analyzer issues 2014-10-25 11:53:44 -07:00
Aaron Culliney
29e8502f23 Silence compiler warnings on Mac 2014-10-25 10:18:22 -07:00
Aaron Culliney
3ce9149b6f Fix more compiler warnings and possible display bugs 2014-10-25 09:00:06 -07:00
Aaron Culliney
551cc00781 Silence a number of clang compiler warnings on Linux 2014-10-25 08:44:21 -07:00
Aaron Culliney
737c780929 Fix test break 2014-10-25 08:26:53 -07:00
Aaron Culliney
c140c5c7e0 Mini-refactor 2014-10-19 12:54:03 -07:00
Aaron Culliney
a42a10eb86 Beginnings of key handling for Apple2Mac 2014-10-12 17:09:54 -07:00
Aaron Culliney
6c63c49d09 Improvements to Mac GUI
* Reboot... menu option
    * Disk image selection interface
    * Whitespace code changes
2014-10-12 16:43:51 -07:00
Aaron Culliney
442e4c99b2 Display tests on Mac and Mac tests cleanup 2014-10-12 12:42:29 -07:00
Aaron Culliney
e941d5b10f First cut at getting audio working on Mac 2014-10-12 12:14:13 -07:00
Aaron Culliney
13d17af838 Simplify OpenAL code 2014-10-12 10:46:12 -07:00
Aaron Culliney
7f395edc11 comment unstable test 2014-10-11 19:59:44 -07:00
Aaron Culliney
f11b6948bb Work around broken assembly for PLP instruction on Mac 2014-10-11 19:36:49 -07:00
Aaron Culliney
a37ed6cd98 tests run again on Mac 2014-10-11 19:34:12 -07:00
Aaron Culliney
c4609e0c68 Improved PLP and PHP tests 2014-10-11 19:33:13 -07:00