Hacking Legend of Heroes Translation

Status
Not open for further replies.

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I think it will really depend on the scene. It depends on the dialog box placement and scenery. You don't want to block the whole screen. I figure what we will do is an unformatted insert first. Play through the game and see what it looks like. That is how I tweak a lot of the boxes that I have done so far. (But 60 characters in a single line... that probably won't happen.)



Hey Flame... on a side note. After some sleep and manual labor. I found those missing pointers I was asking about you making a tool for. Yep. Another blasted format string... LOL!
 
  • Like
Reactions: Hargrun

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
So I am doing some major mapping due to the fact I can't find some pointers. Narrowing down what has standard and what doesn't. I have come across a few more coded pointers, but I can't narrow down the op code to do a search to see if a table exists for it. I am getting better at using the debugger but sometimes I feel like I am running in circles.

What do all the function (buttons) do in the PPSSPP debugger? I can click them and go all over the place but I would prefer a more direct approach. I'm basically asking what kind of things should I be looking for when trying to narrow down the stuff I need to manipulate in order to shift stuff around.

Here is how it is break down so far. You can see why space is a very important aspect sometimes. LOL.


JamRules
Sorry it took forever, but thanks for finding that code to fix that font problem. I haven't done extensive tests but I bet it will do the trick.
 
  • Like
Reactions: JamRules

JamRules

.....
Member
Joined
Jan 9, 2014
Messages
527
Trophies
1
XP
2,204
Country
United States
JamRules
Sorry it took forever, but thanks for finding that code to fix that font problem. I haven't done extensive tests but I bet it will do the trick.

I only checked it on the post battle menu so there may be similar code elsewhere for the others,
hopefully not

The step functions are like most debuggers
http://msdn.microsoft.com/en-us/library/office/gg251651(v=office.15).aspx

And the RA button can be useful at the start of a function to find where it was called from
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Set a memory breakpoint on that text. Then see what you get. Try to backtrace it to see where the pointer is coming from.
I got for you the pointers for lines 169 through 178 in that spreadsheet (at least), so you could add those. Like we saw earlier, the LI opcode for line 169 is at 0xDD24 in the eboot (I got several others for you, and thanks to neoxephon).

Memory breakpoint:
1. PPSSPP has hex memory searching only, so get the hex for your search string and then search for it and find it (CTRL+F in the memory window).
2. R-click (start of your string) -> copy address
3. Go to breakpoints. R-click -> new breakpoint.
4. Paste in the address you want to break on. You want a "memory" breakpoint that will break on a "read."
5. Run and see what you get.

I don't think there's a manual or even a help page for PPSSPP.
 
  • Like
