gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > GBA Mode from DS Bootloader?

#45408 - cory1492 - Fri Jun 10, 2005 12:45 pm

Anyone know how to do this yet?

All I have tried so far is making it boot by using the gba file (specifically my f2a ultra carts bootloader) with a ds header, using the .gba as an arm7 binary like this:
Code:
ndstool017.exe -c booter2.nds -7 f2a7.bin -r7 0x2000000 -e7 0x2000000
I using Darkains multibootloader/FS to attempt this, but all I have in front of me so far is white screens.

I have verified that the cart will read properly with its bootloader.gba even if the bootloader is located as the last rom on the cart (if you load it from the default bootloader that is) but I have no clue as to what preparations need to be made to load it properly once in DS mode...

Does the GBA header have loading address code like the DS header does? I cant seem to find a link to the GBA Tech docs right now...

Any point in the correct direction would be appreciated, all I have right now to work with is this:
Quote:
The following piece of code will make the DS go into GBA mode:
mov r2, #0x40
ldr r12, =0x11B8 @ call some routine in the bios
bx r12
from the NDStech wiki, but it doesnt say what routine is called, or what point/cart address it attempts to start from, and Im not entirely certain how to safely patch that assembly into a prebuilt rom like the standard bootloader...

What I do know for certain is that I have a way to flash the cart with whatever I want on it and in whatever order I would like it to be in, without using the standard flashing tool which forces things like the bootloader to be in certain places... which took some doing and is still going through some testing, and will likely mess up any in game resets (which BTW is really for only double jointed fingers on the DS anyway).

As a final question, is there a good list of opcodes for the ARM7 and 9 architectures (just asking so I dont have to sift through a wackload of PDFs with possibly wrong info for GBA/DS devving)

edit: just to answer my own question on opcodes before ppl start raving about searching, I found this info on the ARM9 here:
http://forum.gbadev.org/viewtopic.php?t=4763&highlight=opcodes
and this on arm in general:
http://www.arm.com/documentation/ARMProcessor_Cores/index.html

#45431 - josath - Fri Jun 10, 2005 5:24 pm

When you use the code from the ndstech wiki to switch to gba mode, it starts executing at the beginning of the gba rom 0x08000000 (actually skips over the header), NOT from ram (0x02000000)

Ideally, what you'd do is use your carts bank/offset switching registers to make the beginning of gba rom (0x080..) point to a gba rom. this probably WONT work with gba menus/bootloaders, as they most likely expect themselves to be at the beginning of the rom and might get confused if they are not.

#45491 - tepples - Sat Jun 11, 2005 5:27 am

And by that time, you're trying to do exactly what they're talking about in this topic. Please take discussion there.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.