Commit Graph

54 Commits

Author SHA1 Message Date
Aaron Culliney
2cc23cf35d Upgrade to GPLv3 "or later" and update copyrights 2015-10-22 21:09:13 -07:00
Aaron Culliney
a1c497bfa0 Lightly refactor testing codepaths for desktop Linux and Android 2015-09-06 22:10:25 -07:00
Aaron Culliney
3b5f57b0cf Get tests working again on desktop Linux 2015-09-05 12:22:29 -07:00
Aaron Culliney
2ec4e46012 Expose a test failure on ARM 2015-03-05 20:59:51 -08:00
Aaron Culliney
404d4cdb4f Various tweaks to CPU tests 2015-02-21 21:00:42 -08:00
Aaron Culliney
41b8ca7700 More canonical test for oVerflow 2015-02-19 20:13:13 -08:00
Aaron Culliney
86e8eeafe2 testcpu is beginning to run (with errors) 2015-02-18 23:09:16 -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
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
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
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
88b7db0387 unwedge test_PHP 2014-11-23 17:12:20 -08:00
Aaron Culliney
c4609e0c68 Improved PLP and PHP tests 2014-10-11 19:33:13 -07:00
Aaron Culliney
e0dbcf4afc Work around an apparent clang bug
* tests were previously reported to fail with -O2 optimization
2014-08-16 11:25:07 -07:00
Aaron Culliney
10e03e9bc5 Get tests working again
* Refactor naming of saved CPU state variables
    * Allows convenient addressing from assembly
2014-06-22 11:17:44 -07:00
Aaron Culliney
3a3219234f Get tests building on OS X 2014-06-21 15:43:24 -07:00
Aaron Culliney
f99f283ff2 Move more common code into testcommon.c 2014-04-26 15:43:40 -07:00
Aaron Culliney
2169ecbab6 Refactor tests to use common code 2014-04-26 14:01:26 -07:00
Aaron Culliney
8b0325d60d "HEADLESS" CPP define and envvar switches
* Allows running emulator in headless mode (default for some tests)
    * setting HEADLESS=1 envvar from commandline will force headless operation
2014-04-26 13:34:35 -07:00
Aaron Culliney
cb04d39c37 Don't check for the I flag on PLP and RTI
* Apparently the I flag is not set for PLP and RTI, or rather, our implementation of
      mockingboard seems to expect it not to be set for these opcodes...
2014-03-30 15:31:57 -07:00
Aaron Culliney
df668f0d6a testrunner.c merged into testcpu.c 2014-03-23 14:46:29 -07:00
Aaron Culliney
20121f38b5 Allow CPU interruption at beginning of stepping 2014-03-22 10:37:04 -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
442915b9cb Branch tests and misc tweaks 2014-02-22 14:28:01 -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
2d6843f854 Simplify non-immediate mode tests
* Removes testing decimal flag for these tests
2014-02-22 09:57:56 -08:00