First step would be to make sure Gamebuino's LOADER.HEX compiles and runs properly on the Zero. Actual game loading won't work at this stage but it will allow you to test that the SD functions work as expected.
Next step would be to download the
zero bootloader source code and get it to compile.
The next step would be to modify the bootloader to load LOADER.HEX on launch when the C button is held down. The zero has 256kb of flash which is 8 times larger than the Atmel328p so I'd probably just use the regular File/SD libs. Keep in mind that none of the compiled games will work on the zero, you'll have to recompile them all specifically for ARM just as you did for the loader.
Finally add two functions to the loader which applications can call directly: load_game and write_flash_page (see the wiki for more info on how these work). You'll need to set these at a fixed address in the bootloader, which will require messing around with the bootloader make file settings, and you'll also need to make the relevant changes to the address in Gamebuino.h:
- Code: Select all
#define load_game (*((void(*)(const char* filename))(0x7ffc/2)))
#define write_flash_page (*((void(*)(const char * page, unsigned char * buffer))(0x7ffa/2)))
With this done do a recompile of loader, it should pick up the new address and now load games correctly.