Long story short - I was already familiar with the Arduboy libraries, so for me the most rewarding path was to take the FPGArduino RISC-V core, port it to MiSTer, and adapt the Arduboy C++ code to fit it... which means games need to be recompiled using the modified libraries - a different path would be to take something like this AVR core for example as a starting point:The .HEX files as produced by the Arduino IDE have been modified for use with the core, an empty block of 512 bytes is added to the start and used for non-volatile EEPROM storage, and an end-of-file marker (0x1A) is added to the end.
(Note: this is not a 1:1 FPGA based emulation of the ATmega32U4 microcontroller used in the Arduboy - at this stage it is more a 'simulation' of an Arduboy, using a RISC-V 'soft' microcontroller and a modified version of the Arduboy libraries to re-compile games for this platform... so, existing pre-compiled Arduboy .HEX files are not going to run on this right now! But the majority of Arduboy games are open-source anyway, so it is not a big deal to make any necessary adjustments to the code and then re-compile a compatible .HEX file.)
https://github.com/freecores/avr_core
and adapt it, and build upon it, and have it emulate every possible register and instruction of the ATmega32U4 until you have shaped it to fit around already pre-compiled Arduboy HEX files without having to modify them at all...
Also - Sorgelig, maybe adding this core to the official MiSTer repo (so it downloads automatically during updates) would help alleviate a lot of the issues / pain users seem to be having right now because of the need to download the files manually off GitHub?
PS. ...VIDEO!
