Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-07-07 06:45:41

Danny-E 33
Administrator
Registered: 2012-06-09
Post 43/1,045

Pokemon Red: GHOST text string no where in rom

So as always, it's totally likely that I'm misunderstanding or over looking something. But if I understand this correctly, the game somehow loads the text "GHOST" without the hex values for each letter actually being in the ROM. In my hack, I've replaced all the CAPS words with lower case words. And in a hex editor, everytime the word "GHOST" shows up, I've changed it to "Ghost". The word "GHOST" appears many times. It is a Pokemon type. It is said by poeple many times refering to Pokemon Tower. And it also shows up in battle in the Pokemon Tower when you do not have the Silph Scope in you bag. Using Hex Workshop's search function, I searched for the string "86 87 8E 92 93" which are the hex values for GHOST and nothing shows up anymore. Every instance it appears has been changed to "86 A7 AE B2 B3" (Ghost). And when I play the game, every person that says it now says "Ghost" and all ghost Pokemon's type says "Ghost" but when I go to the Pokemon tower and have a wild encounter with a ghost and I do not have the Silph Scope, the text that appears at the beginnig of the battle looks like this: (pay close attention to what is caps and what isn't)
"GHOST appeared!"
"Darn! The Ghost can't be ID'd!"
At this point, the enemy health bar and level stuff says "GHOST"
"Ghost: Get out... Get out..."

Does anyone have a guess as to why the game displays "GHOST" when there is surely no text string for it all caps anymore?
This is only a minor imperfection, but it is still really bothering me...

~Danny-E 33


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#2 2012-07-07 07:28:15

Miksy91
Member
Registered: 2010-10-16
Post 950/2,317

Re: Pokemon Red: GHOST text string no where in rom

You might assume "GHOST appeared!" would be written like this in rom:
00 86 87 8E 92 93 [appeared!] 57 but instead, it's probably looked through in text-code 01 (this code was code 00 because it starts with 00).

01 = Write text from ram. Structure: [01][Ram address (2byte)]

For valid ram addresses see [url=http://hax.iimarck.us/files/scriptingcodes_eng.htm#Begriff]Glossary[/url]. 
This enables use of variable text strings.

Basically, you could find GHOST this way:

01 [RAM address] 50 [appeared!] 57

Here are rest of the in-text codes in GSC and they should be (mostly) the same in RBY: http://hax.iimarck.us/files/scriptingco … htm#InText

Notice that this was of course only the first step in changing that text string because you yet need to find out how it's loaded in RAM. If it doesn't work like this though, I've to say I've no idea what you should try.

P.S
If you're wondering, text code 01 is for example used for displaying the names of your pokemon and your enemy during battle, moves used etc.

Last edited by Miksy91 (2012-07-07 07:33:13)

Offline

#3 2012-07-07 08:20:57

Danny-E 33
Administrator
Registered: 2012-06-09
Post 45/1,045

Re: Pokemon Red: GHOST text string no where in rom

Hmm... That makes a lot of sense, but all those one-byte codes that end up displaying names of Pokemon, attacks, etc. are real words in the rom that are spelled out , it's just that They're not spelled out every single time. And if you edit the one time you see them in the table of names, it edits how that name is displayed every single time. So I would think I should still be able to find it.. Unless that's not exactly what you're saying..


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#4 2012-07-07 09:30:16

Sawakita
Administrator
Registered: 2010-10-16
Post 279/364

Re: Pokemon Red: GHOST text string no where in rom

That particular instance of "GHOST" is hardcoded.

; 0x3EFAE
ROMF:6fae 21 da cf         ld   hl,cfda ; address from which the text engine will load the word "GHOST"
ROMF:6fb1 3e 86            ld   a,86    ; 'G'
ROMF:6fb3 22               ldi  (hl),a
ROMF:6fb4 3e 87            ld   a,87    ; 'H'
ROMF:6fb6 22               ldi  (hl),a
ROMF:6fb7 3e 8e            ld   a,8e    ; 'O'
ROMF:6fb9 22               ldi  (hl),a
ROMF:6fba 3e 92            ld   a,92    ; 'S'
ROMF:6fbc 22               ldi  (hl),a
ROMF:6fbd 3e 93            ld   a,93    ; 'T'
ROMF:6fbf 22               ldi  (hl),a
ROMF:6fc0 36 50            ld   (hl),50    ; string terminating char

Note: The text string to be formatted is at 0x89C4F:

01 DA CF    print 50-terminated text from address 0xCFDA
00 ...      print normal text (" appeared!")

Last edited by Sawakita (2012-07-07 09:32:25)

Offline

#5 2012-07-07 09:46:13

Danny-E 33
Administrator
Registered: 2012-06-09
Post 46/1,045

Re: Pokemon Red: GHOST text string no where in rom

Gosh, you are just too smart... Thanks alot for pointing this out for me! :D
Are there any other cases you know of where words are coded in a way that they are not directly readable in a hex editor? This is very interesting. Perhaps there are even more all caps words left in the game to find.. But this is the only one I've noticed so far.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#6 2012-07-07 13:45:23

479/701

Re: Pokemon Red: GHOST text string no where in rom

Danny-E 33 wrote:

Are there any other cases you know of where words are coded in a way that they are not directly readable in a hex editor? This is very interesting. Perhaps there are even more all caps words left in the game to find.. But this is the only one I've noticed so far.

Some of the statuses, like “SLP” or “PAR,” are written to the screen that way at some point (possibly in battle, I forget).

GSC also has a “Now on debug…” message that is written one character at a time instead of going through the string print routine.

There may be others, of course.

Board footer

Powered by FluxBB