How to remove Asar patches.
If you want to remove a patch, the solution is not to port all of your stuff to a new rom. There's an easier way.
Here's how you do it.
Go to your patch file. As an example, I will be using Ersanio's SMB3 P-Meter. Download.
Now, there are 2 types of edits patches make: simple edits and hijacks. Removing edits is easier, so I will show you how to do that, first.
In Speedbar.asm, you will find the following:
db $3D,$3C,$3D,$3C,$3D,$3C,$3D,$3C ;Arrange the statusbar so the P-meter can fit in...
db $3D,$3C,$3D,$3C,$3E,$3C,$3F,$3C ;
db $FC,$3C,$2E,$3C ;
db $76 ;(Put the little clock before the timer)
Now, to reverse this:
Count the amount of edited bytes. For the first ORG, that is 20. For the second, just 1.
Then, open a clean SMW ROM in a hex editor. I prefer using shex
because of its SNES address support.
Copy over 20 bytes, and put them in a new patch like this, using the same org:
Do the same for the other ORG:
Now, to remove a hijack. A hijack is when there's a JSL or JML into freespace. (anything in freecode comes after a "freecode" or "freedata" command in asar)
First, we will clean up the free space.
autoclean JML Main ;Hijack routine
NOP ;And point to new routine.
Count the amount of bytes between the org and the JSL, plus one. In this case, that amount is 1.
In order to clean the freespace, do the following:
So in this case, autoclean read3($0081EA+1)
After that, count the amount of bytes your hijack uses. In this case, it's 5. (JML is 4 bytes, nop is 1)
Then, look in your hex editor again and place the 5 bytes of that location.
You need to do this (removing the hijack spot, not cleaning the freespace) for each hijack the patch makes.
The finished product should look like this:
This is your Anti-Patch. If you patch this with asar, the original patch will be removed.