Page 29 of 93

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 12:20 am
by Blaziken257
What were you doing wrong?

Anyways, new patch! Now we're up to v19.

http://www.mediafire.com/download.php?m0gemyzdjyx

Virtually all of Toronko Village is done! Except for that person standing in the corner north of the shop.

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 4:03 am
by IIMarckus(imported)
If you are worried about space, you might implement some DTE with the 0xE5 text code and the ~150 bytes of free space in bank 0. This can reduce the length of a commonly‐used string to three bytes in running text. Pokémon games often use this to reduce POKé from four bytes to one.

By the way, I’ve just tried out the patch for the first time, and am very impressed!

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 5:47 am
by andwhyisit
IIMarckus wrote: If you are worried about space, you might implement some DTE with the 0xE5 text code and the ~150 bytes of free space in bank 0. This can reduce the length of a commonly‐used string to three bytes in running text. Pokémon games often use this to reduce POKé from four bytes to one.

By the way, I’ve just tried out the patch for the first time, and am very impressed!
I understand what you are saying. But is that possible without ASM hacking? All of the 0xE5 codes used non-static variables (variables that can change during gameplay) stored in ram. There are no static variables (variables that always stay the same and are loaded into ram only when needed) referenced by 0xE5 codes.

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 11:57 am
by andwhyisit
Sorry for the double post but I have found the pointer.

It is a single byte pointer that points at the bank where the names begin at. It is currently located at $000549 and points to bank 75h (the names are at the start of that bank).

This of course means that all of the information from that bank all have to stay in the same bank as each other (changing the pointer affects everything within that bank). A good solution for saving space for 12-char denjuu names would be to find out how to reduce the arrive text limit to 12 characters. I'll look into that next.

EDIT: Oh, and apparently setting $000775 to 0C disables all button input for the game. I would test this further but I can't seem to get past the title screen. :lol:

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 4:29 pm
by Blaziken257
What is an 0xE5 code? That's the first time I've ever heard of that. Is it some code that takes place at ROM address 0xE5, or is it some custom code with character value 0xE5? And is this unique to Telefang?

And that part about $000775 is interesting, I should check that out soon. You can also test that further if you load a save state!

And that pointer table is interesting, I would have never found that. The entire pointer is, in fact, from $000549-$00054B, which means it points at 75 D7 CD = ($4000 * $75) + ($CDD7 - $C000) = $1D4000 + $0DD7 = $1D4DD7. Those don't look like Denjuu names to me...

And thanks! I'm glad you like the patch! By the way, if you can figure out how to decompress the Japanese tiles right after the title screen, that would be great.

Re: (Incomplete) Telefang English Translation

Posted: Mon Mar 23, 2009 4:47 pm
by Sanqui
$000775 -> 0C doesn't disable all button input, but it makes all buttons weird... I dunno how to explain it, but by pressing left, you press right and select, for example D:

Yeah, you can change where the name pointer points too, but that doesn't make the string any longer ):

Re: (Incomplete) Telefang English Translation

Posted: Tue Mar 24, 2009 12:15 am
by andwhyisit
Blaziken257 wrote:What is an 0xE5 code? That's the first time I've ever heard of that. Is it some code that takes place at ROM address 0xE5, or is it some custom code with character value 0xE5? And is this unique to Telefang?
It is the 3 character code used to represent Denjuu names, etc. within dialogue. It is called the 0xE5 code because it typically starts with the value E5. You have come across it many times by now.
Blaziken257 wrote:And that part about $000775 is interesting, I should check that out soon. You can also test that further if you load a save state!
What I said about testing it was only meant as a joke, but I'll test this it you need me to.
Blaziken257 wrote:And that pointer table is interesting, I would have never found that. The entire pointer is, in fact, from $000549-$00054B, which means it points at 75 D7 CD = ($4000 * $75) + ($CDD7 - $C000) = $1D4000 + $0DD7 = $1D4DD7. Those don't look like Denjuu names to me...
There is no second or third byte by the looks, it seems to be only one byte. The game reads 75h and jumps directly to the start of that bank. There is no need to specify an offset within that bank. I know this isn't in any pointer hacking tutorial, but that is because they are most likely the equivalent of a needle in a haystack. Change the bank pointer to 76 and everything referenced from bank 75 (denjuu names, attacks, arrive text, etc.) are now obtained from bank 76. I could test this further by inserting a dummy name into the start of bank 77 and switching to that bank, but that appears to be the case.
Blaziken257 wrote:And thanks! I'm glad you like the patch! By the way, if you can figure out how to decompress the Japanese tiles right after the title screen, that would be great.
Uhh...

Wait. What to you mean by "right after the title screen"?
Sanky wrote:$000775 -> 0C doesn't disable all button input, but it makes all buttons weird... I dunno how to explain it, but by pressing left, you press right and select, for example D:

Yeah, you can change where the name pointer points too, but that doesn't make the string any longer ):
I sense the need to experiment.

Re: (Incomplete) Telefang English Translation

Posted: Tue Mar 24, 2009 2:46 am
by IIMarckus(imported)
andwhyisit wrote:
IIMarckus wrote: If you are worried about space, you might implement some DTE with the 0xE5 text code and the ~150 bytes of free space in bank 0. This can reduce the length of a commonly‐used string to three bytes in running text. Pokémon games often use this to reduce POKé from four bytes to one.

