Banner
Views: 778,686,126
Time:
6 users online: Golden Yoshi, JensOrbit,  Manofer, Nowieso, TheInsanity115, TheMorganah - Guests: 37 - Bots: 182 Users: 40,831 (1,685 active)
Latest: Gamer Appledash
Tip: Try not to use the exact same background more than once or twice in a row.Not logged in.
How to make a hex edit using asar
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - How to make a hex edit using asar
Pages: « 1 »
So you want to make a hex edit, but oh no! Your hex editor doesn't support these new addresses in the ROM map! What to do?

Well, probably the best solution is to use patches. You could use Lunar Address to convert the SNES ROM addresses to PC and edit with a hex editor as you usually would, but using patches is easier and more convenient! For instance, if you ever need to port to a new ROM, you don't need to remember all the hex edits you did and do them one by one - just run Asar and they're all instantly in!

Now, let's dive in. This is the basic format:

Code
org $XXXXXX
db $YY


The SNES address should replace the X, while the byte you're replacing it with will be Y.

So let's say we want to change how many lives the player starts with from 5 to 10. Simple; the address is $009E25 and the byte we want is 09. So:

Code
org $009E25
db $09


It's that simple!

But what if you have several consecutive bytes you want to change? Let's grab another example.

Quote
$029347 3 bytes ASM Change to [20 E2 FF], and change $02FFE2 from FF FF FF FF FF to A9 02 4C BA 91, to fix the glitch where placing a coin above a ? block or turn block will cause the coin to leave behind an invisible solid block if the block below is hit.


The obvious solution would be a long string of orgs and dbs, but you can also do this:

Code
org $029347
db $20,$E2,$FF

org $02FFE2
db $A9,$02,$4C,$BA,$91


And there you go!

And, as a final point, you can add comments that won't affect the edits themselves. Simply add a semicolon (;) at the end of a line and type away. For instance:

Code
org $009E25
db $09 ;start with 10 lives


And that's it! It's not terribly difficult once you get the hang of it, and can end up saving you a lot of time if you ever need to port to a new ROM. And once you get really good at it, it can even save time compared to using a hex editor at all!

If I'm unclear at any point in this post, or if i made a mistake, or if anything else - just post here! I'll get it fixed ASAP.
nonessential but mention that you can attach comments to the edits so that you know what each one does (another benefit of using asm patches to hex edit)
You forgot to mention that a $ is necessary for each byte. Which you should also fix in your second example.

--------------------
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
This is easy to understand and all, but I honestly don't see how this is superior to this.
because people who want to learn how to hex edit won't look for a patch making tutorial.

--------------------
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Not sure, that's what I did. I'm pretty sure I'm not the only person to do so.
you definitely are
Stickying due to recent issues people have had
idk what to put here
did some stuff to make it less of an awkward read

also rip tutorials forum
how about the ram map

--------------------
Your layout has been removed.
ROM and RAM are entirely different things. "ROM" is short for "Read-Only Memory", meaning that the processor can only read from it but not write to it whereas "RAM" means "Random Access Memory" i.e. memory you usually (there are exception where you can't write to RAM but these are rare on the SNES) can access anytime and can not only be read but also written.

Now, the problem is, because RAM can written, you can't apply a hex edit to RAM, especially since there is no such file you can patch to. It's actually part of the SNES itself and only it can modify it. Good, we use emulators but we talk about a real SNES.

--------------------
Okay, my layout looks ugly.
Originally posted by MarioFanGamer
ROM and RAM are entirely different things. "ROM" is short for "Read-Only Memory", meaning that the processor can only read from it but not write to it whereas "RAM" means "Random Access Memory" i.e. memory you usually (there are exception where you can't write to RAM but these are rare on the SNES) can access anytime and can not only be read but also written.

Now, the problem is, because RAM can written, you can't apply a hex edit to RAM, especially since there is no such file you can patch to. It's actually part of the SNES itself and only it can modify it. Good, we use emulators but we talk about a real SNES.

i'm talking about asar, which can add ram map?

--------------------
Your layout has been removed.
I still don't get it, theres lots of "how tos" here, but none actually say in which program I can actually make these edits...like, where do I actually input these pieces of code?

org $009E25
db $63 ; How many lives to start with

org $00D0D8
NOP #3 ; disable lives

Making a textfile.asm wont work in asar, in HxD I can't find these adresses and what is all.log for?
Originally posted by banshee
I still don't get it, theres lots of "how tos" here, but none actually say in which program I can actually make these edits...like, where do I actually input these pieces of code?

org $009E25
db $63 ; How many lives to start with

org $00D0D8
NOP #3 ; disable lives

Making a textfile.asm wont work in asar, in HxD I can't find these adresses and what is all.log for?

It's best if you don't use HxD at all. Save that code as a .asm file and just insert it with asar: open asar, drag and drop the file and the ROM and press enter. all.log is the SMW dissasembly, somewhat docummented. That means all of the Super MarioWorld code is here. Is very useful for programmers who want to edit certain parts of the code or create patches.
Originally posted by Darolac
Originally posted by banshee
I still don't get it, theres lots of "how tos" here, but none actually say in which program I can actually make these edits...like, where do I actually input these pieces of code?

org $009E25
db $63 ; How many lives to start with

org $00D0D8
NOP #3 ; disable lives

Making a textfile.asm wont work in asar, in HxD I can't find these adresses and what is all.log for?

It's best if you don't use HxD at all. Save that code as a .asm file and just insert it with asar: open asar, drag and drop the file and the ROM and press enter. all.log is the SMW dissasembly, somewhat docummented. That means all of the Super MarioWorld code is here. Is very useful for programmers who want to edit certain parts of the code or create patches.


Oh my god, thank you. The drag and drop gives it the whole path, I only typed the file name, assuming Asar will automatically searh in the same folder.

Thank you, this forum deserves its good reputation.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - Tutorials - How to make a hex edit using asar

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented