Can you patch ds roms to fool them into thinking you have the GBA cart they want inserted?

Zaphod77

Well-Known Member
OP
Member
Joined
Aug 25, 2015
Messages
661
Trophies
0
Age
47
XP
580
Country
United States
With emulators, you can attach both a gba and a ds rom and the emulated DS will detect the emulated gba game.

For obvious reasons, you cannot replicate this with a gba flashcart and ds flashcart on real hardware. The GBA flashcart has to boot to be seen as the real game, and the DS game will just see the menu.

So is there a way to fool the DS rom into thinking the cart is there and unlocking the special content? Wither a patch or a cheat code?

I know this won't help with pokemon imports, but for other purposes it should be possible.
 

catlover007

Developer
Developer
Joined
Oct 23, 2015
Messages
693
Trophies
1
XP
3,254
Country
Germany
atleast in theory it's definitely possible and not even that hard if you know what you're doing. You could probably use an emulator find all places where the game interacts with the gba rom.
 
  • Like
Reactions: pinbi7

pinbi7

Well-Known Member
Member
Joined
Apr 4, 2004
Messages
552
Trophies
0
XP
1,700
Country
Canada
i've only used the gba cart slot to store and load DS games
but i'm pretty sure you should be able to make a 1:1 copy of a GBA game on a flash cart that should be able to act the exact same way as an original
i know my F2A was able to do it
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
35,304
Trophies
2
Website
trastindustries.com
XP
24,977
Country
United Kingdom
Other than pokemon and megaman, and I guess some of the music things but that is a separate concept, is there anything that is not easier to just grab a save, load up in suitable PC emulator, get unlocks and go back from there?
https://nintendo.fandom.com/wiki/List_of_Nintendo_DS_games_with_GBA_connectivity

Anyway I have pondered it before, indeed it was for megaman, but as I own a great many flash carts then... I just use those. You don't even need the whole ROM as everything I tested (which was not everything but a lot) merely needed a suitable header of the ROM.

For the topic at hand though.
DS can read GBA slot (obviously) but it is more limited than the native GBA/GBA mode methods. This is good for you as it means anything reading the 0800000 through 09FFFFFF (though again only the header so it will be in the low 08000000 region) is likely to be what you want to look at - http://problemkaputt.de/gbatek.htm#dscartridgegbaslot
Chances are the check will be a read (don't know if it will be DMA or a CPU memory read command), compare to known value and if good then proceed, if not matching then carry on with life (similar to how save hashes and antipiracy checks might work). You would then presumably change the branch if not equal or whatever it happens to be using for an instruction to always take the GBA cart present path. Alternatively if the serial matches thing sets a flag in memory then you could do that with a cheat.
In the case of megaman (which has multiple possibilities, as does Advance Wars depending upon the region -- there is 1, 2 and the Japanese bundle of 1 and 2 which does something for some regions) what I would hope would happen is each individual serial trips a flag in a IF this set IF this set IF this set flag... type manner but in normal operation only one is set as there can only be one GBA cart present. Many checks one after the other like that is considered bad programming form but for what is otherwise done the once per boot in a menu or something then it could be forgiven and thus I would expect it. Alternatively if it hard exits the loop after the first match you might have to get it to do a few other things but changing things here should be in place program flow options rather than having to crowbar new code in.

I don't know when the check will happen -- during boot/menu or when/shortly before loading the relevant bonus (see earlier link on how to get them) being the two main guesses. You should be able to set a breakpoint (it is a memory address/range after all), and you might even get lucky with a search of a disassembly (other than the DS browser and RAM based homebrew, and a proof of concept ROM hack I did once, nothing other than this should be touching the 08?????? range).

This will necessarily involve fiddling with assembly, which is a bit jumping in at the deep end but this is within reason, though I am not going to rule out being able to find a flag with an emulator (desmume having the GBA faking option, make a savestate some menus before the bonus, select suitable GBA ROM if you have not already, see what changes between launching into that screen and the next, load back savestate and lose the GBA game/replace with a non working one, repeat looking to see what differs between things, might have to repeat that a few times and also do things to eliminate background changes). You also have the other option of replicating whatever inventory item, bonus or the like is given via normal cheats.
 
  • Like
Reactions: SAIYAN48

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
2,381
Trophies
1
XP
2,887
Country
Canada
The GBA flashcart has to boot to be seen as the real game
Nope! It depends on the flashcart. I remember using an EZFlash 3-in-1 for this back in the day; it was necessary only to load the game into PS RAM instead of NOR RAM. (It is much slower to write to PS RAM than it is to NOR RAM, but games written to PS RAM are persistent.) Not sure what the situation is with modern flashcart options. (Writing to PS RAM was also necessary to circumvent copy protection checks in some cases, like with Super Mario Advance 3.)

So is there a way to fool the DS rom into thinking the cart is there and unlocking the special content?
That depends entirely on the specific game. There's a patch for Mega Man ZX, for instance (which is the one a lot of people ask about).
 
Last edited by Kwyjor,

Zaphod77

Well-Known Member
OP
Member
Joined
Aug 25, 2015
Messages
661
Trophies
0
Age
47
XP
580
Country
United States
well yeah if you have a single game only flashcart that will work. but most i know of have a menu to pick the GBA game.

someone else asked "can a rom detect another rom" and gave the example of wanting to provide a gba rom to the R4 flashcart to get the exclusive content for the game, without naming what the game was.

yeah it's pretty much "i wanna get the all the exclusive link content for all my DS roms while playing on my real 3DS".

I was curious if someone had a program that would auto-patch them, or a list of cheats. or some other trick to reliably and simply "put in the cart without really putting in the cart"
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
2,381
Trophies
1
XP
2,887
Country
Canada
I was curious if someone had a program that would auto-patch them, or a list of cheats.
Any such program or list of cheats would inevitably have to be customized for each of the games. So, why not start with the particular games you are interested in instead?
 

DanTheManMS

aka Ricochet Otter
Member
Joined
Jun 2, 2007
Messages
4,402
Trophies
0
Age
32
Location
Georgia
XP
591
Country
United States
Nope! It depends on the flashcart. I remember using an EZFlash 3-in-1 for this back in the day; it was necessary only to load the game into PS RAM instead of NOR RAM. (It is much slower to write to PS RAM than it is to NOR RAM, but games written to PS RAM are persistent.) Not sure what the situation is with modern flashcart options. (Writing to PS RAM was also necessary to circumvent copy protection checks in some cases, like with Super Mario Advance 3.)

That depends entirely on the specific game. There's a patch for Mega Man ZX, for instance (which is the one a lot of people ask about).

I think you have this reversed. NOR flash is the type that is super slow to write to, but acts exactly like an original cartridge and can boot standalone. The other way to load GBA games was to load them into the RAM, had to load it up upon each bootup of the system.

Here's a couple old PH Wiki pages I vaguely remember:

https://web.archive.org/web/2012090...aven.com/ph/wiki/index.php?title=NAND_and_NOR

https://web.archive.org/web/2012090...aven.com/ph/wiki/index.php?title=Block_device
 
General chit-chat
Help Users
    KenniesNewName @ KenniesNewName: Sweet my rg351v left the airport