Commit Graph

1155 Commits

Author SHA1 Message Date
Aaron Culliney
2369481924 Use sane defaults 2014-03-30 10:41:28 -07:00
Aaron Culliney
98cd975328 ifndef MIN() & MAX() macros 2014-03-30 10:39:45 -07:00
Aaron Culliney
78a3b39f6d Interface menu changes
* Added an option to set caps lock (basing it off X11's value is not working well)
    * Added a reboot emulator option (because Ctrl-Alt-End is potentially mapped by the X11 WM. ahem, Xfce...
2014-03-25 23:42:05 -07:00
Aaron Culliney
e54ce95389 Move disk compression routines to disk module
* Makes these routines useable from alternate interfaces, (including tests)
2014-03-25 22:11:01 -07:00
Aaron Culliney
df668f0d6a testrunner.c merged into testcpu.c 2014-03-23 14:46:29 -07:00
Aaron Culliney
1dd72ec999 Codepaths for VIDEO_X11 macro conditional 2014-03-23 14:43:19 -07:00
Aaron Culliney
e57f332ff6 moar ifdefs for various macro conditional codepaths
* INTERFACE_CLASSIC : specifies the "classic" (current) menuing system
    * AUDIO_ENABLED : specifies whether audio code is enabled
2014-03-23 14:25:28 -07:00
Aaron Culliney
a95354d87c cycles_adjust is too small to be worth calculating 2014-03-22 16:39:07 -07:00
Aaron Culliney
f34eff338b 65c02 Debugger fixen
* Threading fixes to allow CPU thread to iterate while under control of interface/video thread
2014-03-22 13:57:51 -07:00
Aaron Culliney
c300e3e016 Fix cycle count on op_STZ_abs_x 2014-03-22 11:16:40 -07:00
Aaron Culliney
20121f38b5 Allow CPU interruption at beginning of stepping 2014-03-22 10:37:04 -07:00
Aaron Culliney
a4221e90da comment opcodes 2014-03-19 20:07:36 -07:00
Aaron Culliney
6df967462e Fix STx commands
* Remove deadc0de op_STA_imm
    * Fix cycle counts
    * Bugfix op_STZ_zpage_x
2014-03-16 14:48:22 -07:00
Aaron Culliney
5709788323 test Txx opcodes 2014-03-16 14:43:05 -07:00
Aaron Culliney
7093d69fd4 test STx instructions 2014-03-16 13:39:31 -07:00
Aaron Culliney
60a740646c test SEC SED SEI 2014-03-16 12:13:33 -07:00
Aaron Culliney
d802595071 RTI & RTS tests 2014-03-16 12:06:20 -07:00
Aaron Culliney
582678d7b2 ROL and ROR tests 2014-03-16 11:37:47 -07:00
Aaron Culliney
e4263a3194 PHx and PLx instructions 2014-03-15 20:55:35 -07:00
Aaron Culliney
fea157cdf6 initialize test RNG and misc tweaks 2014-03-15 20:54:02 -07:00
Aaron Culliney
306d0e7d22 bugfix for op_JMP_ind on page boundaries
* Reference : _Understanding the Apple IIe_ section 4-25
    * Includes testcase
2014-03-15 20:52:15 -07:00
Aaron Culliney
512c06f250 ORA tests 2014-03-15 14:37:15 -07:00
Aaron Culliney
1439dbc773 LSR tests 2014-03-02 17:49:41 -08:00
Aaron Culliney
e959953b03 Improve DEx and INx test logic 2014-03-02 17:24:30 -08:00
Aaron Culliney
3e06870868 Better logic_LDx and LDX LDY tests 2014-03-02 17:06:23 -08:00
Aaron Culliney
3c72a8a5e3 LDA tests 2014-03-02 16:14:16 -08:00
Aaron Culliney
16f061b74a JMP & JSR instructions 2014-03-02 15:14:31 -08:00
Aaron Culliney
4e755ad80f test incrementing instructions 2014-03-02 11:06:02 -08:00
Aaron Culliney
de9a3861ed EOR tests 2014-03-02 10:51:07 -08:00
Aaron Culliney
cc35f5e468 test decrementing instructions 2014-02-23 12:35:01 -08:00
Aaron Culliney
fc33757f97 CPX CPY tests 2014-02-23 11:05:30 -08:00
Aaron Culliney
a1c6b30299 CMP tests 2014-02-23 09:18:09 -08:00
Aaron Culliney
dd2f22df4a IRQ test 2014-02-22 21:08:01 -08:00
Aaron Culliney
9275fb7eba CLx tests 2014-02-22 20:02:58 -08:00
Aaron Culliney
ebb170fb75 BIT tests 2014-02-22 19:44:38 -08:00
Aaron Culliney
8f9c2dcbde Bugfix: use correct addressing mode for BIT variant
* How did this ever... ?
2014-02-22 19:19:51 -08:00
Aaron Culliney
442915b9cb Branch tests and misc tweaks 2014-02-22 14:28:01 -08:00
Aaron Culliney
d481d59851 correct branch cycle counting 2014-02-22 14:00:56 -08:00
Aaron Culliney
07740bbb66 ASL tests 2014-02-22 12:04:29 -08:00
Aaron Culliney
35d75b6205 SBC tests 2014-02-22 10:30:38 -08:00
Aaron Culliney
31ce1d5cf9 Silence and fixes 2014-02-22 10:00:09 -08:00
Aaron Culliney
2d6843f854 Simplify non-immediate mode tests
* Removes testing decimal flag for these tests
2014-02-22 09:57:56 -08:00
Aaron Culliney
c0a1e3e952 Simplify ADC decimal mode test logic
* Skip testing illegal BCDs
2014-02-22 09:53:55 -08:00
Aaron Culliney
43ada45a36 Enable illegal BCD break/debugging
* Debugging builds will now segfault if an illegal BCD is encountered
    * Presumably current x86 undefined behavior does not 100% correspond to 6502
      undefined behavior ... (this bears further investigation)
2014-02-22 09:45:19 -08:00
Aaron Culliney
6724e06500 Test fixes
* Test initial carry logic in ADC immediate mode tests
    * Simplify decimal funneling tests in immediate mode
2014-02-20 10:28:18 -08:00
Aaron Culliney
db420d357b Updates to test procedure and test ADC, AND 2014-02-01 12:42:40 -08:00
Aaron Culliney
f836a3004d some commenting for clarity 2014-02-01 12:18:48 -08:00
Aaron Culliney
4ce4a37dd3 silence some printouts 2014-02-01 12:18:07 -08:00
Aaron Culliney
5215358800 Flag to allow silence on successes 2014-02-01 12:17:19 -08:00
Aaron Culliney
7e9388dda2 Allow for setting greatest breakpoint function
* Allows for breakpointing/debugging failing tests using a debugger
2014-02-01 12:15:16 -08:00
Aaron Culliney
be2da135cf The beginnings of a testsuite 2014-01-25 22:12:54 -08:00
Aaron Culliney
8976808568 More updates to support testsuite 2014-01-25 22:10:33 -08:00
asc
17440949bf Updates to support testing 2014-01-25 14:13:38 -08:00
asc
6864dbe3fc Remove mode option 2014-01-25 14:00:10 -08:00
asc
1009d4e708 Move soundcore-alsa to correct location
* Also these files are deprecated
2014-01-25 13:49:37 -08:00
asc
3abd2e87aa Refactor to use GNU build tools
* Added configure.ac and non-recursive Makefile.am
    * Modularized source into subdirectories
    * Simplified header inclusion
2014-01-22 20:51:50 -08:00
Aaron Culliney
12f6c9704e Support for dynamically changing window size
* Beginning of support for fullscreen mode
    * Fullscreen depends on "fuzzing" the graphics
2014-01-04 14:24:55 -08:00
Aaron Culliney
b5023f88f4 Interface tweaks 2014-01-01 11:36:27 -08:00
Aaron Culliney
58041f5105 Set/synchronize CAPSLOCK from X11 2014-01-01 11:15:54 -08:00
Aaron Culliney
8414a37025 Allow regular arrow keys to move joystick axes
* Useability enhancement for PCs without a keypad or physical joystick/gamepad ;)
    * There will be contention in programs that utilize both the joystick and arrow keys for
      different things, yet I don't know of any examples of this...
2014-01-01 10:55:57 -08:00
Aaron Culliney
4ada3d7319 More sanity with scancodes and keycodes
* Use defines instead of magic numbers in a bunch of places
    * Remove deprecated ii_keymaps and only use iie_keymaps
    * Allow keypad corners for emulated joystick
2013-12-29 18:07:24 -08:00
Aaron Culliney
d2215b0f0b Better calibration extremes 2013-12-29 11:40:19 -08:00
Aaron Culliney
e104ad9cb3 Some timing debugging tweaks 2013-12-29 11:39:34 -08:00
Aaron Culliney
b50d2c89cf Fix potential NULL-dereference 2013-12-29 11:37:05 -08:00
Aaron Culliney
5d405be27a Assure following _ASSERT doesn't fire 2013-12-29 10:59:20 -08:00
Aaron Culliney
760a409762 Remove apparently unused/unneeded js_timelimit 2013-12-29 10:58:43 -08:00
Aaron Culliney
ffd78508ba Better support for keypad emulated joystick
* Allow for automatic recentering of keypad emulated joystick
    * Force X11 to give us a detectable auto-repeat
2013-12-28 21:48:42 -08:00
Aaron Culliney
f8d338b382 Automatically save preference on quit 2013-12-28 14:28:04 -08:00
Aaron Culliney
bca9f24ebe Update preferences for joystick modes
* Preferences file changes to support a fixed joystick
    * Simplify the interface -- remove explicitly setting joy_step
2013-12-28 13:54:26 -08:00
Aaron Culliney
b9815968a1 Various fixes for input handling
* Merges input handling into one routine called thru video_sync at refresh rate
    * Adds keypad joystick calibration routine
    * Simplify joystick calibration routines to use same codepath as main emulator joystick handling
2013-12-28 13:08:35 -08:00
Aaron Culliney
ca5f76fc1a Use GZIP routines for simplicity and compat 2013-12-22 12:37:01 -08:00
Aaron Culliney
ef59e1ae9a Better PC Joystick calibration routine
* Cleaned up the parameters page
    * Tweaked main/credits page
2013-12-21 23:56:21 -08:00
Aaron Culliney
34a5fea9a7 Remove unneeded joystick parameters & preferences 2013-12-21 15:25:02 -08:00
Aaron Culliney
d0ea2d654e Fix the game controller routines to use proper timers
* Add proper timers according to spec mentioned in _Understanding the Apple IIe_
    * This will allow us to refactor/eliminate all the hackish joystick adjustment routines
2013-12-21 13:55:40 -08:00
Aaron Culliney
e0bd3e4017 this assert appears problematic 2013-12-18 20:57:49 -08:00
Aaron Culliney
bf92ad6050 minor logging/comment tweaks 2013-12-18 20:57:13 -08:00
Aaron Culliney
9900a3f283 New splash/credits screen 2013-12-15 14:59:18 -08:00
Aaron Culliney
3340997798 WIP : fix joystick parameters 2013-12-08 16:57:02 -08:00
Aaron Culliney
71d5367875 Preferences changes
* Deprecate "lazy" color modes
    * Allow setting speaker sound volume
    * Make Joystick code more generic (future support of touch input)
    * Deprecate setting emulator mode (//e is ascendant)
2013-12-06 22:55:00 -08:00
Aaron Culliney
bd64a567b0 Output the correct error message 2013-12-06 12:15:03 -08:00
Aaron Culliney
32b807e742 Gracefully handle zlib errors 2013-12-01 12:36:43 -08:00
Aaron Culliney
717b501c5e separate actual inflate/deflate from wrappers 2013-12-01 12:22:55 -08:00
Aaron Culliney
cd2cb71280 Various interface/error handling improvements 2013-12-01 12:08:17 -08:00
Aaron Culliney
a259c34b5c Support .do disk image extensions 2013-12-01 11:14:19 -08:00
Aaron Culliney
f5c8df9a4a Use zlib instead of fork/exec gzip executable
* Now all disk images are saved gzipped
2013-12-01 10:57:58 -08:00
Aaron Culliney
e6ee8db900 Rename protected variable to is_protected 2013-12-01 10:44:32 -08:00
Aaron Culliney
cec59bda47 Removed some gotos and redundant code paths 2013-11-30 20:00:34 -08:00
Aaron Culliney
2ce40ddba9 Some interface/keys cleanup
* Condensed reboot code path into reset codepath
    * Reset sequence now checks for openapple or closedapple key and routes accordingly
    * Pause/Break key is now strictly emulation pause key
    * F4 is now unused
    * End key is now mapped as //e reset key (easier to hit, and less likely window manager is using it)
    * PrintScreen/SysReq key is now unused
2013-11-30 14:14:22 -08:00
Aaron Culliney
05e8e0f4a2 Interface screens are now 80 columns 2013-11-27 12:43:58 -08:00
Aaron Culliney
8959e00eed refactor else if 2013-11-26 14:41:43 -08:00
Aaron Culliney
9cd5fb1406 SSI263 voices/thread is not currently used
* prevent segfaults when emulated program attempts to play SSI263 phonemes
2013-11-26 12:56:53 -08:00
Aaron Culliney
e52b25f170 get joystick working again after a decade 2013-11-25 16:58:55 -08:00
Aaron Culliney
e94e9d6b10 Allow 2x window scale and beginnings of fullscreen 2013-11-24 18:24:00 -08:00
Aaron Culliney
64abddfe2f it's not a //e it's a //ix ! 2013-11-24 15:38:55 -08:00
Aaron Culliney
59f116258a refactoring else if 2013-11-24 15:38:31 -08:00
Aaron Culliney
02ce514399 Ctrl-Pause/Brk should send a reset sequence 2013-11-24 14:33:29 -08:00
Aaron Culliney
a102c82434 fix interface border graphics 2013-11-24 14:08:45 -08:00
Aaron Culliney
97282fa916 fix backspacing disk path in parameters interface 2013-11-24 12:19:54 -08:00
Aaron Culliney
4856a33b28 reset MB if machine is rebooting
* this fixes a bug whereby emulator won't reboot from an active session of using the Mockingboard
2013-11-23 16:00:07 -08:00
Aaron Culliney
32b4cd48c4 switch internal/peripheral rom on CXROM flag
* fixes a bug where op_BRK doesn't work when Mockingboard installed
    * this is still hackish and hardcoded ... ultimately we need an interface to add/remove virtual peripherals
2013-11-22 23:40:24 -08:00
Aaron Culliney
0cc0db17b2 change/move softswitch declarations 2013-11-22 23:37:26 -08:00
Aaron Culliney
0df02c2dc6 timing changes
* values from : _Understanding the Apple IIe_
2013-11-21 21:06:31 -08:00
Aaron Culliney
43add5489b Revert "unnecessary pushes/pops"
This reverts commit 170fbf57f3.  It screwed up
80column display.  We really should be using CDECL calling conventions ...

Conflicts:
	src/memory.S
2013-11-18 22:12:00 -08:00
Aaron Culliney
a6d4f2ccf5 Change some deadc0de ...
* Currently the SSI263 thread is disabled (not even initialized in MB_DSInit()
    * Do we need this stuff?  Methinks we do, yet we don't have a testcase of
      needing it (MB C in 4 & 5 --or-- Phasor in 4 works fine with U5) Wtf?
2013-11-18 22:08:51 -08:00
Aaron Culliney
9aafb2c659 Disable mockingboard thread for now
* The MB thread is currently a resource pig and doesn't appear to be needed
      if we're emulating 2 "C"-type cards in slot 4/5
2013-11-17 16:13:33 -08:00
Aaron Culliney
f210372302 Some OpenAL cleanup
* soundcore-openal.c : Get the OpenAL state only right after queueing buffer (and restart OpenAL if needed)
    * soundcore-openal.c : Handle buffer underruns
    * elsewhere : No longer call DSZero...
2013-11-17 16:10:52 -08:00
Aaron Culliney
0bdfe53395 reduce buffer size for speaker
* this allows for better latency with the 22050Hz sample rate
    * keep the mockingboard at the same buffersize to prevent underruns (latency handled differently there)
2013-11-17 15:53:32 -08:00
Aaron Culliney
bbf3205415 more timing statistics 2013-11-17 15:01:23 -08:00
Aaron Culliney
c0a3df6a2f allow setting speaker volume by sample amplitude 2013-11-17 11:20:26 -08:00
Aaron Culliney
38e95294b6 Decrease audio sample rate to fix mockingboard
* This seems to fix certain OpenAL underflow issues with mockingboard for U5
    * Curiously overflow issues with mockingboard don't appear to glitch ...
2013-11-16 18:31:23 -08:00
Aaron Culliney
e0a79c7c3a pause/unpause audio when enter/exit menus 2013-11-16 13:44:32 -08:00
Aaron Culliney
078391410d functions to pause/unpause all audio 2013-11-16 13:43:10 -08:00
Aaron Culliney
cdb7befe8e fix cursor position in interface parameters menu 2013-11-16 11:19:51 -08:00
Aaron Culliney
766d278601 First cut at supporting mockingboard.
* Now using OpenAL as the main backend, ALSA has been deprecated...

    * soundcore-openal.[hc] - OpenAL sound output for emulator

    * alhelpers.[hc] - OpenAL suport files

    * mockingboard.[hc] , AY8910.[hc] , SSI263Phonemes.h - Mockingboard support ported from AppleWin ...
2013-11-12 23:43:16 -08:00
Aaron Culliney
4beb6d679d include uthash.h 2013-11-02 20:38:29 -07:00
Aaron Culliney
693b9d31bf Support for multiple sound buffers/voices
* In preparation for adding mockingboard support
    * NOTE: ALSA still has a hardcoded 1 buffer assumption with its use of mmapped access
2013-10-22 21:22:43 -07:00
Aaron Culliney
06c6fd9feb don't redefine if defined already 2013-10-22 21:18:03 -07:00
Aaron Culliney
c39bea9580 Partial fix debugger for multithreaded environment
* Fixes crashing observed when trying to use debugger

    * Various refactoring whitespace fixes
2013-10-06 21:01:00 -07:00
Aaron Culliney
527c04e41f Support for new timing model
This is part 2 of 2

    * Handles UI changes to support new delay model, added ability to toggle to
      alternate speed scale

    * Code cleanups
2013-10-06 01:31:58 -07:00
Aaron Culliney
41a1f3d598 Timing model back to nanosleep for sound fidelity
This is part 1 of 2

    * Proper emulator timing is critical for emulating the Apple2 speaker with a
      square wave on a modern soundcard.  The AppleWin sources provided
      reference, inspiration, and source for both timing and speaker emulation
      code.

    * cpu.S, cpu.h, timing.c : OK so I flip-flopped quite a bit here on how best
      to do proper emulator timing, but the previous spinloop implementation was
      not one of my more enlightened decisions :P ... cpu/power consumption
      nightmare ...

    * ds-shim.h, win-shim.h -- Shims for Windows-isms and DirectSound-isms.  I
      assume these will eventually be refactored away...

    * soundcore.[hc], speaker.[hc] -- Directly ported from a recent version of
      AppleWin.  Everything I've added should be braced with #ifdef APPLE2IX.

    * soundcore-alsa.[hc] -- An ALSA backend using mmap'ed soundcard access.
2013-10-05 23:33:18 -07:00
Aaron Culliney
0f26899420 macro refactoring for clarity [sic] 2013-10-05 23:13:24 -07:00
Aaron Culliney
a063669cb8 Add speaker and soundcore targets 2013-10-05 22:51:42 -07:00
Aaron Culliney
3946cc52d0 renamed for clarity 2013-09-15 09:09:29 -07:00
Aaron Culliney
0e81927f5b bugfix: save/restore state before C routine 2013-09-15 09:07:36 -07:00
Aaron Culliney
b0236992d2 style cleanups and an ERRQUIT 2013-09-12 20:47:00 -07:00
Aaron Culliney
1f9a1778b9 spinloop timing that seeks to directly match apple speed 2013-07-25 22:58:31 -07:00
Aaron Culliney
980bcc627d WIP : dynamically adjustable spinloop 2013-07-23 00:33:29 -07:00
Aaron Culliney
da3a78a295 bugfix 2013-07-22 23:49:01 -07:00
Aaron Culliney
319a980254 Default all UNK opcodes to 2 cycles 2013-07-22 22:22:48 -07:00
Aaron Culliney
96d083a2c3 WIP: changes to cpu throttling/timing
WARN: this is still a WIP and untested.  Instead of nanosleep() the cpu thread
now uses an adaptive spinloop.  This better emulates the actual apple //e speed
in preparation to do near-realtime audio.  The drawback is that the cpu thread
is pegged at 100% usage.
2013-07-21 17:20:03 -07:00
Aaron Culliney
d599a2174a refactoring for clarity and adding cycle timing 2013-07-07 20:52:30 -07:00
Aaron Culliney
ae6790ab97 debug logging support 2013-07-07 14:01:21 -07:00
Aaron Culliney
e70a1ef620 misc cleanups 2013-07-07 13:16:08 -07:00
Aaron Culliney
170fbf57f3 unnecessary pushes/pops 2013-07-07 13:13:15 -07:00
Aaron Culliney
5f50068fcd better random 2013-07-07 13:07:26 -07:00
Aaron Culliney
8a4f8284b1 remove extraneous comments
believe these are fixed, it's been a decade :-)
2013-07-06 21:19:50 -07:00
Aaron Culliney
b03a8e6fd8 always support //e 2013-07-06 16:04:36 -07:00
Aaron Culliney
f5d1735f28 more whitespace changes for sanity and righteousness! 2013-07-05 23:08:55 -07:00
Aaron Culliney
6d9aa66c01 whitespace changes for sanity and righteousness! 2013-07-05 22:44:57 -07:00
Aaron Culliney
f462f79708 remove compact.c for simplicity 2013-07-05 21:46:58 -07:00
Aaron Culliney
e919718b73 an uncrustify pass and uncrustify config file 2013-07-05 21:37:13 -07:00
Aaron Culliney
18c3f5f698 we no longer use timers with setitimer and SIGVTALRM, that's so nineties...
instead spin off a cpu_thread and have it ping the main render thread as needed
2013-07-02 01:10:57 -07:00
Aaron Culliney
c51018a2bb we no longer do tight decrement loop to artifically throttle emulation speed.
instead call into a timing function to properly throttle the speed to the target MHz
2013-07-02 01:04:55 -07:00
Aaron Culliney
6c500cad0b no longer support building to SVGAlib 2013-07-02 01:02:54 -07:00
Aaron Culliney
c0f38b902b add timing.[ch] to Makefile 2013-07-02 00:57:21 -07:00
Aaron Culliney
8bd46f494f new cpu throttling routine 2013-06-27 23:36:25 -07:00
Aaron Culliney
faa279f075 Get it compiling and running with 32bit TrueColor 2013-06-24 23:14:39 -07:00
Aaron Culliney
a57b7c129a usleep is now backed with nanosleep 2013-06-24 23:06:09 -07:00
Aaron Culliney
2533108733 don't remove flex-generated file for now... 2013-06-24 23:05:13 -07:00
Aaron Culliney
00c1aacafb incredibly ugly hack, we need a new build system
the build system is broken, just use a generated/kludged Makefile for now
2013-06-24 23:01:51 -07:00
Aaron Culliney
5495020a1e for now include the flex output 2013-06-24 22:57:08 -07:00
Aaron Culliney
bfa84b1f65 get it compiling again 2013-06-19 00:07:41 -07:00
Aaron Culliney
6eef91baf7 simplifications 2013-06-18 00:09:00 -07:00
Aaron Culliney
d5c5654931 debugger is mandatory, you *will* like it! 2013-06-12 00:31:26 -07:00
Aaron Culliney
e71efa3acd initial source drop, apple2-emul-0.7.4.tar.gz 2013-06-11 00:08:15 -07:00