 |
|
 |
|
Views: 235,893,246 Time: 2013-05-19 01:24:37 PM | 21 users online: 1UPdudes, 678ruby678, Alcaro, Dark Mario Bros, DragezeeY, FlamingRok, Ginyu AL, Incognito, Jeuda Cruxifis, LaughingLuigi, Mai, Masterlink, Medic, Natedog720, Phazon, Pixels, Rockythetigre, ShadowPhoenix, Silver Scarlet, Thomas, Vitor Vilela - Guests: 38 - Bots: 13 | Users: 22,843 (1,292 active) Latest: IJayZz |
|
|
 |
|
 |
|
| Tip: The multiple midpoints patch can also be used to move a level's normal midpoint. |
|
|
|
 |
|
 |
|
 |
|
 |
|
| Making Hex Edits in a Patch |
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - Making Hex Edits in a Patch |
|
Pages: 1  |
|
|
|
| Posted on 2009-12-27 04:32:28 PM |
Link | Quote |
|
Hello, I made a very nifty little tutorial about making hex edits in patch format. You may be wondering why a patch when I can do it in a hex editor. Well say you add another patch and it corrupts your rom and you've added about 20 hex edits, not only would you have to make all the hex edits again-- you'd have to remember exactly which ones you made. If you had made them as a patch you only need to patch it once to restorm all of them, plus you can make comments documenting what's what.
Here's the patch
And here's the content of the patch:
(Note: I made this for someone else but it should be good for you)
Quoteheader ; This indicates the rom has a header
lorom ;...and is lo-rom format
; Don't change this or the patch won't work
; Also incase you didn't know, adding a semicolon (;)
; will make everything after that on the line not
; exists as part of the code. It's just how you write
; comments.
; Okay here is where the hex edits start.
; Take a look at SMWC rom map for hex edits. Here's what you want
; 27954 $04:F754 1 byte Misc. change to 80 to disable lightning in Bowser's Valley
; In a normal hex edit you would want to go to adress x27954 and change that
; but this time we're going to take $04:F754 and change that.
; First remove the colon (:) and add org before ite like to
org $04F754
; Note that that's actually part of the code now.
; Second you'll want to add the input that you'll want to change but
; you need to add db first. Like this
db $80
; Now that you've disable lightning, why not disable sound of it too?
; Here's the line after we control+F for it in the rom map.
; 1E216 $03:E016 5 bytes ASM Lightning sound FX for Bowser battle.
; Change to EA EA EA EA EA to disable noise.
; Oh noes there are more than one input that we need to change~!
; Easy, do everything the same except add a coma (,) with no spaces
; between each input value. So it'll looks like this~~
org $03E016
db $EA,$EA,$EA,$EA,$EA
; And there you go. So concludes how to add hex edits. But we're not finished yet.
; Feel free to add more between here and the long line.
;-----------------------------------------------------------------------------------
!Freespace = $138000 ; This is the Freespace, or where we're going to put the code.
; This is usually only used when making a real patch but I'll include it anyway.
; Obviously, you'll want to change that to a free adress.
org !Freespace ; So now we go to that adress.
!CodeSize = Ending-Routine ; This is where we put the bew code.
db "STAR" ; I'm not too sure aobut this.
dw !CodeSize-$01 ; How big the code can be.
dw !CodeSize-$01^$FFFF ; All of this is known as the RATS tag.
; Which is used to perserve the code.
Routine: ; This is where the code starts
RTL ; But since where not doing anything, just return.
Ending: ; Here is where the tag ends. Anything after this will not be perserved.
; And that's our code. You can add more hex edits right before the long line.
|
| Last edited on 2009-12-28 11:18:12 AM by Roy. |
|
| Posted on 2009-12-27 04:52:35 PM |
Link | Quote |
|
|
Hmm, could be quite useful, I'll try it tommorrow.
|
|
| Posted on 2009-12-27 05:42:08 PM |
Link | Quote |
|
Originally posted by "Quote"; First remove the colon (  and add org before ite like to Err1: Smiley alert
May I suggest adding spaces between the colon --> ( : )
or use : instead of the colon --> (:)
to fix it?
Err2: Spelling
Did you mean to write "it like so" instead of "ite like to"?
</teacher>
E: right right, where are my manners: good job with the tutorial!
|
| Last edited on 2009-12-27 05:42:42 PM by Yakov. |
|
| Posted on 2009-12-27 07:54:37 PM |
Link | Quote |
|
Or place bold tags in the smily. :P
In any case, it looks like a good tutorial, but I must ask why you're inserting a RATS protected RTL in the ROM.
|
|
| Posted on 2009-12-28 04:33:30 AM |
Link | Quote |
|
Originally posted by Ixtaborg !Freespace ; So now we go to that adress.
!CodeSize = Ending-Routine ; This is where we put the bew code.
db "STAR" ; I'm not too sure aobut this.
dw !CodeSize-$01 ; How big the code can be.
dw !CodeSize-$01^$FFFF ; All of this is known as the RATS tag.
; Which is used to perserve the code.
Routine: ; This is where the code starts
RTL ; But since where not doing anything, just return.
Ending: ; Here is where the tag ends. Anything after this will not be perserved.
...now what is the point of that? If the routine only consists of an RTL, why would you ever need to call it?
|
|
| Posted on 2009-12-29 11:11:55 PM |
Link | Quote |
|
It's just for teaching purposes, it's more of a template than anything.
I agree, this could definitely help some noobs understand how patches really work as apposed to "HURF DUFR THIS PATCH DOES IT I DONT KNOW HOW". Yes, I've seen that before.
|
|
| Posted on 2010-07-14 12:08:32 AM |
Link | Quote |
|
This helped me understand quite a bit, thought I have a few things I don't understand that could be helpful:
Would you be able to explain the difference between db and dw?
And what is NOP?
|
|
| Posted on 2010-07-14 04:03:23 AM |
Link | Quote |
|
NOP is a command that does virtually nothing (except for wasting time and space, but it does nothing to the way the code works) It's often used to overwrite unwanted code.
db (direct byte) inserts a byte directly into the ROM. db $01, for example, would place the byte 01 in that spot. dw (direct word) places to bytes at once, in reverse order (also known as little endian format). dw $1234 would place the bytes 34 12 in the ROM, dw $DEAF would result in AF DE etc.
You can also use that in combination with labels. For example, if you use dw Test, and the label "Test" is located at address $xx:8039, you'd get 39 80.
|
|
|
Pages: 1  |
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - Making Hex Edits in a Patch |
|
|
 |
|
 |
The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.
Copyright © 2005 - 2013 - SMW Central Legal Information - Link To UsTotal queries: 28
|
|
|
|