Hacking Queen's Blade: Spiral Chaos Translation Project ( Hackers needed )

Scorp

Well-Known Member
Member
Joined
Sep 23, 2010
Messages
248
Trophies
0
XP
296
Country
Kazakhstan
@flame1234 maybe you did not saw official docs? http://www.cs.cmu.edu/afs/cs/academic/class/15740-f97/public/doc/mips-isa.pdf
ADDIU
rt ← rs + immediate
The 16-bit signed immediate is added to the 32-bit value in GPR rs and the 32-bit arithmetic result is placed into GPR rt.
Programming Notes: The term “unsigned” in the instruction name is a misnomer; this operation is 32-bit modulo arithmetic that does not trap on overflow. It is appropriate for arithmetic which is not signed, such as address arithmetic, or integer arithmetic environments that ignore overflow, such as “C” language arithmetic.

So regarding your code piece:
lui v0,0x896
addiu v0,v0,-0x1AE0

Yes, mnemonic name is misnomered, but that's why official docs exist, right?

Also, btw, why you stuck with these direct code changes, when you can just use armips and assemble instructions directly? I never mess with these byte changes after I heard about armips. And armips handles mnemonics like li v0,0x0895E520 (auto-assemble them into pair of lui/ori), so you would not need to care about that anymore.

For Blaze Union I also do not know what is the big difference. You can extract CPK with existing tools, inside are custom format files, some files with pointers/containers, almost all files (if not all) which have signature like AHXE(c)CRI are audio files and could be ignored. I do not see anything else which is related to Criware there. As files like PTX/PTG/etc are definitely not related to them, seems textures or like that. So by me not too much different from any other game, where you have to figure custom text compression.
 
Last edited by Scorp,
  • Like
Reactions: flame1234

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Blaze Union will have to be a separate topic. Having trouble unpacking the .cpk there. Thanks for looking at it for me.

I tried armips and it did not work. Here's the relevant post.
And there is no tutorial to follow for armips; I did look at the readme.

I did not understand the MIPS manual, but I did read it.
I needed to see "IT IS SIGNED," those words are not there. Instead, they wrote (basically) "it is not unsigned," which is more confusing.

I want to use Python tools. Every language can manipulate bytes. At least every language worth using. Calling an external application I think would be difficult. Because the 16 immediate bits are organized into bytes, you can just use change the "immediate" bytes to change pointer targets. This method works; I've used it before.
 
Last edited by flame1234,

Scorp

Well-Known Member
Member
Joined
Sep 23, 2010
Messages
248
Trophies
0
XP
296
Country
Kazakhstan
Blaze Union will have to be a separate topic. Having trouble unpacking the .cpk there. Thanks for looking at it for me.

I tried armips and it did not work. Here's the relevant post.
And there is no tutorial to follow for armips; I did look at the readme.

I did not understand the MIPS manual, but I did read it.
I needed to see "IT IS SIGNED," those words are not there. Instead, they wrote (basically) "it is not unsigned," which is more confusing.

I want to use Python tools. Every language can manipulate bytes. At least every language worth using. Calling an external application I think would be difficult. Because the 16 immediate bits are organized into bytes, you can just use change the "immediate" bytes to change pointer targets. This method works; I've used it before.
I used CriPakTools, but I do not know, if this was published version or esperknight just passed me compiled binary and did not published it in repo... Anyway, if would be issues with extraction remind me and I will put that version somewhere.

You code in armips did not work, because you put wrong ".psx" and wrong mnemonic notations. Jamrules fixed the script for you, iirc. There is a readme for armips, dunno, quite clear for me. If you really stuck - you can always ask...

I actually quoted you the manual and there is told in description, that:
The 16-bit signed immediate is added to the 32-bit value in GPR rs and the 32-bit arithmetic result is placed into GPR rt.
Not like this is really important, but still info is there. Mnemonic name is not correct, but this is also stated in the manual I quoted before.

No problem to use any language you want, of course. Just hassle with manual byte patches is much bigger than just replace a text in armips. Anyway, that's your choice :) Coldbird likes to write in C native code and do patches on the fly in the memory, for example. So it is not like I press you to write in armips :) Just in this case you would not wasted your time on figuring out why patch do not work correctly, that's all.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
@Scorp Yep, it is there in the manual; I missed it.
I need to download the Github version of armips. The version posted on romhacking.net does not have .psp format support.

