+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Changing where Game Pulls Text
Pages: [1]
Author Topic: Changing where Game Pulls Text  (Read 1 times)
Jedi QuestMaster
Guest
« on: November 10, 2010, 01:43:45 am »

Okay, here's the thing:

My translation of text required 2 more characters than its Japanese counterpart, borrowing from another line of text.

However, the game still pulls the the next set of characters from the same address, resulting in pulling the end of my text "e" from "erase" as well as ending the string from the last set:


How do I change where it pulls text? Undecided\
Ryusui
Guest
« Reply #1 on: November 10, 2010, 01:51:49 am »

Find the pointers and change them. It's basic romhacking knowledge.

Ideally, you'll use a program like Atlas to automate the process. Dump the script using a tool like romjuice or cartographer and format it so that Atlas will update the pointers as it comes to each new line.
KingMike
Guest
« Reply #2 on: November 10, 2010, 10:25:10 am »

Set breakpoints in FCEUX. Debug -> Debugger -> Add breakpoint
You know the CPU address (the pointer value) for the original text it's trying to read? Set the address and click Read.
Now when the game tries to read the pointer, the debugger window will appear with the instruction that's trying to read it.
It's probably a LDA ($nn),Y instruction.
That instruction means to read the pointer at RAM address $00nn, add the Y register to it and read from the resulting address.
So, clear out that breakpoint and add a new one for address $00nn+1. Now reload the menu.
(it's possible the game is updating $00nn (the low byte of the pointer) after each character is written. So, by checking when the high byte is written, you'll get less false positive results.)
Less likely is a $nnnn,x or $nnnn,y instruction. In that case the pointer is in the instruction. It'll tell you the address of the instruction, so then you can just look for it in the ROM and change it.
Jedi QuestMaster
Guest
« Reply #3 on: November 10, 2010, 09:33:25 pm »

I plugged in address & here's what I have:

Code:
$EA45:A9 00     LDA #$00
$EA47:85 18     STA $0018 = #$00
$EA49:85 19     STA $0019 = #$00
$EA4B:A4 18     LDY $0018 = #$00
$EA4D:B1 0F     LDA ($0F),Y @ $A52D = #$9E

I changed $EA46 to '02' & ended with this:



It did what I wanted, but it had side effects.
Am I doing it right?  Undecided\
Kagemusha
Guest
« Reply #4 on: November 10, 2010, 10:01:32 pm »

That's not a pointer you edited. I would advise reading up on some pointer and pointer table docs. Except in special cases they're really not that complicated.
KingMike
Guest
« Reply #5 on: November 10, 2010, 10:31:30 pm »

Quote from: Jedi QuestMaster on November 10, 2010, 09:33:25 pm
I plugged in address & here's what I have:

Code:
$EA45:A9 00     LDA #$00
$EA47:85 18     STA $0018 = #$00
$EA49:85 19     STA $0019 = #$00
$EA4B:A4 18     LDY $0018 = #$00
$EA4D:B1 0F     LDA ($0F),Y @ $A52D = #$9E

I changed $EA46 to '02' & ended with this:



It did what I wanted, but it had side effects.
Am I doing it right?  Undecided\

Okay, so now you can tell from the last statement the pointer is written to $000F-0010 (because of the 0F in the instruction). Now you want to set a write breakpoint on $0010 (to find where the game writes 2D to $0F, and A5 to $10, to form the pointer $A52D).
Jedi QuestMaster
Guest
« Reply #6 on: November 10, 2010, 10:38:52 pm »

Quote from: KingMike on November 10, 2010, 10:31:30 pm
Now you want to set a write breakpoint on $0010 (to find where the game writes 2D to $0F, and A5 to $10, to form the pointer $A52D).
Okay, now that sounds familiar again. Cheesy

Anyway, I read Mad Hacker's doc on pointers, which blew the carp out of me - I've never worked with pointers before.

So all is well:



And again I feel like a total newbie not knowing this stuff. Undecided\ It'll probably happen again! Shocked
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC