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 > How many chips are used in the flash cartridge(SD ver)?

#72091 - swzte - Thu Feb 16, 2006 10:09 am

As we all know,the flash cartridge supporting SD usually include sram , flash, cpld and sdram etc. Who can explain the use of every part? Thanks a lot.

#72093 - chishm - Thu Feb 16, 2006 10:17 am

SD Port: Used to interface to an SD card to read data.
Flash: Stores the firmware.
SDRAM: Stores loaded data to emulate a GBA cart
CPLD: The "controller". It is what switches between the other devices based on commands from the host (GBA or DS console).
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#72094 - swzte - Thu Feb 16, 2006 10:34 am

chishm wrote:
SD Port: Used to interface to an SD card to read data.
Flash: Stores the firmware.
SDRAM: Stores loaded data to emulate a GBA cart
CPLD: The "controller". It is what switches between the other devices based on commands from the host (GBA or DS console).


I have a question about SDRAM. What's the meaning of the loaded data you metioned above?It's the program data or other data? If it's program data, why not directly copy the data from SD card to the main ram of DS. Besides, the size of SDRAM is usually 32M bytes and if the nds game is bigger than 32M byte, not all data can be loaded into the SDRAM.Is it right?Thanks a lot.

#72099 - FluBBa - Thu Feb 16, 2006 12:12 pm

chishm wrote:
SDRAM: Stores loaded data to emulate a GBA cart


Most (if not all) of the current "DS" flashcarts where made with the GBA in mind so they include RAM (up to 32MB) to support GBA games, it's not used to hold the entire DS game, maybe used as a read cache or something.
_________________
I probably suck, my not is a programmer.

#72152 - The 9th Sage - Thu Feb 16, 2006 7:05 pm

FluBBa wrote:

Most (if not all) of the current "DS" flashcarts where made with the GBA in mind so they include RAM (up to 32MB) to support GBA games, it's not used to hold the entire DS game, maybe used as a read cache or something.


At least with the M3, smaller NDS games you actually can load them totally into RAM.
_________________
Now with 20% More Old Man from Zelda 1 than ever before!

#72210 - swzte - Fri Feb 17, 2006 1:45 am

Quote:
Most (if not all) of the current "DS" flashcarts where made with the GBA in mind so they include RAM (up to 32MB) to support GBA games, it's not used to hold the entire DS game, maybe used as a read cache or something.

When analyzing ndsmall.s(from CVS), we can find that this little program only copy the arm7 program and the arm9 program to main ram and shared ram respectively. However, the main ram is only 4M bytes and the shared ram is only 32k bytes.When adding ndsmall.s to a 32M bytes ds game, it can run very well. Why?Who can give an explanation?

#72234 - knight0fdragon - Fri Feb 17, 2006 3:32 am

FluBBa wrote:
chishm wrote:
SDRAM: Stores loaded data to emulate a GBA cart


Most (if not all) of the current "DS" flashcarts where made with the GBA in mind so they include RAM (up to 32MB) to support GBA games, it's not used to hold the entire DS game, maybe used as a read cache or something.


i always assumed that the DS executable was loaded into the ram and it treats the rest of the data like files you would grab off the HDD


lookin at an example RE loads in at 1426 and the arm7 and arm9 total is ~ 1426
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#72236 - tepples - Fri Feb 17, 2006 3:36 am

knight0fdragon wrote:
i always assumed that the DS executable was loaded into the ram and it treats the rest of the data like files you would grab off the HDD

This is correct, but some CF cards are slower than DS Game Cards, so the adapters' piracy patches read the first 256 Mbit of the game into RAM for faster access. If you want to learn more about this process, go ask at Pocket Heaven.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#72239 - swzte - Fri Feb 17, 2006 3:57 am

tepples wrote:
knight0fdragon wrote:
i always assumed that the DS executable was loaded into the ram and it treats the rest of the data like files you would grab off the HDD

This is correct, but some CF cards are slower than DS Game Cards, so the adapters' piracy patches read the first 256 Mbit of the game into RAM for faster access. If you want to learn more about this process, go ask at Pocket Heaven.


Ok! Thanks everybody here. After the ds executable is loaded into main ram the PC pointer is set to ARM7 entry. The game runs and the CPU control is given to the ds executable. However, if the executable size is bigger than 256 Mbit. how to do with the rest data other than the fisrt 256 Mbit which is loaded in to the ram.

#72241 - tepples - Fri Feb 17, 2006 4:01 am

So that we can give you the most relevant response, what do you intend to do with this information?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#72244 - swzte - Fri Feb 17, 2006 4:15 am

tepples wrote:
So that we can give you the most relevant response, what do you intend to do with this information?



Oh I'm a newbie to DS. After a look into the pin definition of the GBA cart, I think at most 256 Mbit game can run in the GBA cart. But I know I am wrong because many kinds of carts support games bigger than 256 Mbit. Howeber, I'm still wonder about the trick.Can you give an explanation?Thanks a lot!

#72246 - tepples - Fri Feb 17, 2006 5:06 am

Three methods:
  1. Bankswitching (common on NES and GB, not so much on official GBA games; use on GBA is primarily in unlicensed flash carts designed to hold multiple programs) - see article at Wikipedia and article at PHWiki
  2. Loading things from CF into RAM
  3. Streaming directly from CF

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.