Okay, I got the items and strings kinda working. I want to debug a little more, the first character isn't working right for (some) strings when there are >8 characters.
I checked the previous patch; it did not have these strings translated.
I still don't have the strings the previous patch had yet. I've made some good progress on those, though.
ULJS00190_00000.jpg ULJS00190_00001.jpg ULJS00190_00002.jpg ULJS00190_00004.jpg
The original font will show ~14 char in this tiny space, with the modified font wanted by @Final_Agent, we should be able to fit in a few more.

I have two help requests:
1) Please post a save file with a character with many skills, as many as possible. Please post your system data file as well.
If you don't feel comfortable posting the files, then please PM me. I'm pretty sure any saves will be cross-compatible.
2) Please tell me how to access character bios. Do you need a special save?
------------------------
Edit1: Need to NOP out 08833974.
Edit2: OK, for character bios, they used fullwidth space as line break. Not happy about this.
Edit3: OK, most issues solved at this point. Time to find more!
Edit4: Need to change 088D4F1C AND 088D4F6C to 0x1F. Need to modify translation table.
 
Last edited by flame1234,
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
@Scorp Yep, it is there in the manual; I missed it.
I need to download the Github version of armips. The version posted on romhacking.net does not have .psp format support.

Okay, I got the items and strings kinda working. I want to debug a little more, the first character isn't working right for (some) strings when there are >8 characters.
I checked the previous patch; it did not have these strings translated.
I still don't have the strings the previous patch had yet. I've made some good progress on those, though.
View attachment 33838 View attachment 33846 View attachment 33847 View attachment 33848
The original font will show ~14 char in this tiny space, with the modified font wanted by @Final_Agent, we should be able to fit in a few more.

I have two help requests:
1) Please post a save file with a character with many skills, as many as possible. Please post your system data file as well.
If you don't feel comfortable posting the files, then please PM me. I'm pretty sure any saves will be cross-compatible.
2) Please tell me how to access character bios. Do you need a special save?

Thanks, looking great!

1) Here you go, from PPSSPP. Among my saves, I think this is the one where there are most chars with the most levels, if you want more (for example, Airi's missing in this one) just ask.
2) It's the first option in the Special menu, above the jukebox, gallery and movies.
 

Attachments

  • ULJS00190SYS.zip
    283.2 KB · Views: 241
  • ULJS00190000.zip
    213.2 KB · Views: 223
  • Like
Reactions: flame1234

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
shared.bin - 24 files (#0 is the first file)
#2 - Has the font in it (lots of pictures)
#3 - An archive file w/ 20 sub files. The name and description strings are in here.
#10 - The script

shared.bin #3 sub-files (#0 is the first file)
At the beginning of #3 are pointers to each of the 20 sub-files.
Each of the files has a 4-letter ID string as the first 4 bytes.
17 - strings file ID = Strg
18 - Description index file ID = Expl
19 - Description strings file ID = Sent

For 19, each line of the explanation is stored as a separate string, and there is no linebreak character.
The problem we are having: Certain strings in File #19 are re-used between descriptions. For translation purposes, we want to have unique strings for each entity.

I figured out how file #18 (which is not a text file) works.

At the top, you have ID string, file size, number of entries and then a list of pointers to each entry.
1.PNG


Later on you have the entries themselves.
2.PNG


0x480, you have the number 1 which means for this entry there is one line.
0x482, you have the number 0. This tells the game to go get string #0 in file #19 for the first string in this description.
0x48A, you have the number 3 which means for this entry there are three lines.
0x48C, 0x48E, 0x490 you have numbers 3, 4, and 5 which means string #3 in file #19 for the first string, #4 for the 2nd and #5 for the 3rd.

Thoughts on deduplicating them:
1) Just output the stuff. Dump skill number, skill name, and each string.
2) Put a translation with each string
3) Insert strings into #19
For each string:
->If new string exist, deduplicate (put pointer to existing string)
->Elif old string exist, replace
->Else add the string to the end and a pointer to it
--Record string number (regardless of the case)
Insert each string not related to skills
Clean up by removing unused strings
4) Re-generate #18 with the string number data in memory.
 
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Yeah, I noticed about the extensive re-using, it's a fine puzzle, that one. I think I managed to line up all the skills properly, but I'd need a lot of testing to prove it and it could be hell for the rest of our team to check, it'd be really helpful if you could manage to de-duplicate them.

Oh also, just wanted to bring up a problem I saw, it's about auto-centering. Apparently, since the text is half the width the game think it is, all the "location" texts on top appear a bit to the left (you can see it in our previous vids too).

