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 > DS memory mirroring / layout?

#47680 - chishm - Tue Jul 12, 2005 6:52 am

I know I have asked this before, but it was kinda buried in another topic. Sorry for the spam if you care. Anyway here is my question:
According to DSTek IWRAM starts at 037F:8000. There is no memory mapped to 0300:0000 (normally GBA IWRAM). What actually happens if you try to read or write 0300:0000 (from the ARM7)? Is it a mirror of shared IWRAM or exclusive IWRAM, or is it constantly zeroed, or is it simply not connected?
This is kinda important for me to know, as it makes the difference between easily running code on both DS and GBA and having to detect the DS and switch address spaces manually.
Thanks for any help, and sorry for being a pain in the a**.

#47700 - tepples - Tue Jul 12, 2005 2:36 pm

The GBA mirrors its IWRAM at 0x037F8000.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#47747 - chishm - Wed Jul 13, 2005 12:15 am

tepples wrote:
The GBA mirrors its IWRAM at 0x037F8000.

Of course! Why didn't I think of that. Thanks for reminding me of this. Stupid me. :-D

#47750 - gladius - Wed Jul 13, 2005 1:32 am

Just for clarification, the DS IWRAM is also located at 0x03000000 (well, who knows where it really is, but that makes sense). The entire region up to 0x037FFFFF is a mirror that repeats every 32k.

Making it 0x037F8000 makes it very convenient to get a contiguous 96k region of ram, which is why I believe Neimod did that. In earlier versions of dstek it was actually at 0x03000000.

#47751 - chishm - Wed Jul 13, 2005 1:45 am

Thanks Gladius, that's even better. I only need 1K, so contiguousness (is that a word) is not a problem. I thought it might be mirrored there, but because DSTek specified 0x03F80000 I thought it might have to be accessed at that address.