Hacking Phantom Kingdom Portable: English Translation

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I finally found where the white border text is located... The bad news is that it is in a anm0100.dat and bg01.IMY. I can obvious convert the bg001.IMY file and see the background. The white text is in a the anm0100.dat and it has a header with two IMY files in it. For some reason the code that was written for me cannot open the IMY files so I cannot edit them.

Anyone have any ideas?
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
I doubt it. We had to reverse engineer IMY and write all the IMY format code just to view the images and to convert IMY to PNG and PNG to IMY
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I am having a real hard time finding some random text in the game. It seems to be nowhere. The one that is driving me crazy is the one in the battle after you invite.

2dcbdas.jpg

I have looked everywhere for the text and I cannot find it. The Cancel and Status are in the eboot but I cannot find the other text in there. I have tried just about every type of encoding and no luck. I have also done a RAM dump in PPSSPP and I cannot find the text in memory either. It is really weird.

Anyone have any ideas or suggestions for finding it?

-ChepChep
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I have another release. Many things fixed and update throughout the game.
(PKP English Patch V0.9.0)

I am getting closer to finishing this game. The things left I plan to fix once I figure them out are the white text like in the intro and the 6-10+ random words in menus that I cannot seem to find anywhere. The game right now is about 98% in English.

If you have any questions please let me know.
-ChepChep
 

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
Woohoo! I should really get to playing this game. I had meant to actually start working on it or LPR again last weekend, but I ended up hitting a major dummy-dumb snag on my part. (I forgot my laptop charger while staying at another house. OOPS.)

Glad you uploaded this though. Thank you again for working on this still!

Edit: So hey, question, you said that this was mostly translated, right? Are the opening scene text-boxes meant to still be in Japanese? And Zetta's attacks? Just to double-check. Cause the menu is translated, but not the attacks for him, or the story. Is the translation itself other than the basic menus not put in yet?

Looking back a page in the thread, it seems like Zetta's attacks SHOULD be translated, so. This is weird.

EDIT: OKAY NEVERMIND FOUND OUT THE PROBLEM. There was install data on PPSSPP, and erasing that actually fixed the entire problem.
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
Yea... this game is more picky them LPR for savedata. You pretty much have to start over for any of the menus if any new material was translated. The story should be fine.
 
  • Like
Reactions: Linka

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
So I am having a real hard time finding some random text in the game. It seems to be nowhere. The one that is driving me crazy is the one in the battle after you invite.

2dcbdas.jpg

I have looked everywhere for the text and I cannot find it. The Cancel and Status are in the eboot but I cannot find the other text in there. I have tried just about every type of encoding and no luck. I have also done a RAM dump in PPSSPP and I cannot find the text in memory either. It is really weird.

Anyone have any ideas or suggestions for finding it?

-ChepChep

I've spent a little bit debugging the game in an attempt to find the text for you. While I don't yet know which file has it, I was able to locate it in the memory dump.

You have to follow very specific steps for it to be stored in the memory.

1) Get to a battle screen with the text string showing and open the PPSSPP Disassembly window.
2) Place an execution breakpoint at 0x0890D5C0 (just double-click the opcode).
3) The breakpoint should have triggered. Click the "Go" button until the t3 register has 0BFFF560 as the value.
4) Right-click the t3 register and click Go to in the Memory.
5) Here is the text string in the memory.

Now, the problem is that 0BFFF560 is a constantly changing part of the memory. If you follow my steps from above and you dump the memory, at 0x37FF560 is the text string. It only appears that one time in the memory. Yet, it has to have a source somewhere. I'll try to see if I can pinpoint its origin.
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
Neoxephon,

Thanks for taking a look. That might help since I may be able to figure out where it is being sourced.
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
Alright, so the good news is that I found your text string. The bad news is that the devs were apparently high on something when they made this part of the game.