displaced text.jpg original text.jpgdouble text.jpg

The first pic is a bit of an exaggeration since we can shorten it up some, but I think it does illustrate the problem. The case of the third pic, after finishing a Sparring battle, is similar.

What do you think, is it fixable, or do we have to shorten names and hope for the best?
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
QB base patch v2: http://www.mediafire.com/download/xxi515onty4q63q/QB_base_v2.xdelta
This is a differential from the previous base patch version.
Has a modified EBOOT - asm hacks for text appearance
Has a modified shared.bin - extra space for the strings file.

Script Insert v2: http://pastebin.com/gY6iVJ2d
The changes:
1) Accommodate extra space for the strings file
2) Change to be more "dirty" - updates shared.bin instead of reading shared.orig each time. This allows you to run one tool and then the other (order doesn't matter)

String Insert v1: http://pastebin.com/AGQE5JiK

For s1, the line break character for strings in "SPECIAL" is "{". You are allowed up to one linebreak for each of the strings in s1.

For s2, you can have extra lines that weren't in the original. The insertion method is the same as you are using for the script files.

Instructions:
1) Update to QB base patch v2.
2) Delete shared.bin, shared.orig from your working folder.
3) Extract EBOOT.BIN and shared.bin from QB base patch v2; place these in the working folder.
4) Running the script insert program is as per previous instructions
5) You need s1.tsv and s2_new.tsv from Google Sheets to run the string insert program.
Order of 4+5 doesn't matter.
6) Build the ISO. Insert EBOOT.BIN under SYSDIR and shared.bin under USRDIR. Import the file list (it's unchanged from the previous base patch version).
7) Test

Good luck!

I tested and it was working for me.

Here's demos of the extra strings feature:
NSFW (showing extra lines in SPECIAL): http://i.imgur.com/PHwMKqF.jpg
Don't mind the gibberish, that was random strings I used for testing.

ULJS00190_00003.jpg
That is the real description of Apprentice Healing. It doesn't just heal. The original description was 2 lines and I expanded it to 4. You should be able to use however many you like.

Regarding the centering thing. It may be able to be fixed. I think this is a low priority because the text is legible and visible, it just doesn't look very nice.

Next will be the EBOOT strings that they had translated in the previous patch.
 