By the way, I’ve just tried out the patch for the first time, and am very impressed!
I understand what you are saying. But is that possible without ASM hacking? All of the 0xE5 codes used non-static variables (variables that can change during gameplay) stored in ram. There are no static variables (variables that always stay the same and are loaded into ram only when needed) referenced by 0xE5 codes.
The key phrase here is “stored in RAM.” The 0xE5 code is followed by a two‐byte RAM address and prints out the text at that RAM address. Open the memory viewer to $C92C, and you’ll see the player’s name stored there—this is why the bytes E5 2C C9 print out the player’s name.

Since ROM bank 0 is always addressable in RAM from $0000–3FFF, this means that we can take advantage of it for DTE.
andwhyisit wrote:EDIT: Oh, and apparently setting $000775 to 0C disables all button input for the game. I would test this further but I can't seem to get past the title screen. :lol:
This is part of an ASM string that writes to the joypad register… I would say it’s nothing particularly interesting, but feel free to experiment with it if you want. Here is a similar thread about Pokémon Blue doing the same thing.
Blaziken257 wrote:What is an 0xE5 code? … And is this unique to Telefang?
Yes, this is unique to Telefang. Again, to explain it: The 0xE5 code is followed by a two‐byte RAM address and prints out the text at that RAM address.
Blaziken257 wrote:And that pointer table is interesting, I would have never found that. The entire pointer is, in fact, from $000549-$00054B, which means it points at 75 D7 CD = ($4000 * $75) + ($CDD7 - $C000) = $1D4000 + $0DD7 = $1D4DD7. Those don't look like Denjuu names to me...
That is not a three‐byte pointer, but an ASM string.

Code: Select all

3E XX     : ld a, $XX; loads $XX into the a register
D7        : rst $10   ; looks like this switches to whatever bank is in a
CD ZZ YY  : call $YYZZ; calls the ASM function at YYZZ (XX:YYZZ if between 0x4000 and 7FFF)
DF        : rst $18   ; this interrupt most likely returns from a bankswitch
C9        : ret       ; end of ASM string
In other words, this switches to the bank after 3E and calls the ASM function located at the bytes following CD. 0x540 and 0x550 both do this in bank 0x75, but different locations: the former calls $3A01 and the latter $3A1D.

$3A01 is definitely the name‐loading function, but I am not sure about $3A1D. If you feel like messing with some assembly, these functions are located at that location in both ROM and RAM (bank 00 is always in memory, remember).

Re: (Incomplete) Telefang English Translation

Posted: Tue Mar 24, 2009 3:47 am
by andwhyisit
IIMarckus wrote: The key phrase here is “stored in RAM.” The 0xE5 code is followed by a two‐byte RAM address and prints out the text at that RAM address. Open the memory viewer to $C92C, and you’ll see the player’s name stored there—this is why the bytes E5 2C C9 print out the player’s name.

Since ROM bank 0 is always addressable in RAM from $0000–3FFF, this means that we can take advantage of it for DTE.

This is part of an ASM string that writes to the joypad register… I would say it’s nothing particularly interesting, but feel free to experiment with it if you want. Here is a similar thread about Pokémon Blue doing the same thing.

Yes, this is unique to Telefang. Again, to explain it: The 0xE5 code is followed by a two‐byte RAM address and prints out the text at that RAM address.

That is not a three‐byte pointer, but an ASM string.

Code: Select all

3E XX     : ld a, $XX; loads $XX into the a register
D7        : rst $10; looks like this switches to whatever bank is in a
CD ZZ YY  : call $YYZZ; calls the ASM function at YYZZ (XX:YYZZ if between 0x4000 and 7FFF)
DF        : rst $18; this interrupt most likely returns from a bankswitch
C9        : ret   ; end of ASM string
In other words, this switches to the bank after 3E and calls the ASM function located at the bytes following CD. 0x540 and 0x550 both do this in bank 0x75, but different locations: the former calls $3A01 and the latter $3A1D.

$3A01 is definitely the name‐loading function, but I am not sure about $3A1D. If you feel like messing with some assembly, these functions are located at that location in both ROM and RAM (bank 00 is always in memory, remember).
Something tells me that you missed my earlier post. *shrug*

In regards to the 0xE5 code:
That would be quite useful to add common words to bank 0 to be accessed by the 0xE5 code. Though I'll check it out in RAM how they end the words (no, I don't mean the computing term "word") first.

In regards to the joypad ASM:
It was a joke. I found it by accident and made a joke about it. Everyone here lacks a sense of humour by the looks.

In regards to the asm string not being a three‐byte pointer:
I already mentioned that it wasn't a three‐byte pointer.

In regards to asm string:
I noticed the one at 0x550, and knew it was related, but editing it didn't seem to affect anything.

In regards to asm functions:
I'll have a look at those ASM functions later.

In regards to bank0 always being in memory:
Wow. That explains everything.

I am not going to get much sleep tonight am I?

Re: (Incomplete) Telefang English Translation

Posted: Tue Mar 24, 2009 4:45 am
by Blaziken257
Oh, right. Silly me. I didn't look carefully and didn't see that $00054B wasn't between 40-7F. I noticed that there was a pattern for every three bytes, so you can probably see where I'm coming from when I thought that was a pointer.

And THAT'S what you meant by the E5 code. Yeah, I know what you're talking about now. I never knew that the two bytes after it had to do with RAM address until now, though. Awesome! I also noticed that when looking at the memory editor, different strings can use the same memory address. Weird. One thing though, how can you make it display anything you want?

Finally, I'm not familiar with assembly code, so I can't really help out there. Oh well.