I saw what the size of the current bootloader is (4042 bytes). What have I gotten myself into?
Yep, gotta fit the video kernel, basic sound, a font, MMC/SD card & FAT16 routines and a nice GUI in 4096 bytes!
I think when designing we should let whatever memory the C-callable Routines (and it's subroutines) be relocatable by a pointer that's passed and or put onto the stack. That way when a game calls a bootloader routine (if it can do that) such as "read sector X", the game can tell were that 512 byte block memory will be located.
Yeah, it already like that. the fat_init and mmc_int takes a single parameter, a pointer to a 512 bytes buffer. But I'm deeply devised on the fact that games should depend on the bootloader to run at all. There was a thread discussing this some time ago (can't find it) and most thought it should be avoided. That said, I'd like to hear what the community has to say and suggest their pro and cons. For one, we can't fit any write routines in there, so the main program must have it. Since the MMC/FAT api uses internal functions & variable, how to share them?? But the Atmega1284 has 128K of flash, meaning the bootloader will be at a higher address making pointer sharing "harder"?
-Uze