PDA

View Full Version : Research: diegoisawesome's Miscellaneous Finds


diegoisawesome
December 19th, 2010, 12:30 PM
As a ROM hacker, I've had to go and "customize" my ROM quite often to get it to do what I want. As a result, I've found many useful tidbits of information, and I've decided to compile them all into one useful thread. Some of these come from other people; if I forgot to credit you, please tell me!

Tile Molester Alternate "Fix"
Yeah, we've all come across this one. Tile Molester Alternate, the edited version of Tile Molester that can open Windows Palettes, cannot open a ROM more than once.

The reason is because when Tile Molester opens a ROM, it saves some settings, such as saved palettes, to an external file. This external file uses a Document Type Definition file called tmres.dtd. It saves properly; however, upon opening it, it needs the file and cannot find it in the folder, so it simply doesn't open the ROM right. This is simply because the Tile Molester hacker forgot to include that file in the download.

To fix this, open a Tile Molester download (non-Alternate), navigate to the 'resources' folder, and copy and paste the tmres.dtd from that folder into your Tile Molester Alternate's 'resources' folder.
Ta-da! Fixed.

Font Editing in FR/LG/E
The reason that practically no FireRed/LeafGreen/Emerald hack has custom font is because practically nobody has found it. When you do have it, it's simple enough to edit:

Fire RedOpen your preferred version of Tile Molester and navigate to 0x1F3100. It doesn't look like anything, am I right? Well, go to View>Codec and select 2BPP Linear, reverse-order. There's one copy of your font... but mirrored. At the moment, you'll just have to flip it when you edit it, I can't find another way to do so. :( Each color font uses a different copy of the font image... Strange, huh? The other images are at 0x1FF300 for black, 0x20F618 for blue, and 0x21F930 for red.

They also have separate font width tables. These are what determine how wide each letter in pixels is. The tables are at 0x1FB100 for other, 0x207300 for black, 0x217618 for blue, and 0x227930 for red.

EmeraldEditing the font for Emerald is much easier because it only has one font image and one font width table. The image is at 0x6440E4 and the table is at 0x64C0E4.

Disabling the Gender-chosen Flight Positions for Littleroot Town (Emerald)
This one is easy. There's a check in the flying routine that checks if you're flying to Littleroot. If yes, it then goes to check your gender and assigns the appropriate flight spot. To disable the check for Littleroot Town and make it act like a normal flight place, open Emerald in a hex editor, go to 0x124E62, and replace "00 28 0E D0" with "00 00 00 00".

Hacking the "Wally Catches a Pokémon" Event (Emerald)
There are four specials in that event you should be aware of: special 0x28, special 0x12F, special 0xA0, and special 0x29. special 0x28 saves your first Pokémon into memory for retrieval later, special 0x12F overwrites your first Pokémon with a specified Pokémon, special 0xA0 is the actual battle, and special 0x29 overwrites your first Pokémon with the one saved in memory. Used in that order, and without any modifications to their ASM, you'll have a generic Wally catching tutorial.
To hack it, it depends on what you want to change.

Hacking the Pokémon
Get the hex ID of your Pokémon.
If the number is 0x100 or over, then instead of overwriting the first two bytes with your Pokémon's ID, replace them with "FF 21". Then, subtract 0xFF from your Pokémon ID and follow the next instructions.

Given PokémonIn a hex editor, navigate to 0x139472. Replace the byte there with your Pokémon ID, unless it's over 0x100, in which case you would put 0xFF there instead. Then skip over the next byte (should be 21) and replace the bytes there with "XX 31", where XX is 00 (unless your Pokémon's ID is over 100, in which case subtract 0xFF from it and put it there).
Battling PokémonDo the same as above, except with 0xB0870 for your address.

Hacking the Pokémon's Levels
Get the hex value for what you want the levels to be. Levels cannot exceed 255 (0xFF).

Given PokémonIn a hex editor, navigate to 0x139482. Replace the byte there with the hex version of what you want your Pokémon's level to be.
Battling PokémonDo the same as above, except with 0xB0874 for your address.
Hacking the Starting Position (FireRed)
0x54A04 is the starting map. 0x54A06 is the starting map's bank.
0x54A08 is the starting X position. 0x54A00 is the starting Y position.
Have fun.
Changing the Time FireRed Stays on the Title Screen
This one was discovered by colcolstyles; kudos to him!