Reactions: JamRules

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
x0026ACB4 - Eboot Address
xF4AB2600 - Little Endian Pointer
始める - Dialog
20 8E 6E 82 DF 82 E9 - Hex Version (They start with the space for formatting).
I suspect this may be the are the table is around x2DA908
It points to the location x1696D8
At that spot you have 27 00 03 3C F4 AB 42 24 .​
The F4 AB is the address part I edited. (Did the same for other bits in the menu as well - well anything that I "thought" was a match to the address. Also I notice it starts with a 27 00 and not a 26 00 (when the address is actually 26 AC B4). Don't forget the xC0 stuff also. Adding, subtracting, adding, subtracting........ Numbs the brain. LOL!​
It looks like the other stuff... but here is the part that is confusing me. There is a bunch of stuff that I had to edit to make the mini game menu's look right in this general area. In the spreadsheet of addresses, it is located on line 1761. The next few are all part of that menu stuff (well quite a bit is, but the menus are broken up in the many pieces. Some use the same spots. Others don't. Basically I am trying to figure out exactly what I need to look for if I am trying to reverse the address to find the table listing for positions since using the table is a whole lot quicker to edit the code stuff (only took 5 minutes to locate all the previous ones after I found the table).
As best to my ability I tried to cross reference the table I suspect of being the database for addresses. It seemed like a good fit but without knowing exactly where the code starts, I can't be entirely sure.​
SIDENOTE: Couple of numbers from PPSSPP​
RA - x827C88​
RAM - x8A6EBF4​
PC - x8A1BD40​
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
I think you may be missing something in "RA?" That is a very weird number for RA.
But anyway, you did pretty good. So "PC" is the spot where it is reading your text.

You should hit run again to see if there is a different spot where it is reading it also. It seems like this subroutine is just trying to find the end of the text, or maybe just how long the text is.
For the one that's outputting the text, there should be a read followed by a write (I think).

Not really sure how to proceed from there to see where the pointer is coming from.

Can you post the save you are using to test the mini-games?
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
The PC register contains the address of the current instruction. RA is, of course, Return Address and is normally used to "remember" where it was before a jump occurs, to allow the game to return after the instructions at the jump have been completed.

Here is some handy MIPS info, which has a nice list of all the registers and what they are used for: https://github.com/uofw/uofw/wiki/MIPS

You can use the RA register by right-clicking it and choosing "Go to in Disasm" and it will take you to the point after the jump. You can then place a breakpoint before the jump. It can be very useful for going backwards to find where a register value originally came from.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Savedata - It is one of these. Just took all the folders and put them in archive.


Gonna try some stuff and I will be back later with plenty of questions.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
It's just so weird...
So for this game to go between EBOOT and physical memory addresses it seems you add or subtract 0x8803F40.

I wanted to look at 始める (begin) in the slots minigame. It's at 0x26ACB4 in the EBOOT and that means at 0x8A6EF18 in RAM (because the string begins with a space).
There was a pointer to this somewhere. Has to be, right?

What ended up working was searching in RAM for the little endian of 0x8A6EF18. I got only one hit for it at 0x9E8E388.
So then I set a memory breakpoint on that address and got a couple hits but one that looked promising was 0x897FB94. It looked promising because it's actually writing back the 0x8A6EF18 (pointer) value; the other hits weren't.

So then to figure out where the actual value was coming from.
http://imgur.com/CpD4g4g
0x0897FB90 addiu v0,v0,-0x10E8 is getting jumped to. The last instruction before it is:
0x0897FAB8 lui v0,0x8A7
So if you do the math (why am I doing this?) you get 0x8A6EF18.

You can see from the screenshot that there are a couple (two) more right near there.

The last part is changing that instruction at 0x0897FB90 to point wherever I want. So how would I go about doing that? Specifically I need help calculating that immediate value in the addiu to point to where I want.

So why can't they be like normal people and:
LUI v0, 0x8A6
ORI (or ADDIU) v0, 0xEF18
That would make my life a lot easier.
 

Attachments

  • CpD4g4g.png
    CpD4g4g.png
    23.8 KB · Views: 193

SCO

Active Member
Newcomer
Joined
Dec 4, 2013
Messages
25
Trophies
0
Age
42
XP
144
Country
I wonder if you'd consider after this Nayuta no Kiseki, it's supposedly a very good action game and it's also Falcom in the same setting. Less text there... probably?
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
I am having a problem with the quest file. The translators have done such a nice job that they have ballooned this 115kB file to 130kB. When I try to insert it using UMDgen it complains that it can't fit in the available space. It actually complains that it can't put the next file, t_record, where it's supposed to go. What do I do?
Even if the problem can't be solved, how do I figure out how much space I actually have to work with? I have 64 LBAs to work with (I think). How big is an LBA?
If I wanted to try to solve this problem, how would I go about it? How can I point the program to the moved t_record file?
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Gonna take some creative rearranging. I am pretty sure this works... but it has been a while since I did it. You are gonna have to move the file position in the data.lst file and the file allocation file that UMDGen uses to stick the files in the right spot. I will try to get some time soon to start helping again and test this out.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
So I took a couple of minutes to go over the quest file. That is a really good job on the translation. Clear and to the point. It is definitely something that we will have to work out. Especially for the purpose of checking the screens to see if the stuff fits. Gonna get right on figuring out the problem.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Save files. Need a lot of them. Especially ones that give access to the fishing game or any other games (except those in the minigames under the extras - got those covered). So anybody interested in helping us out with this, please upload them and post them here or in our personal forums. If it helps, we may post a really really buggy patch that translates some stuff in the game. I repeat, it is buggy and absolutely no way reflects the current state of the work. I just need to make sure the terms and translations I am using are appropriate for the situation. I have left the decision of the patch up to other members and will get back once a decision has been made.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Need some help. Looking for somebody skilled in image format conversion. If interested, PM me. Don't want to post files publicly that could cause problems. Basically the available tools out there are screwing the colors up when converting them back to the original format.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Something completely random, but totally related to this project. :P

forgotformat.png




For the life of me, I can't remember what kind of encryption this is? Anybody mind giving me a heads up. This is what I am screwing around with in my moments when I need a break from Zero. It's Astonishia Story. Relation to this project = random acts of just screwing with a game while trying to think of more important stuff...
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
NPJH50311_00019.jpg
NPJH50311_00015.jpg
NPJH50311_00020.jpg

So we are getting to a point that a new font is definitely needed. But since ISO stuff is a lot different in terms of where things are compared to the old days of one single file for a game. I am completely lost as to where the information for the font would be. Here is a simple breakdown of what I know about the fonts in this game. There is the standard PSPFONT.DAT and a couple of image style fonts (itp -> bmp). I believe the image fonts handle stuff like menus and the sort but I could be entirely wrong. I'm not up to speed on all the tech side of things. I just find patterns and edit them :). But seriously, any kind of heads up on what kind of things I am looking for would be helpful. I have read a few documents on hex and the way fonts looks, but sorting through thousands of things and not even knowing if they are doing the desired effect is way over my head. Thanks in advance.


Edit: Just added some screenshots to show what I mean. You can see some of the characters that are really horrible in spacing.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I figured out what file handles the normal latin characters (x40 = A) kind of stuff. It is the sfont.itp in the data/system folder. I had thought originally there was multiple font files being used in different instances, but apparently not. I mean there is a different font when japanese characters are involved (like punctuation stuff). But in truth, the game just automatically scales down the font to fit the situation. Hmm... This could be good. This could be bad. I believe the characters are 8 width (max leaving no space between the next character). Didn't think to check the height... Let me do that real quick... Well they are at least 13 high. Probably an 8x16 kind of scale. Though 13 is plenty high enough.


Now if only I could figure out how to make the VWF. I poked around in the GE Debugger but it was mostly just poking around since I don't know what codes to be looking for. You see all kind of cool things and some stuff I wish I could rip out of there to use.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
There is monster data in:
\data\monsnote\monsnote.dt2
\data\battle\dat\mn#####.dat (##### = 5 numbers, a bunch of files like this in this folder)

The reference entries for the Falcom trick (*.dat files) are in:
\data\cclm\battle\btasm1.bcc

After stepping through the program, it looks like there are no pointers for the .dat files (still not sure about monsnote). It's an "opcodes" type of format.
The subroutine that reads the .dat files is at 0x888247C. It looks like it is is incrementing s2 and then moving data a bunch of times.
Like for example, at 0x8892BF4, it will skip that whole block if the byte is zero (and just increment s2 by 1). But if it's not zero, it will do the block, and then jump 0x18 spaces forward at 0x8892C68 towards the end of the block.
And by the way, it copies the *.dat data to 0x9E34000 and then works on it with the subroutine. It does so with each *.dat file that's applicable to the battle you are entering.

To solve, rather than try to decode the whole .dat file format, I think I will just try to extract the text and its position from the .dat files and then just insert the translations at those positions. When the program gets to the text parts, they have length-measuring stuff in there, so it should probably work. I looks like space could be a problem for monster ability names, so we'll have to try some substitute characters to see how they work. Does this seem like an OK solution?

Still not sure about monsnote though. Zero G gave me this:
http://i58.tinypic.com/wv1f0p.png
There don't appear to be any pointers in monsnote.dt2. There must be pointers for this somewhere because it is such a big file. I will need to step through the code that reads the monsnote file to see what's going on.
--------------
For the cooking file, you serendipitously discovered that, for the cooking file:
-Spaces are deleted
-Comma + space = Space
So you can edit the translations to reflect that if you like (to make spaces wherever you would like), by find replacing " " (space) with ", " (comma + space). It also means we can't have any commas in this file. Bummer. Not a big deal - they are not really necessary for this file. As a test run, you could try two commas in a row to see if that will coax the comma into showing up.
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Cool. I got Prime