Commit Graph

34 Commits

Author SHA1 Message Date
Aaron Culliney
ee73c5890b base_c4rom is a flexible pointer 2015-03-10 10:23:52 -07: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
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
30b8f308c6 Faster keyboard read 2015-01-18 11:06:02 -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
af706e7602 rename read_random to avoid namespace collison on Mac 2014-12-29 19:07:43 -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
Aaron Culliney
0f25f6d9d1 srandom/random for PRNG should be "good enough" 2014-11-29 14:23:27 -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
0ad98602fe Improved VM_TRACING syntax 2014-11-23 17:13:05 -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
3badb546d6 Annunciator is noop for the moment 2014-11-18 22:31:38 -08:00
Aaron Culliney
670a776571 Fixes for Linux build 2014-06-21 23:40:04 -07:00
Aaron Culliney
4597bb2a7e use arc4random_uniform() 2014-06-21 14:52:13 -07:00
Aaron Culliney
4e6718be37 Tweak joystick x-axis
* Seems to make S.R. play better and doesn't affect A.H.
2014-05-11 17:45:00 -07:00
Aaron Culliney
7d97d2e211 Complete refactoring VM routines to C 2014-05-11 13:54:03 -07:00
Aaron Culliney
f785da40e9 refactor C3ROM,CXROM switches to C 2014-05-10 22:39:03 -07:00
Aaron Culliney
400364b739 refactor some softswitch query routines to C 2014-05-10 22:14:46 -07:00
Aaron Culliney
cb387f21dc refactor DHIRES,IOUDIS switches to C 2014-05-10 22:07:25 -07:00
Aaron Culliney
2932c6b832 refactor ALTCHAR switch to C 2014-05-10 21:41:48 -07:00
Aaron Culliney
e6c582bab6 refactor 80COL switch to C 2014-05-10 21:36:55 -07:00
Aaron Culliney
a206fc06b8 refactor ALTZP switch to C 2014-05-10 21:25:54 -07:00
Aaron Culliney
bb4acc967c refactor RAMRD,RAMWRT switches to C 2014-05-10 14:19:06 -07:00
Aaron Culliney
ba1c2b0451 refactor 80STORE switch to C 2014-05-10 13:59:07 -07:00
Aaron Culliney
5249248aaa refactor language card switches to C 2014-05-10 13:40:29 -07:00
Aaron Culliney
1c3fc78838 refactor game controller switches to C 2014-05-10 13:08:44 -07:00
Aaron Culliney
ebde9266e3 refactor HIRES switch to C 2014-05-10 12:36:59 -07:00
Aaron Culliney
2600c13723 refactor TEXT and MIXED switches to C 2014-05-10 12:26:06 -07:00
Aaron Culliney
8b00636f66 refactor PAGE2 switch to C 2014-05-10 11:56:54 -07:00
Aaron Culliney
9ff453be23 Beginning to refactor memory.S -> vm.c 2014-05-10 11:55:41 -07:00