The 32-bit value at 0x78C1C controls how many frames the game goes through before it resets itself. There are 59.737 frames in one second. Determine how long you want the title screen to stay before resetting using that formula. (Thanks to knizz for telling me!)

Removing the Flashback System
I'm sure many of you have had weird things happen with the flashback system in FireRed. For instance, with JPAN's overworld system hack, you would get the original sprite; another example would be when it would say strange things when you left a gym. Well, I have found a way to make it act as if you never did any flashback-worthy events.

To patch, navigate to address 0x110F54 and replace "00 28 0F D0" with "00 1C 0F E0". All this does is disable the check for flashback-worthy events, and simply loads the save like R/S/E.

"Porting" the Normal Bicycle from FRLG to Emerald
To make the Mach Bike have the Acro Bike's speed but not its special moves (essentially turning it into FRLG's bike), navigate to 0x1191C8 and replace 4C with 68. Simple!
If you want to make the bike have the bike bell sound when getting on, then navigate to 0xFD35E and overwrite the bytes there with "06 20 8E F7 AE FC 00 06 00 28 06 D1 0B 20 A6 F7 1A FA 00 00 00 00 00 00 00 00 02 20". Not as stupidly simple as the first part, but still easy enough to do.

Well, that's what I have. If you have anything to add, just reply and I'll be glad to add it in.
I hope this thread is a handy resource for anyone that needs it.

diegoisawesome
December 20th, 2010, 08:16 AM
To do it the easier way, could as well just make the two flight locations of Littleroot have the same (X,Y) location where the hero lands on.
You could, but this saves you one more position.
Besides, 00 00 00 00 sounds like having a normal flying data for the map.
No, the 00 00 00 00 overwrites the special check for Littleroot. Without this check, it just loads from the flying position tables as normal.
Maybe you could make it so that you'd change the flying data of some other random map which has its own (for example Petalburg) to 00 28 0E D0.
That way, you could define two different flying locations for Petalburg City if you figured out how Littleroot locates its own two flying locations.
That's also a possibility, and it would be relatively easy to make for an ASM hacker if they just check what bytes I'm overwriting and modify them to, not nop, but another location.

But nice founds you've made :)
Thanks.

"In a hex editor, navigate to 0x139482. Replace the byte there with the hex version of what you want your Pokémon's level to be."

Doesn't make much sense, the byte in 0x139482 is originally 23.
If you didn't read, the sections for "Hacking the Pokémon" and "Hacking the Pokémon's Levels" are in the section for modifying Wally's catching tutorial in Emerald.
What's the "given pokemon" about?
It's the Pokémon that the tutorial uses for battling.
Also, doing this sounds like using a Gameshark code that just changes the byte in 0x139482.
It could be, but why would anybody ever want to temporarily change the battling Pokémon's level in Wally's catching tutorial? Makes no sense.
"0x540A04 is the starting map. 0x540A06 is the starting map's bank.
0x54A08 is the starting X position. 0x54a00 is the starting Y position."

"54a00" --> 54A0A ;)
Nope. Even though you might be inclined to think differently, it's in 0x54A00. Strange, I know.
Responses in bold.
miksy91, I think you just misunderstood most of the page, although it may be that I didn't make it clear enough.

miksy91
December 20th, 2010, 11:39 AM
"If you didn't read, the sections for "Hacking the Pokémon" and "Hacking the Pokémon's Levels" are in the section for modifying Wally's catching tutorial in Emerald."

I skipped most of the thread and so didn't notice "Hacking the Pokemon's Levels" was only a subtitle. Besides, I picked up the Gameshark code thing by thinking that byte was supposed to change the pokemon appearing in your team in position 1 or something such as that...

If I cared (or hacked R/S/E for that matter), I would have read it through properly :D

knizz
December 21st, 2010, 07:33 AM
Disabling the Gender-chosen Flight Positions for Littleroot Town
This one is easy. There's a check in the flying routine that checks if you're flying to Littleroot. If yes, it then goes to check your gender and assigns the appropriate flight spot. To disable the check for Littleroot Town and make it act like a normal flight place, open Emerald in a hex editor, go to 0x124E62, and replace "00 28 0E D0" with "00 00 00 00".
I see that there is a branch at this point. But the two ways aren't symmetrical at all. Do you know more about this? (This is for Firered. Right?)

Hacking the Starting Position (FireRed)
0x540A04 is the starting map. 0x540A06 is the starting map's bank.
0x54A08 is the starting X position. 0x54a00 is the starting Y position.
Have fun.
This helped me a lot. (But you have two typos)

