SeongGino / ir-light-gun-plus

Arduino powered IR light gun - with force-feedback additions, MAMEHOOKER support, quality of life changes, and (possibly) dubious code quality!
GNU Lesser General Public License v2.1
28 stars 3 forks source link

Add Expanded Save Support #19

Closed SeongGino closed 9 months ago

SeongGino commented 9 months ago

This adds all the things necessary for complete save support; expanding data coverage to all the adjustable aspects of the gun--including pin mapping, toggleable booleans, other settings, and TinyUSB identifiers pulled from the EEPROM.

This also adds the backbone for remote board configuration using serial, under new categories:

For now, this does not cover flash saveram-based devices, causing builds to fail on anything but RP2040 - though since the project primarily targets Pi Pico and its derivatives, which doesn't use an external flash, it's well within board. If anyone wants to fix flash-enabled devices, all that needs to be done in theory is add/expand the flash extended save stuff in SamcoPreferences.c/h.

Quality of code isn't the cleanest, but has worked for my test devices. Note that for TinyUSB identifiers, we handle that directly in the main SamcoEnhanced.ino sketch (currently in TinyUSBInit() method and the fourth tier of Xm-type settings in SerialProcessing(). Variables that used to be bytes are now unsigned integers, to make saving/loading from EEPROM easier.

This also adds some miscellaneous fixes back into the main code, and formalizes Low Buttons Mode (a macro for making A/B turn into Start/Select when aimed offscreen).

Closes #18