Commit Graph

31 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
6439d303a8 Misc build tweaks 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
12ba31f1af REFACTOR : whitespace, style, remove deadcode, extract code into macro 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
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
87a2d081d3 CPU_TRACING now emits machine cycles 2015-01-11 18:37:57 -08:00
Aaron Culliney
1ba28db8d7 Varous VM switches return memory floating bus value 2015-01-10 18:46:49 -08:00
Aaron Culliney
4ff57ab7dd Slightly improve CPU trace files 2014-10-31 16:32:34 -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
4c9c1fb62a First cut at a facility to do CPU tracing
* Also includes a test that traces booting the test disk
2014-10-11 18:28:48 -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
46f8e711f6 tweak comments 2014-06-14 10:34:24 -07:00
Aaron Culliney
126d049ffc Refactor to two jump vectors
* Believe needed to allow minimal change for x86_64 codepath
2014-06-07 16:05:38 -07:00
Aaron Culliney
24ed2ea6ef Refactoring assembly : move x86 registers to separate file 2014-06-07 10:54:56 -07:00
Aaron Culliney
148dfa2f20 Refactor CPU code
* Moves cpu jump table, opcycles table, and others to C
    * Removes support for old/unused/deprecated nmos routines and tables
2014-05-11 17:06:53 -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
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
dd2f22df4a IRQ test 2014-02-22 21:08:01 -08:00
Aaron Culliney
8976808568 More updates to support testsuite 2014-01-25 22:10:33 -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
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
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
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
e70a1ef620 misc cleanups 2013-07-07 13:16:08 -07:00
Aaron Culliney
e919718b73 an uncrustify pass and uncrustify config file 2013-07-05 21:37:13 -07:00
Aaron Culliney
e71efa3acd initial source drop, apple2-emul-0.7.4.tar.gz 2013-06-11 00:08:15 -07:00