Changing the Time FireRed Stays on the Title Screen
This one was discovered by colcolstyles; kudos to him!

The 32-bit value at 0x78C1C controls how many processor tics (?) the game goes through before it resets itself. Just mess around with the value until you get a desirable outcome.


Actually it's measured in frames. 59.737 frames = 1 second.

diegoisawesome
December 21st, 2010, 07:43 AM
Disabling the Gender-chosen Flight Positions for Littleroot Town


This one is easy. There's a check in the flying routine that checks if you're flying to Littleroot. If yes, it then goes to check your gender and assigns the appropriate flight spot. To disable the check for Littleroot Town and make it act like a normal flight place, open Emerald in a hex editor, go to 0x124E62, and replace "00 28 0E D0" with "00 00 00 00".

I see that there is a branch at this point. But the two ways aren't symmetrical at all. Do you know more about this? (This is for Firered. Right?) Wrong. Littleroot Town is in R/S/E, and this is for Emerald. Also, even in Emerald, they're not symmetrical because one loads a value from a table, and the other loads the gender value and forces a byte, skipping the table reading.

Hacking the Starting Position (FireRed)


0x540A04 is the starting map. 0x540A06 is the starting map's bank.
0x54A08 is the starting X position. 0x54a00 is the starting Y position.
Have fun.

This helped me a lot. (But you have two typos) No, I don't. 0x54A04 and 0x54A06 are correct. Just wondering, what made you think that 0x540A04 and 0x540A06 would be right?
Changing the Time FireRed Stays on the Title Screen


This one was discovered by colcolstyles; kudos to him!

The 32-bit value at 0x78C1C controls how many processor tics (?) the game goes through before it resets itself. Just mess around with the value until you get a desirable outcome.

Actually it's measured in frames. 59.737 frames = 1 second. Thanks for that, I'll add it to the thread.
Replies in bold.
A lot of people seem to misunderstand this thread...

knizz
December 21st, 2010, 08:21 AM
0x540A04 is the starting map. 0x540A06 is the starting map's bank.
0x54A08 is the starting X position. 0x54a00 is the starting Y position.
Have fun.

Map and bank have start with 0x540A. X and Y start with 0x54A. One of them must be wrong.

diegoisawesome
December 21st, 2010, 10:01 AM
Map and bank have start with 0x540A. X and Y start with 0x54A. One of them must be wrong.
Whoops, sorry, I thought you were putting in the extra 0...
I'll get right to fixing that, and thanks for pointing it out to me. :S

Gamer2020
December 21st, 2010, 09:08 PM
Hacking the "Wally Catches a Pokémon" Event (Emerald)
There are four specials in that event you should be aware of: special 0x28, special 0x12F, special 0xA0, and special 0x29. special 0x28 saves your (first?) Pokémon into memory for retrieval later, special 0x12F overwrites your first Pokémon with a specified Pokémon, special 0xA0 is the actual battle, and special 0x29 overwrites your (first?) Pokémon with the one(s?) saved in memory. Used in that order, and without any modifications to their ASM, you'll have a generic Wally catching tutorial.
To hack it, it depends on what you want to change.

Hacking the Pokémon
Get the hex ID of your Pokémon.
If the number is 0x100 or over, then instead of overwriting the last two bytes with "00 00", replace them with "FF 31". Then, subtract 0xFF from your Pokémon ID and follow the next instructions.

Given PokémonIn a hex editor, navigate to 0x139472. Replace the byte there with your Pokémon ID. Then skip over the next byte (should be 21) and replace the bytes there with "00 00" unless you're following the above instructions.
Battling PokémonDo the same as above, except with 0xB0870 for your address.

Hacking the Pokémon's Levels
Get the hex value for what you want the levels to be. Levels cannot exceed 255 (0xFF).

Given PokémonIn a hex editor, navigate to 0x139482. Replace the byte there with the hex version of what you want your Pokémon's level to be.
Battling PokémonDo the same as above, except with 0xB0874 for your address.


This was explained better in these posts by other people -_- (But you knew that.)

http://www.pokecommunity.com/showpost.php?p=6107690&postcount=9
http://www.pokecommunity.com/showpost.php?p=6107710&postcount=10

Also...

The reason that practically no FireRed/LeafGreen/Emerald hack has custom font is because nobody (but me) has found it.