This particular text string (and I imagine this is the same for those other text strings that you haven't found) is hard coded into the ASM.

To change them, you'll need to modify the opcodes. If you need the text to be longer than the original, it will require more ASM work. If you can make do with the amount of space given, it'll be easier.

The first 4-bytes of the text string is decided with 2 opcodes, a lui and an addiu:
0888F298 lui a0,0x738E
0888F29C addiu a0,a0,-0x647F
As you can see, it loads 0x738E0000 into the a0 register and then it adds the immediate unsigned -0x647F:
0x738E0000 - 0x0000647F = 0x738D9B81
Reverse the byte order and you have 81 9B 8D 73 which is the first 4-bytes of the text string.
0888F2A0swa0,0x0(sp)
Stores the those bytes into the memory.
0888F2A4 lia0,0x4991AE93
This is your next 4-bytes of the text string.
PPSSPP does not play well with assembling 8-byte opcodes, you will need to edit this from the memory for testing and then make your final changes in the EBOOT.
0888F2AC lia1,0xF091
This is your final 2-bytes of the text string.
The space allocated in the memory for this text string is limited. If you need it to be longer than this, you'll have to move where it's stored in the memory.
I'm not sure if Action is the correct translation for it, but as an example I changed this text string to it.
c837f5ac45079cbcb2cef2f951cd61c5.png
Here is the opcode modifications that I made:
775d89cc8ea9d42062bca467797da912.png
Basically, make these changes:
@ 0888F298 change it to lui a0,0x6342
@ 0888F29C change it to addiu a0,a0,-0x647F
@ 0888F2A4 change it to li a0,0x6E6F6974
For this one, you will need to edit directly from the Memory tab at the bottom. PPSSPP will not allow 8-byte opcodes to be assembled through the popup window.
Go to 0x0888F2A4 in the Memory tab, and put in the 8-bytes of hex that you see in my screenshot.
@ 0888F2AC change it to li a1,0x0
Because we don't need any more space for the word Action with the O button icon.
Now, to make this permanent just find the opcodes in the EBOOT.BIN and make the changes in there.

UPDATE
As for the other text string that appears on the Attack menu, next to the weapon. It's the same thing, it's hard coded into the ASM.

0883D50C lui a0,0xED8B

0883D514 addiu a0,a0,-0x6F6B

0883D518 li a1,0x4681

Those 3 opcodes need to be edited to change that text string.

Although Weapon: will take up more space, this text string has a lot of extra wiggle room in the memory compared to the last one. It would just be a matter of a few changes to the opcodes, I think.

Anyway, it's late so I'm off. I hope this helps. If you need this to be Weapon: then tomorrow when I have the time I can see what it would take to expand it by 2-bytes.
 

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
I'll keep it in mind then with future updates. Interesting that PKP is more picky, but I'm pretty certain it's cause there's install data for the game.
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
neoxephon,

I was able to get the eboot modified to get the Action option in the menu added.

I will try to get the Weapon one in the eboot fixed. There is another random line for the buildings when you place them for an action to look at people in them.

Another quick question... How are you finding these? I can follow what you are doing once you have showed the text and can follow it. but how do you find the initial place to start looking once you have the text you want to find up on the emulator screen? Any hints would be helpful since I am trying to learn PSP ASM. I have done tons of coding in ASM but not this type of dissembly ASM.

Thanks again for all your help so far.

-ChepChep
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
neoxephon,

I was able to get the eboot modified to get the Action option in the menu added.

I will try to get the Weapon one in the eboot fixed. There is another random line for the buildings when you place them for an action to look at people in them.

Another quick question... How are you finding these? I can follow what you are doing once you have showed the text and can follow it. but how do you find the initial place to start looking once you have the text you want to find up on the emulator screen? Any hints would be helpful since I am trying to learn PSP ASM. I have done tons of coding in ASM but not this type of dissembly ASM.

Thanks again for all your help so far.

-ChepChep

It was mostly luck for the first one. I was attempting to locate where the text string was coming from and I noticed that only a few of the text strings were going through a LBU opcode, as opposed to all of the text strings going through it. So I did a search for the next nearest LBU and when I put a BP, it activated and after pressing Go a few times it started to read the text string that I was looking for. From that point, it was just a matter of slowly back-stepping from the LBU. I was expecting for it to point me to the actual text string, but I ended up finding those lui and addiu opcodes and I noticed that they were using those to store the text string into registers. Personally, this is the first time I've ever seen text put into a game in this way.
 

ChepChep

Well-Known Member
OP
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
neoxephon,

So I have taken screenshots of all the mystery text. If you willing to help find the ASM to translate let me know. I am interested in the weapon being translated that you found above. I can find two more random places that I am having issues:

1) When summoning a building it has text that is not translated. It should be Dispatch.
6h8hgp.jpg

2) The other one is when you make a wish for an warehouse or another building that has no ability. It should be translated (None)
280mv6f.jpg

Let me know if your interested in tracking these things down. It would be a big help.

-ChepChep
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
(なし)

0888A338 li a0,0xC8826981 @ offset 0x863F8 in EBOOT.BIN (8-bytes)
0888A344 li a0,0x6A81B582 @ offset 0x86404 in EBOOT.BIN (8-bytes)

○ユニット出撃

0888F2DC li a0,0x86839B81 @ offset 0x8B39C in EBOOT.BIN (8-bytes)
0888F2E8 li a0,0x62836A83 @ offset 0x8B3A8 in EBOOT.BIN (8-bytes)
0888F2F4 li a0,0x6F8F6783 @ offset 0x8B3B4 in EBOOT.BIN (8-bytes)
0888F2FC li a1,0x828C @ offset 0x8B3BC in EBOOT.BIN (4-bytes)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: Wow, only $700?