Last edited by flame1234,
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Thanks, it works without a hitch! (well, long stage titles apparently break the game when in the intermission menu, for example stage 2's, but we can figure a way to shorten them).

If I understand the code right, for the String Insert, we increase the INPUT_COL when our editors start revising the translations and filling new columns, is that it?

Still, hm, just like in your Melona pic with gibberish, the bios' descriptions are hard to read, right? Only those "extra lines" were readable... what's up with those?
menace bio.jpg

-----
Edit: Oh, and in case it helps, the previous patcher said he only changed strings that weren't compressed.
 
Last edited by leecherboy,

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
There are two INPUT_COL entries.
The second is on line 99; it's for the s1 file. The first is for the s2 file. If you don't like that for whatever reason, feel free to modify the code. Basically you just need to rename the first group of INPUT_COL entries to INPUT_COL_S2, that's every time it appears prior to line 99. And the last group of INPUT_COL entries should be changed to INPUT_COL_S1. Finally, move line 99 next to line 6.

No idea what's going on with the character bios. However, I feel comfortable releasing my tool even with this bug because it's obvious that your strings are being properly inserted into the game. The display of the text is a separate issue; it's unrelated to my insert of the actual strings. It's probably related to the VWF-related changes. I can try reverting VWF changes and seeing how that looks. We have to have a VWF though. The default spacing is basically illegible. Also, you need the space provided by the VWF to get characters into some tight spaces. My tests indicate those extra lines are displaying incorrectly, too. I'm really not sure how to fix this issue.
 
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Ok, that INPUT_COL will work just fine as is, I was just asking in case there was something else I was missing.

For the profiles, I went and tried the happy idea to insert an space after every single character, and I think the end result is quite decent. I can automatize the process later, and granted, it won't look as crisp as the rest of the text and it's a bit of a waste of characters, but it's probably our best bet unless we figure out what the deal is with this particular screen.
Menace fix.jpg
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
EBOOT sources: https://docs.google.com/spreadsheets/d/1T8NUcVqtriPO-DY3v9Rk26hOZi1ICcwKcxMuAaIslco/edit#gid=0 (I translated the UTF8 text, feel free to retranslate as needed, this text is quite unimportant)
EBOOT Insert: http://pastebin.com/N4JgnmwP
QB Base Patch v3: https://www.mediafire.com/?gh2n637m3mtvpcd (This is a differential from the original game)

1. Getting ready:
1A. Apply QB Base Patch v3.
1B. Extract EBOOT.BIN from base patched QB.
1C. Download the tool from pastebin.
2. Running the tool
2A. "Export all sheets to TSV", put the .tsv into the tool folder with the EBOOT.BIN and python tool.
2B. Run, insert and test.

Working? May not work on a real PSP because this is now an expanded EBOOT. It worked in PPSSPP but I don't understand why it does work. How does the game know not to overwrite the values loaded from the EBOOT while the game is running? Because in the original game, it puts data in the area that's now occupied by the extra EBOOT text. But with the modified EBOOT, it does not do that (I guess it puts that data somewhere else), and I don't understand why. I didn't seem to affect the game operation at all.

ULJS00190_00011.jpg ULJS00190_00012.jpg ULJS00190_00014.jpg ULJS00190_00013.jpg
Would you like to Lorem Ipsum? How about Lorem Ipsum? Or possibly Lorem Ipsum? The game is basically unplayable like this, but the insert seems to be working. Base Patch v3 has all the original text, this is just a test insert I did.

I had to remove the files in the UPDATE folder to make room for the EBOOT; these have no effect on game operation. You may want to export a new file list because these files are missing.
 

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Hmm... I tried translating a part of the excel then using it, but it doesn't appear to work...

For one of the lines, running the script was giving me this error:

155258.jpg


I had to change my proposed translation, "Memory Card㌢ is locked.", to the so-called "Lorem ipsum" for the script to run correctly, but now the game crashes on start-up for me.

It's supposed to be used in conjunction with the previous scripts, right? I think I followed the steps properly, could you try the current version of the excel to see if there are some length issues?
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
No, this is completely stand-alone. The other tools should work with this too. The other tools are focused on the script, and the additional strings. This one is focused on the EBOOT text.
You tried booting QB Base Patch v3 (without further changes), correct? Will that boot?
That error looks very strange, let me see what's going on. All pointers are supposed to be word aligned and 0x147d3e is not. 0x91E4 for a search string looks OK, though.
Also I need to work on an improvement for you. You need to be able to type %s (those weird codes) and not have it converted to shift-jis so I need to write a subroutine for that.

Pseudocode goes like:
If Enough space:
Replace the text. (done, go on to the next insert)

If not enough space:
Blank out the original text
Write the new text (in the new position, expanded EBOOT)

If word pointer:
Write the new pointer (jump to end)

If li-type pointer:
Write high pointer bytes
->Search for original low bytes
Write low pointer bytes

End: Mark down the position where the next text should be inserted.


That's where the error is happening. But I didn't get that error when I did a test run. The length of your strings shouldn't matter at all. If the "pointer" column has wrong values then you will get that error.

Figured it out: Delete the value in F34. It's a duplicate of D34, that's why it's OK to delete. And also why you were getting that error. That pointer was already replaced. It can't be replaced again, because of the searching.

Still need to figure out why the game is crashing. Maybe it's because of length limits? The limit is higher than why HobbyJapan used obviously, you can see that in the demo screens I made last night.
I guess just use guess and check to figure out which one is causing the problem. Another thing to try, that I probably should have, is just to re-insert the original text to make sure I can do the dump->insert roundtrip.
-----------------------------------------------
Edit: EBOOT Insert v2: http://pastebin.com/rVYrfDeq
ULJS00190_00010.jpg ULJS00190_00015.jpg

I just made that improvement. I didn't make any bug fixes. It should have worked, really (except for that input mistake I made). Make sure you are importing the file list before saving the new .iso.

No length issues yet! Not out of the woods yet. Just keep translating it. I think the person from before's translations weren't very good because he was limited on space. You don't have infinity amount of space (the total amount is what's restricted, not any one individual string). I gave you a lot of space though. Definitely don't hold back.
 
Last edited by flame1234,
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Ok, great, I was finally able to get it running. The glitch in question was apparently due to line 153 having more than 10 characters ("Lorem ipsum" has 11), if I enter more than that, my game won't boot up.

Thanks, I guess the rest of the strings should work fine, I'll let you know if I run into any other problem with them.

