#11826 - Mega386 - Mon Oct 20, 2003 11:08 pm
im making a multiboot utility but dont know how to tell where the beginning of other gba roms are located in the cart. help!
#11828 - niltsair - Mon Oct 20, 2003 11:22 pm
2 Ways :
1. At a fixed position, at the end of your rom, append pointers to the roms and each rom data. Exemple :
-Say your MB program is 50,000 Bytes long
-Store pointer to Roms at address 50,000 - 51,024 (256pointers, 4Bytes per pointer)
-Append each rom, one by one. When appending 1 rom, update it's pointer value (current size of file + 0x8000000)
-In your program, create a pointer to 0x8000000 + 50,000.
-To access 3rd rom, byte 0 : pointer[2][0].
2. At the begining of every Roms, include a sequence of bytes that will always be the same. You then look for them.
_________________
-Inside every large program is a small program struggling to get out. (Hoare's Law of Large Programs)
-The man who can smile when things go wrong has thought of someone he can blame it on. (Nixon's Theorem)
#11880 - Mega386 - Wed Oct 22, 2003 11:58 pm
i like the sound of method 2, how would i go about doing that?
#11882 - tepples - Thu Oct 23, 2003 1:02 am
1. Read your flash cart's technical reference to determine how it bankswitches. The flash cart manufacturers don't publish much, but you can learn a lot by reading the visoly.s source code that comes with PogoShell.
2. Read gbatek to learn what the GBA recognizes as a valid header.
3. Loop through the whole cart, looking for valid headers. Store their addresses.
4. Draw the names of the valid headers to the screen.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.