#121772 - moshii - Wed Mar 14, 2007 8:07 pm
Hello,
**Skip down to the question if you don't want to read why I need this**
I want to write a piece of code that starts off in NDS mode from a slot 1 device, copies some GBA code into the RAM on the Opera expansion cart and then switches into GBA mode and executes it. The problem I can see is that upon switching into GBA mode the DS is going to start execution from just after where the ROM header is... which can't be done on the Opera cart as the writable memory starts at 0x09000000.
!! The question !!
Does anyone know of a method to switch into GBA mode but specify the entry point? or maybe get it to execute a small loader from the internal ram ala multiboots.
Cheers,
Daniel
#121774 - tepples - Wed Mar 14, 2007 8:23 pm
Nintendo already thought of those angles. The GBA BIOS clears the EWRAM (so multiboot doesn't work) and hard-codes the entry point (so jumping to the populated part of ROM space doesn't work).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#121785 - moshii - Wed Mar 14, 2007 9:08 pm
I guess that's why Nintendo mapped the ram to 0x0900.. instead of the start of the cart space, to stop anyway of getting stuff into the RAM and running it. :/
Thankyou for the info. :)
#121791 - ttabbal - Wed Mar 14, 2007 9:52 pm
I'm working on doing this with the EZ-Flash 3in1 expansion card now. I think I've got the loading working, but had a bug in how I was doing the GBA reboot. I can map RAM or NOR Flash to the 0x08000000 address so I can load whatever I want, if I can get it to work. :) Not bad for about $20USD if we can get the homebrew community into it. This card also has SRAM for saves, so it might be a better choice than the Opera card for GBA.
Personally, I want GBA for Goomba Color. :) My M3CF can do it, but I don't like the great big cart sticking out of the DSLite. So I'm trying to get my M3Simply and the EZFlash cart to play nice together.
If you want an out of the box solution, the EZ5 and the expansion card are available as a bundle from the usual flash cart places. The EZ5 kernel can handle all this by itself.
#121888 - moshii - Thu Mar 15, 2007 1:36 pm
Mmm, might have to get one of those EZ carts then. I have an R4 for my DS. Would you be willing to give me a copy of your code? Save me from reinventing the wheel.
What I would like to do is continue development of GBA stuff but the cart I have uses a multiboot writer on the GBA directly so this is a no go on the DS. Also I have to run the software through VMWare because I don't use Windows. :(
I thought writing to RAM would be a good deal quicker than Flash too.
#121929 - ttabbal - Thu Mar 15, 2007 8:43 pm
moshii, I would be happy to share code. I'll be making a source release once I clean all the junk out of there you don't need. I have lots of commented out code and just plain stuff that isn't needed in there right now and I want to comment it to make it easier for people to understand.
Right now, I can load a small ROM (less than 2MB) into the NOR flash and then the DS sees it just like any other GBA game. There is a thread in the flash equipment forum on this board with details. Won't do you much good until you get a cart though. I know there are a few places selling it now, I got mine from a shop in Australia. It took a while as international mail is slow, but it got here.