You are not the only person to have found it.

diegoisawesome
December 22nd, 2010, 06:54 AM
This was explained better in these posts by other people -_- (But you knew that.)

http://www.pokecommunity.com/showpost.php?p=6107690&postcount=9
http://www.pokecommunity.com/showpost.php?p=6107710&postcount=10
Yeah, I knew that, but I couldn't find those posts when I went looking for them, so I tried explaining it the best way I could think of. I'll fix what I have above.

Also...

You are not the only person to have found it.
I admit, I just assumed that nobody else has found the font addresses because I don't see any FR/LG/E hacks that have custom font, unless they're made by me or are using my patch. In fact, it would be cool if you could point me to a FR/LG/E hack with different font, besides those stated above.
Responses in bold.
I'll get right on fixing up the post.

Gamer2020
December 22nd, 2010, 10:25 AM
Responses in bold.
I'll get right on fixing up the post.
I didn't say I know of a publicly released hack that has custom font. I said that you are just not the first to do it.

diegoisawesome
December 22nd, 2010, 10:33 AM
I didn't say I know of a publicly released hack that has custom font. I said that you are just not the first to do it.
Oh. That's fine then.
Regardless, there hasn't been any public knowledge of how to do it until now.

Hi-Techneon
December 22nd, 2010, 11:44 AM
Hacking the "Wally Catches a Pokémon" Event (Emerald)
There are four specials in that event you should be aware of: special 0x28, special 0x12F, special 0xA0, and special 0x29. special 0x28 saves your (first?) Pokémon into memory for retrieval later, special 0x12F overwrites your first Pokémon with a specified Pokémon, special 0xA0 is the actual battle, and special 0x29 overwrites your (first?) Pokémon with the one(s?) saved in memory. Used in that order, and without any modifications to their ASM, you'll have a generic Wally catching tutorial.
To hack it, it depends on what you want to change.

I can tell you that special 0x28 only saves the first Pokémon and special 0x28 overwrites your first Pokémon back. For example if you remove special 0x29, and you had a Torchic and a Voltorb, you would have a Zigzagoon and a Voltorb after the tutorial.

diegoisawesome
December 22nd, 2010, 11:51 AM
I can tell you that special 0x28 only saves the first Pokémon and special 0x28 overwrites your first Pokémon back. For example if you remove special 0x29, and you had a Torchic and a Voltorb, you would have a Zigzagoon and a Voltorb after the tutorial.
Awesome, thanks.
I was 99% sure that it was like that, but thanks for clearing it up for me.

TheDarkShark
August 24th, 2011, 03:57 AM
*getting rid of dust on the thread*
I've been having problems with the font width header and aked Diego for help via VM. Just in case anyone else needs help with that, too:
Each entry in the Font width header is one byte long, giving the width of each letter in px. The order of the letters is similar to the ROM-internal character set, which can be found e.g. in table files used by the Thingy texteditor. That is (the most important ones only) :
00=[SPACE]
A1=0
A2=1
A3=2
A4=3
A5=4
A6=5
A7=6
A8=7
A9=8
AA=9
AB=!
AC=?
AD=.
AF=…
AE=-
B1=é
B8=,
B9=+
BA=/
BB=A
BC=B
BD=C
BE=D
BF=E
C0=F
C1=G
C2=H
C3=I
C4=J
C5=K
C6=L
C7=M
C8=N
C9=O
CA=P
CB=Q
CC=R
CD=S
CE=T
CF=U
D0=V
D1=W
D2=X
D3=Y
D4=Z
D5=a
D6=b
D7=c
D8=d
D9=e
DA=f
DB=g
DC=h
DD=i
DE=j
DF=k
E0=l
E1=m
E2=n
E3=o
E4=p
E5=q
E6=r
E7=s
E8=t
E9=u
EA=v
EB=w
EC=x
ED=y
EE=z
7F=#
FE=¶All numbers in Hex (obviously -.- ), just add them to the header's start offset.

Oh, and by the way: any updates, Diego?

diegoisawesome
August 9th, 2014, 10:49 PM
Good news everyone! I've just added a new section to the thread, the first update in years! It's in regards to changing the Acro Bike to be like the standard FRLG bicycle with a few simple tweaks.

Epsilon
July 4th, 2015, 12:04 PM
Thanks for the font offsets! On that note, some parts of the game (like battling) use a tinier font. I found it at 001EA900 in Tile Molester, same settings.