Guide to convert region/version of MSU1 patches.
Zeldix :: MSU-1 Hacking :: MSU-1 Useful Things :: Tutorials
Page 1 of 1
Guide to convert region/version of MSU1 patches.
Tools I Use:
notepad++
bsnes plus
asar
What you need:
MSU1 source code
Original target ROM for MSU1 code
Target new region or version rom
In this example I will be using U.N. Squadron by PepilloPev.
In my working folder I have the U.N. Squadron rom, the Area88 rom (Japan region) and the .asm source code of PepilloPev's patch.
Don't patch the ROM with MSU1. It should not be necessary at this point.
now, open the .asm file and look at the hooks section.
This patch is nice enough to give us the answer right here, and we are lucky to have only one hook.
Open the original patch target rom in BSNES (in this case, U.N Squadron)
open the BSNES debugger, in the tools menu.
using the debugger, pause the emulation and click "step" so that the code starts to show up.
Right click on the code and say "Jump to Address" and enter the address of the hook. in this case, 8360.
so we can confirm that this hook was:
lda $0be0,x
sta $2140
Now, in the debugger's tools menu, open the memory editor and enter our hook address.
This gives us the code in hexadecimal, how it is represented in the rom.
eg, BD E0 0B = lda 0B E0,x. They are the same thing to the SNES' CPU.
You don't need to understand what the code means to do this, though.
Now, we can open our new target rom, open the debugger, pause emulation, and open the memory editor again.
hit Ctrl + F to open the search function of the memory editor, and let's search for bde00b8d4021
This equates to the entire hook.
it found us an address! 834c
So now let's check out this address by jumping to it in the debugger.
This code area matches the one we found in the original target rom, so it is 99.9999% likely to be the new address for the hook. It being very close in address pushes me to think 100%
Update the hook address in the .asm source code now.
You will need to do this for every hook that a game needs. Some games have many hooks, Some games have just one.
Before you are finished, you need to also confirm that the free space the original MSU1 code is targeted for is still free in your target ROM.
The original code targeted free space at 8dfd40 so let's look there in our new ROM using the memory editor.
free space can look different depending on the ROM. it can be a repeated string of text, alternating 00 and FF like this, all FF, all 00.. however this does look like free space, or close enough, so we don't need to change that value in our patch.
there's one more thing to check. this patch also has a table with its own address, like so
This will break the patch. that's normal. we now need to update everywhere in the source code that says "8dffe0" to our new address of "8dffc0" to fix the patch again. (I normally use a find -> replace for this)
Now that we've done all this, save the code and apply it to your new ROM.
This code seems to be in the style of xkas or asar (but you might run into code that looks different and needs to be assembled with a different program)
I run asar since it is compatible with xkas, and patch the new rom (which I have already named to the intended patch name (this saves you from needing to rename all the PCM files)
Give your converted patch a good test run to confirm that it's working. Then you can generate some patches using flips (floating ips) and post it for others to enjoy
notepad++
bsnes plus
asar
What you need:
MSU1 source code
Original target ROM for MSU1 code
Target new region or version rom
In this example I will be using U.N. Squadron by PepilloPev.
In my working folder I have the U.N. Squadron rom, the Area88 rom (Japan region) and the .asm source code of PepilloPev's patch.
Don't patch the ROM with MSU1. It should not be necessary at this point.
now, open the .asm file and look at the hooks section.
This patch is nice enough to give us the answer right here, and we are lucky to have only one hook.
- Code:
; game notes go here
; --------------------------------------------------------------------
; 008360 lda $0be0,x [000be8] A:0000 X:0008 Y:0000 S:02f2 D:0000 DB:00 nvMXdIZC V:236 H:221 F: 8
; 008363 sta $2140 [002140] A:0014 X:0008 Y:0000 S:02f2 D:0000 DB:00 nvMXdIzC V:236 H:229 F: 8
; hook area: hook addresses go here
; --------------------------------------------------------------------
org $008360
JSL codeArea0
NOP
NOP
Open the original patch target rom in BSNES (in this case, U.N Squadron)
open the BSNES debugger, in the tools menu.
using the debugger, pause the emulation and click "step" so that the code starts to show up.
Right click on the code and say "Jump to Address" and enter the address of the hook. in this case, 8360.
so we can confirm that this hook was:
lda $0be0,x
sta $2140
Now, in the debugger's tools menu, open the memory editor and enter our hook address.
This gives us the code in hexadecimal, how it is represented in the rom.
eg, BD E0 0B = lda 0B E0,x. They are the same thing to the SNES' CPU.
You don't need to understand what the code means to do this, though.
Now, we can open our new target rom, open the debugger, pause emulation, and open the memory editor again.
hit Ctrl + F to open the search function of the memory editor, and let's search for bde00b8d4021
This equates to the entire hook.
it found us an address! 834c
So now let's check out this address by jumping to it in the debugger.
This code area matches the one we found in the original target rom, so it is 99.9999% likely to be the new address for the hook. It being very close in address pushes me to think 100%
Update the hook address in the .asm source code now.
You will need to do this for every hook that a game needs. Some games have many hooks, Some games have just one.
Before you are finished, you need to also confirm that the free space the original MSU1 code is targeted for is still free in your target ROM.
The original code targeted free space at 8dfd40 so let's look there in our new ROM using the memory editor.
free space can look different depending on the ROM. it can be a repeated string of text, alternating 00 and FF like this, all FF, all 00.. however this does look like free space, or close enough, so we don't need to change that value in our patch.
there's one more thing to check. this patch also has a table with its own address, like so
- Code:
org $8dffe0 ; loop table 01=no-loop, 03=loop
This will break the patch. that's normal. we now need to update everywhere in the source code that says "8dffe0" to our new address of "8dffc0" to fix the patch again. (I normally use a find -> replace for this)
Now that we've done all this, save the code and apply it to your new ROM.
This code seems to be in the style of xkas or asar (but you might run into code that looks different and needs to be assembled with a different program)
I run asar since it is compatible with xkas, and patch the new rom (which I have already named to the intended patch name (this saves you from needing to rename all the PCM files)
Give your converted patch a good test run to confirm that it's working. Then you can generate some patches using flips (floating ips) and post it for others to enjoy
Re: Guide to convert region/version of MSU1 patches.
That's a nice tutorial, I add only how I do it (usually without the need of a debugger). I use a hex comparison program:
The first is the original and the lower the patched rom.
1. I look for the differences (marked red)
2. I open the different language rom to port the patch to in an hex editor and search for the corresponding bytes there...
(in above ff3 example a5 00 f0 25, a5 01 c5 c5)
3. I change the addresses in the asm or directly the rom to the new ones
It's the same technique you use, but it doesn't need a debugger usually
The first is the original and the lower the patched rom.
1. I look for the differences (marked red)
2. I open the different language rom to port the patch to in an hex editor and search for the corresponding bytes there...
(in above ff3 example a5 00 f0 25, a5 01 c5 c5)
3. I change the addresses in the asm or directly the rom to the new ones
It's the same technique you use, but it doesn't need a debugger usually
Conn- Since : 2013-06-30
Similar topics
» MSU1 Region Compatibility
» Game Boy MSU1 Patches
» MSU1 Getting Started Guide
» Region by pass/checksum all in one
» I need someone to convert some cpu addresses for me :P
» Game Boy MSU1 Patches
» MSU1 Getting Started Guide
» Region by pass/checksum all in one
» I need someone to convert some cpu addresses for me :P
Zeldix :: MSU-1 Hacking :: MSU-1 Useful Things :: Tutorials
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum