News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: NDS ROM edit  (Read 2229 times)

Icecube

  • Newbie
  • *
  • Posts: 2
    • View Profile
NDS ROM edit
« on: July 10, 2014, 10:30:28 pm »
In this example, I'm using Advance Wars DS. I'm trying to add ARM code in the free space of the ROM (say, 0x1C00000), but I can't find the code anywhere in the memory (maybe it's not even written in the memory.).
Is it possible to ensure a certain part of the ROM is written in the specified RAM address?

FAST6191

  • Hero Member
  • *****
  • Posts: 3104
    • View Profile
Re: NDS ROM edit
« Reply #1 on: July 11, 2014, 04:30:44 am »
The DS cart is not memory mapped, anything you want from it you have to copy into memory. Most games will use the onboard file read commands that came as part of the DS SDK but you are not restricted to it if you want to go manual ( http://problemkaputt.de/gbatek.htm#dscartridgeprotocol ).

If you are going in for assembly/something like a binary then you might also consider using the overlay system. The DS sets aside a chunk of memory (and any number of addresses within it) that binary fragments can be loaded into.

Even with the overlays though finding space can be more easily said than done in a lot of DS games. Doable, especially if you aggressively manage it, but still annoying.

If you are editing the first DS game then it is harder but for the second you might also want to have a look at any wifi error codes that might exist, they are not so useful these days (the DS wifi was shut off, though there are hacked servers up if you want that option) and take up the kind of space you can fit a lot of instructions in.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: NDS ROM edit
« Reply #2 on: July 11, 2014, 06:35:23 am »
Overlays are reserved at build time, not at runtime. They are not useful for finding free memory. But they do make loading additional code easy.

Icecube

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: NDS ROM edit
« Reply #3 on: July 11, 2014, 09:23:57 am »
Yes, this is my first time hacking NDS game. I wish you would correct my step.
First, I allocate 01C00000 to 01C10000 after expand the FAT size.
Then I need to create new overlay ID, assigning 03100000 as RAM address and 00010000 as RAM size(and the order of the new allocated address in FAT as the File ID).