Commit Graph

66 Commits

Author SHA1 Message Date
Aaron Culliney
397b43b3e7 Improve joystick button reset procedure 2019-11-10 16:10:08 -08:00
Aaron Culliney
8f2ab2f072 Compress cpu65_vmem_* function tables to save space 2019-10-27 16:26:35 -07:00
Aaron Culliney
1491d3f88d Streamline 65c02 cpu on ARM 2019-10-21 07:35:54 -07:00
Aaron Culliney
82813b3ac8 Use correct initial pointers 2019-10-06 16:25:59 -07:00
Aaron Culliney
788c6cb172 Refactor touch joystick variants
- Use end-of-video-frame callbacks for more conformant delay timing
    - Allow full octant for button side in touch keypad joystick
    - Improved response upon unambiguous touch event (e.g., octant change) to immediately press key
2019-06-02 13:08:16 -07:00
Aaron Culliney
fb44420713 Testing is beginning to work again after upheaval
- testcpu, testvm, testdisk all look good
    - TODO : testdisplay, etc ...
2018-11-11 19:43:49 -08:00
Aaron Culliney
f235dd6d7c Introduce some one-off memory fixes for poorly-written kracks 2018-11-11 08:22:04 -08:00
Aaron Culliney
dfbc97d7a5 Screen holes should not trigger graphics updates 2018-11-11 07:23:47 -08:00
Aaron Culliney
2928556be8 Optimize video scanner+generator when nothing has been drawn
- Video updates trigger one full frame + one (sub-)scanline re-generate
    - Otherwise video_scannerUpdate() doesn't do much work
2018-11-10 16:49:55 -08:00
Aaron Culliney
227098ec52 Refactor video/display rendering
- Import NTSC video display modes
    - Migrate to using full-color framebuffers
    - Mac and Android builds somewhat working
    - TODO : likely breaks display testing
2018-11-04 14:07:30 -08:00
Aaron Culliney
75edac3ace First cut at implementing conformant video scanner 2018-07-29 18:33:17 -07:00
Aaron Culliney
7ac8f4303c Repurpose a softswitch printing function 2018-07-29 16:26:07 -07:00
Aaron Culliney
51d2efba03 Streamline CPU tracing codepaths and remove some deadc0de 2018-03-31 12:48:14 -07:00
Aaron Culliney
e4e0c941d3 Refactor CPU assembly for simplicity and efficiency
- Variables needed in assembly now accessible in a struct pointer that  avoids __PIC__ nastiness
    - Reduces code size and execution time for CPU thread
2018-01-15 16:19:21 -08:00
Aaron Culliney
d226db8021 Better naming in font loading functions 2017-08-15 18:43:48 -10:00
Aaron Culliney
f8b4602fca Beginning to refactor display and backend video
- Futher disentangle display, interface, and video backends
    - Backend video owns the staging/intermediate framebuffer for now
    - Add the beginnings of display update callbacks
2017-08-06 12:12:12 -10:00
Aaron Culliney
3b1c72e872 Excise RELEASE_LOG() and RELEASE_BREAK() macros
- LOG() and assert() work just fine ;)
2017-07-15 14:19:31 -10:00
Aaron Culliney
1294485a02 Beginnings of a pluggable peripheral card API and fix a CPU boot tracing divergence against AppleWin
- In particular, return floating_bus() for non-plugged in cards when accessing the $C100-$C700 range
2016-10-09 12:19:32 -07:00
Aaron Culliney
ccd05e52fe Improve timing conformance in Mockingboard
- Correctly calculate 7 cycles for handling IRQs
    - More frequent calls to MB_UpdateCycles()
    - Correctly calculate timing for MB_EndOfVideoFrame() when testing/tracing/debugging
2016-10-09 12:19:21 -07:00
Aaron Culliney
7a82bbf471 Unbreak Mockingboard codepaths 2016-07-24 17:55:07 -07:00
Aaron Culliney
cc9a164bec Audio codepaths now always enabled
- Supported platforms:
        - Mac/iOS (OpenAL)
        - Desktop Linux/POSIX (OpenAL)
        - Android (OpenSLES)
    - TODO : for POSIX builds we should provide our own "null" audio backend if OpenAL/OpenSL not found by build script
2016-07-23 17:23:54 -07:00
Aaron Culliney
3ed159dd0b Lightly refactor joystick and button handling during reset
- Remove unused button2 variable
    - Remake little-used backend joystick reset function as function pointer
    - Allow soft reset and self-test on Android (although there is still a race condition due to code that directly sets
      joy_button[12] values
2016-04-17 11:42:13 -07:00
Aaron Culliney
74a5b74ae3 Refactor prefs into JSON publish/subscribe API
- Breaking changes currently only tested on Linux desktop build =P
    - Goal is to eventually eliminate most/many of the disparate getter/setter functions to allow better
      modularity/scaling and platform portability
2016-03-26 13:44:13 -07:00
Aaron Culliney
7ef70e7943 Make use of the video memory dirty bit 2016-02-15 13:30:35 -08:00
Aaron Culliney
829291feba Refactor all drawing to run on video thread in one scanner pass
- Moves extra work off CPU/audio thread
    - Prepares the way to possibly remove the vestigal intermediate indexed framebuffer and do direct RGBA_8888 writes
      to XImage or OpenGL texture
    - Prepares the ground for possible better emulation of video scanner hardware

Conflicts:
	src/display.c
	src/video/glvideo.c
	src/video/video.h
2016-02-15 13:29:58 -08:00
Aaron Culliney
ac151ae9e9 Bugfix Mockingboard volume getting improperly reset 2016-01-30 14:46:08 -08:00
Aaron Culliney
090f5f4db4 Don't actually draw unless byte written to active page or page was swapped
- Avoids "flicker" in 80's apps that use double buffering
    - Possibly improves performance since we only take the render hit in page swap (or direct render to visible page)
2016-01-20 23:16:34 -08:00
Aaron Culliney
b9d6d38b17 First cut at save/restore emulator state feature
- This adds to overall UX ... (you can finally finish some very difficult arcade games by strategically leveraging
      this feature)
    - Currently enabled for Android, but not Android-specific
2015-11-22 18:22:01 -10:00
Aaron Culliney
2cc23cf35d Upgrade to GPLv3 "or later" and update copyrights 2015-10-22 21:09:13 -07:00
Aaron Culliney
4e478d369c Refactor disk interface API function names 2015-10-15 22:51:44 -07:00
Aaron Culliney
ed60b2ea73 Refactor VM initialization and shutdown 2015-09-11 23:03:17 -07:00
Aaron Culliney
5c3791f5dc Refactor GL Touch Joystick (PART I Native changes)
- Move touch-handling code for "regular" touch joystick into separate file
    - Add new touch-handling code for "keypad" touch joystick.  This is a somewhat complex state-machine to determine
      which key to press depending on a full keypad rosette.
    - Adds a callback to vm.c to hook into keyboard read callback.  Allows us to immediately queue the next key if the
      keypad touch joystick is long-pressed for either axis or button keys.
2015-08-18 21:59:41 -07:00
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