Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to execute DS code from cartridge?

Tags:

From what I know, code to run on the DS has to be loaded into RAM, thus taking from the already-restrictive 4M. Is there any way to run DS code directly from the image?

like image 867
FeepingCreature Avatar asked Aug 17 '09 20:08

FeepingCreature


People also ask

What is the code on the back of a DS cartridge?

While there are two different formats of code, there are actually three different types of cartridge; original DS, DSi enhanced, and DSi exclusive. All original DS cartridges use the NTR code, and all DSi exclusive use the TWL code, but DSi enhanced can be both.


1 Answers

Short answer: No.

The memory map of the Nintendo DS doesn't include any location that maps to ROM in the DS cartridge.

By comparison, on the Game Boy Advance the area 08000000-09FFFFFF was mapped to the external ROM in the Game Pak. This mapping is included in the DS too, presumably for backwards compatibility and to enable some GBA game and DS game interaction (e.g. Castlevania: Dawn of Sorrow easter eggs). But it only maps to the GBA slot and so only to GBA cartridges.

You could use this feature to read from GBA cartridges in the GBA slot and run code from there in DS mode. Early unofficial rewritable cartridges did just that. This is not very future-proof - it won't work on the DSi which has no such GBA slot. Additionally, Slot-2 cartridges are harder to find nowadays with the regular DS-style cartridges being far more popular and available.

The usual way to create large games that need to run more code than there is memory is to either use code overlays or write your game in a scripting-type language that can load and unload code dynamically.

like image 82
richq Avatar answered Oct 04 '22 15:10

richq