• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] How can I inject a .s ASM Routine in a NDS ROM?

Lunos

Random Uruguayan User
3,114
Posts
15
Years
Hi. I've saw a certain French SoulSilver HackROM called "Mind Crystal" which runs at 60 FPS, or more like 30x2, whatever.
The thing is, the creator of the ROM Hack shared some of the Hack's features in the form of .s files which I think that are actual ASM Routines. What I wanted to know was if someone here knows how to inject these into Clean ROMs.
For example, this is the 60FPS's content:
Spoiler:


Welp, thanks in advance for reading, greetings from Uruguay <3
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
IPS files are designed for making it possible to just click 'apply ips patch' button with a patching tool and then the tool goes through the ips patch file, finds generally data that just tells
1) Where to write to followed by
2) The data to write there.

If these .s files work in a similar way except for the fact that you can't use any tool to automatically apply the changes into a rom file, you have to do the job yourself. By taking a look at that small piece of code you posted here, I assume you're simply supposed to write asm instructions "NOP; STR R0, [R4, #0x2C]; BX LR" in address 0x02000E26 (although I don't know what 'xrpl' stands for so I could be wrong).

Anyway, is that piece of code you wrote here from some .s-file meaning those files are just pure text and cannot be inserted to rom just by copy pasting their contents in there? In case that is the case, you either want to find an asm editor of some sort (like this one for instance which is designed for writing routines into the rom in GB/C asm format: http://www.romhacking.net/utilities/282/), an assembler that can insert "scripted" routines into the rom, or some sort of instruction sheet that tells the hex values of each asm instruction and that way you can use that as a help for writing the routines with a hex editor for instance.
If you're interested in learning, might as well start here http://nsmbhd.net/thread/243-the-arm-assembler-tutorial-tutorial/

P.S
Just noticed they say the CPU architecture of NDS matches that of GBA. This practically means you can "insert" routines the exact same way you could do for GBA. You might as well use that as a help in searching for the solution as well.
 
160
Posts
8
Years
IPS files are designed for making it possible to just click 'apply ips patch' button with a patching tool and then the tool goes through the ips patch file, finds generally data that just tells
1) Where to write to followed by
2) The data to write there.

If these .s files work in a similar way except for the fact that you can't use any tool to automatically apply the changes into a rom file, you have to do the job yourself. By taking a look at that small piece of code you posted here, I assume you're simply supposed to write asm instructions "NOP; STR R0, [R4, #0x2C]; BX LR" in address 0x02000E26 (although I don't know what 'xrpl' stands for so I could be wrong).

Anyway, is that piece of code you wrote here from some .s-file meaning those files are just pure text and cannot be inserted to rom just by copy pasting their contents in there? In case that is the case, you either want to find an asm editor of some sort (like this one for instance which is designed for writing routines into the rom in GB/C asm format: http://www.romhacking.net/utilities/282/), an assembler that can insert "scripted" routines into the rom, or some sort of instruction sheet that tells the hex values of each asm instruction and that way you can use that as a help for writing the routines with a hex editor for instance.
If you're interested in learning, might as well start here http://nsmbhd.net/thread/243-the-arm-assembler-tutorial-tutorial/

P.S
Just noticed they say the CPU architecture of NDS matches that of GBA. This practically means you can "insert" routines the exact same way you could do for GBA. You might as well use that as a help in searching for the solution as well.

But it's not, that the same ASM routines for GBA work for NDS roms? Or yes?
NDS hacking has much more potential, to create long games with much content, but it isn't researched as much as GBA hacking and harder, to hack.
Are there tutorials for NDS hacking?
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
The same asm routines won't work in nds games since practically all routines somehow modify the state of ram memory. In NDS games, the data in ram is different from that in any gba pokemon game (= ram is practically the state of the game containing for example the graphics that are loaded on screen, the pokemon you have and their stats and moves, names of characters, and lots of other data that the game has used in the "early past").

Anyway, what I meant there is that Nintendo DS and Gameboy Advance have the same CPU. CPU for these two devices executes ARM assembly which means that you can write asm routines for both NDS and GBA in the same way, using some tool that can write and insert asm routines for GBA games should also support inserting/writing routines into NDS games.

I just linked you a tutorial into arm assembly hacking which is something that's good to know for hacking both GBA and NDS games.
 
53
Posts
9
Years
  • Seen Aug 26, 2022
Download the latest NSMB editor:
https://nsmbhd.net/file/d86fa4d5bfb663c65bde/nsmb-editor-380b.zip

And follow the instructions in this tutorial (don't download the NSMB Editor revision linked in the tutorial below):
http://nsmbhd.net/thread/1281-how-asm-hacks-are-setup-tutorial/

I modified the ASM Patcher so that it could take into account all 5 Gen IV versions in all 7 languages.
Bear in mind that the .s files you mentioned are specifically meant for SoulSilver (French), if you want to use those hacks in an other Gen IV game, chances are you'll need to tweak the offsets a bit.
 

Lunos

Random Uruguayan User
3,114
Posts
15
Years
Just found the way to reach the goal through a french website called "Pokemon Trash".
It was as simple as to export the ARM9.bin file out of the ROM, modify the 2 bytes at E28 from 25 63 to 00 00, save, reinsert and that's it.
Thanks to everyone <3
 
Back
Top