- Differentiate between cpu_pause() when going to menu (and app is still foregrounded, and cpu_pauseBackground()
when a system backgrounding event has occurred.
- Destroy/free audio resources owned by CPU thread when background is requested, put CPU thread into waiting upon
pthread condition to resume.
- Mobile device now always signals pthread condition to force CPU thread resume from background
- 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 =)
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
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
- 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
* 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
* 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 ...
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.
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.