Though, I did find a couple of general issues with this script:
-I guess since this is a expanded game now, seems like the previous saves we had won't work, and the savestates look like they work at first, and you can save just fine, but upon opening the game again, the saves you do that way vanish. Is there any way to adapt the saves to the new format, so to speak?
-I don't think the QB Script and QB String work are all that compatible with this new script. QB Script works fine on its own with the v3 patched game, but if you add any of the 2 other scripts to it, opening the game only results in a black screen...
As for QB String, using it with the v3 patched game makes it not boot, and using it after this third script results in error:
wrong string.jpg
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Oh god I'm such an idiot.
Let's look at the previously released string insert tool: http://pastebin.com/AGQE5JiK
See line 163 and 164? Those are EBOOT file addresses. And then for QB base patch v3, the beginning of the EBOOT is 0x20 bytes larger to accommodate a new program header. So these addresses need to be increased by 0x20 (all four of them).
Because of the way the string insert program works, you need to delete EBOOT.BIN from your tool folder and extract a new one from the base patched version, sorry.
I tested and that's now working.
Look now at the script inserter program (previously released version): http://pastebin.com/gY6iVJ2d
See line 187? Those are EBOOT file addresses. The same as before, if we add 0x20 to each value then it should work once again. You said it's already working, but that's strange, it should not work.
I tested, now that's working again too.
Script Insert v3: http://pastebin.com/w6K8m9YL
String Insert v2: http://pastebin.com/CpLJy8ds
(there aren't changes to the EBOOT tool)

You can still run the tools in any order. But you can only run the EBOOT tool once. If you run any other tools and want to run the EBOOT tool again, you need to get a fresh copy of the EBOOT, delete EBOOT.orig in your tool folder, and run all the tools again. You can make a batch file that runs all the tools if you would like, to make this easier. Each tool has about 1 second of running time (at least on a fast machine) so you won't be waiting very long for them to finish running.

That was pretty fast, it took me like 5 minutes to find it. I was just looking for "stuff that depends on the EBOOT" and that's the stuff right there above. It took way longer to test, like 20 minutes.

Okay, and the file load problem took me awhile. I traced it to a line with %03d on it. So... The inserter was replacing this with Lorem ipsum (as requested). I have no idea what this line actually does, but we don't need to mess with it so I deleted the line from the EBOOT spreadsheet. You just have to export a fresh copy of SJIS.tsv and your saves will work again.

Mission accomplished? All strings inserted!

At some point you will want to change the game name to Queen's Blade: Spiral Chaos (you know, in English). You can do this easily by editing PARAM.SFO in your hex editor. I'm not sure but I think this value goes on all save files the game creates.
 
  • Like
Reactions: leecherboy

leecherboy

Well-Known Member
Newcomer
Joined
Nov 1, 2015
Messages
52
Trophies
0
XP
499
Country
Thanks, works like a charm now!

I'll probably relocate some of the columns in this new excel for our editors to put in their stuff, I don't think it'll be too hard to change your script, I see you declared variables and everything.

Edit: Ok, I added a couple more columns, no problem there. But I just noticed about a set of strings we haven't found yet, the lines they say before the battle. I tried looking in the battle.bin and a couple others but I couldn't find them, any idea where they could be?

pre-battle.jpg
 
Last edited by leecherboy,

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
In EBOOT (revised version), shared.bin TOC is at 0x15DCA4 and the entries go decompressed size, LBA, compressed size.
We also know:
shared.bin - 24 files (#0 is the first file)
#2 - Has the font in it (lots of pictures)
#3 - An archive file w/ 20 sub files. The name and description strings are in here.
#10 - The script

Using the offzip method posted by zero on p1 of this thread, you find those strings in shared.bin. To me, that was the most obvious place to look, because literally all strings except EBOOT were in there. And it turns out they are text-based so it will be not that hard to change. I found three files with the same strings: 0x3bd870, 0x3c2430, 0x3c96a0 (original shared.bin). In the new shared.bin, this is in the archive file at 0x40c800.

#17 - Battle strings, maybe other stuff. Nah, mostly battle strings. You guys are gonna enjoy translating these, especially the editors. Battle cries and such, always entertaining.
Sub-files in #17: 94 (?), so that tells me there are 94 characters in this game. That includes NPC enemies like "Bandit" and "Royal Guard."

I modified the dumper I wrote before. Here is the 94 files' worth of text: https://docs.google.com/spreadsheet...q2AMQ68Sq5voEqth663D1k3ig/edit#gid=1893238626
We're eventually gonna need a v4 of the base patch for this... You need more space than is there for your TLs.
 
  • Like
Reactions: leecherboy

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    S @ salazarcosplay: hello everyone