Chaos;Head Chu☆Chu

Discussion in 'PSP - Hacking & Homebrew' started by RimiNishijou, Jun 30, 2016.

  1. RimiNishijou
    OP

    RimiNishijou Member

    Newcomer
    13
    45
    Jun 29, 2016
    United States
    http://forums.fuwanovel.net/topic/14818-chaoshead-love-chu☆chu/

    Looking for translators! As we've completed insertion tools and are ready to move to the next stage. It hit me today... at the small chance that not having a GBAtemp account is stopping you... take this riminishijou.tumblr.com. Ask or message a preferred method or communication(anon asks are on so you don't even need an account~!).
    What does being a Translator for this project entail?
    Well it would entail translating text from within the game from Japanese to English. This text would consist mostly of dialogue, menu text, possible text within images. Though I laid out certain types of text you may be translating other types may appear from within the game during the project. Of course we aren't working on any schedule or deadline so there isn't a rush though it's preferable to get things done in an orderly manner(as in have a plan of what and when it may possibly be completed or at least a status update of the amount of text agreed upon). Any amount of worked done is highly appreciated be it 5, 25,625,etc.. lines. A sample of lines that may appear can be seen in the screenshot below(see left side of the image).


    Hello! I'm quite new to the PSP scene of hacking around. Luckily so fair it's been mostly smooth. Text can be extracted and inserted. The problem as always is not enough space for translation of line or name. After some researching I came across a github for the psp version of s;g. Which then lead me to finding a handy program called "Cartographer". It's quite nice for extracting text. If what I'm able to do is somewhat usable I can only imagine what you'd be able to do if you knew what you were doing. I suspect it would look something like this(see right hand side).
    [​IMG]
    Included with Cartographer is a sample of using it on FF1. Here is the command example file - http://pastebin.com/i1KMUj1S . The tbl files used are your normal english ones. You run a command "cartographer ff1.nes ff1_commands.txt ff1_script -m" (m = multi file; -s for single file).

    As you can see above I've been able to adapt the block type to output the text. This is all fine and dandy but seeing as when inserting everything has to have the same amount of bytes it's kind of useless when the goal is to be able to make the strings as big or as small. Hence you'd go the pointer route. Cartographer has an option option for ATLAS which is used to compile the script back in to a dat file(see the s;g github above has all needed files to compile "SG00_01.dat" translated in english using atlas. My problem now is just that I haven't really given finding pointers out side exes a go. Normally I'm tasked(well if doing a project or what not with others) with go through the exe and changing hard coded text. Bust out LordPE and some math and you're literally gold. Process normally goes along as described in this blog post by doddler - http://www.doddlercon.com/main/?p=243

    How does one go about finding pointers and other required information needed to be able to change them location so that you can change the string lengths. I assume since you're giving the info to ATLAS that can do this for you so only have to find the original data is fine? Or is that pointers only for re inserting in which case you'd have to do it you're self I assume.

    Bottom line I'd like some help or pointers(non pun intended) on finding where the pointers are located or at least for inserting them in to a command for it to rip through them via Cartographer. Or any other solution. If it works I can easily change over. Of course as I was about to forget here is the game file I'm currently working on.

    TLDR: I need help finding the pointers for game text.

    Here is a link with all software and files mentioned above if you'd like: https://mega.nz/#!KlhRTAqQ!mTEoSemnPohfQ9kwgX6pnHg4cFvClk6NTtlZKmt4DaI ( dat file, cartographer and sample files, github master clone)

    Just the dat file: https://mega.nz/#!SsIEGLAD!f8HOsWpCCGio2QwXELgKUcZ5r3iqVzhRsqiYbKf2GFA

    Finally to close... have some screen shots. I quite like the font in game. Names aren't translated due to not enough space and if the name isn't in the name table it's treated as text. So i'll have to find it and change it. Also I never knew controlling a PSP game with a SNES controller felt so natural. Only thing missing is the stick and luckily C;H using the dpad.

    I also possibly have a TL lined up for what ever we are able to complete. I got them hooked on SciADV. They've read through S;G. Started on Chaos;Head and plan to go through Robotics;Notes(They'll be rubbing that one in my face due to it never getting a TL...). So maybe I can ask if they'd like to work on a side story. In the event that we fail I'd like to have at least the tools/ground work laid out so that if someone wants to pick it up they can and not have to worry about it all again. I'm sure it'll work for the S;G side games as the hex between them looks pretty close. Though I believe they are translated via youtube vids... I know some would rather play them instead(my self included) so hopefully anything I can work on would make that easier. The dialogue is a little choppy due to well having to fit it in the space of the Japanese counter part.
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
    Last edited by RimiNishijou, Jul 12, 2016
    Bad Bunny, JamRules and Zander1995 like this.
  2. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,328
    5,339
    Mar 17, 2010
    Norway
    Alola
    To find pointers you would normally search for the address of the data you want to find, possibly with an offset added to it, and with byte order reversed depending on whether the system uses big endian or little endian.
     
    RimiNishijou and flame1234 like this.
  3. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    727
    409
    May 17, 2009
    United States
    PSP is little-endian. Intel machines are too; that doesn't matter for your application though.
    This method will indeed work for your file CHLCC_AA00.BIN (offset = 0)
    The first one is at 0xCEC to help you get started.

    For replacing I usually do the following pseudocode:
    1) find the pointers, store in array with pointer address and pointer target
    2) offset = 0
    For each string you want to replace:
    3) addr = addr of string in original file (must know this)
    4) addr += offset (so the system can find the string)
    5) compute original length, orig_len
    6) compute new length, newlen
    7) for each pointer:
    7A) If ptr_addr > addr, ptr_addr += newlen - origlen
    7B) If ptr_tgt > addr, ptr_tgt += newlen - origlen
    8) Replace the string
    9) Offset += newlen - origlen
    ------------------------------
    10) When done replacing the strings, write-back the pointers using ptr_addr and ptr_tgt
     
    Last edited by flame1234, Jun 30, 2016
    RimiNishijou likes this.
  4. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,328
    5,339
    Mar 17, 2010
    Norway
    Alola
    If the pointers are stored in blocks (arrays) in the game data, Atlas does all the hard work of inserting the strings and overwriting the pointers with the new ones for you as long as you tell it the start address of each block. I've used it before for a GBA game, never with PSP games though.
     
    RimiNishijou and flame1234 like this.
  5. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    727
    409
    May 17, 2009
    United States
    Hadn't heard of that ATLAS program before.
    The pointers are stored thusly:
    pic.png

    I don't know if Atlas has enough capabilities to work in a situation like this (but it might).
     
    JamRules and RimiNishijou like this.
  6. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    727
    409
    May 17, 2009
    United States
    Full dump of CHLCC:
    https://docs.google.com/spreadsheet...a0FTOqCCU37IF8OuQNBvFeqiJw/edit#gid=352357701

    Note: Please make your own copy of this if you want to edit.
    If you need help going from Google Sheets to local file, here is my Google Sheets TSV export script (Google Apps Script): http://pastebin.com/Aw4r0bkW

    A: Text address
    NOTE: Anything that didn't look like SHIFT-JIS to the Python decoder got skipped
    B: Pointer
    NOTE: Blank in the pointer column means my program couldn't find the pointer for this text
    C: Text

    I don't have a lot of experience using Atlas. I'd just write a custom program for this.

    Do you have repacking tools?

    Here's the program code but I don't really expect it to be usable. Python 3:
    AFS unpack: http://pastebin.com/Y8BcpwBU
    Dump: http://pastebin.com/4M7RKbvj
     
    RimiNishijou likes this.
  7. RimiNishijou
    OP

    RimiNishijou Member

    Newcomer
    13
    45
    Jun 29, 2016
    United States
    FOR THE RECORD ABOUT FLAME'S TOOLS ABOVE. They don't capture all the text from some files. Some(I've seen it in C;H Chu) split text blocks by x00x00x00 instead of x00(which the script stops at) so be warned if you plan to use them.

    Damn! Thank you so much @flame1234 & @The Real Jdbye !

    I'll look through what is provided. I do have tools for unpacking and packing all the different files types so that's not a problem.

    To answer your question flame apparently ATLAS is a program that can change the pointers to match the new length as long as you can give it the old pointer. Before this project I only knew it as a Machine TL software. That is... as long as you can create the config right something like this. If done right it can make things much simpler :P
    Warning: Spoilers inside!

    Well I'll be getting to work!

    EDIT: I somewhat understand the config files for creating ATLAS files.. but I may just end up writing an inserter... shouldn't be to hard thankfully their is nothing left after the dialogue text. I might try fiddling with making a config for Cartographer more later though. Would be fun to try to get em both workin

    EDIT: Happy Birthday Rimi :P! (7/3)
     
    Last edited by RimiNishijou, Aug 1, 2016
    mdtank likes this.
  8. RimiNishijou
    OP

    RimiNishijou Member

    Newcomer
    13
    45
    Jun 29, 2016
    United States
    Update time!! So I did end up making my own insertion tool. I thought I'd learn some Python in the process which slowed me down a bit. Below is just the output for CHLCC_AA00(the first script). Currently only problem now is text wrapping ingame(as you'll see in a screenshot)... but that shouldn't be much of a problem. Worse comes to worse I'll just use new lines(Maybe it's something like Grisaia and you just need to encase every word in []'s ). Thanks again @flame1234 and @The Real Jdbye for your help!
    upload_2016-7-5_3-5-27.png

    I must have done something right... Because running it through HxD's Compare comes up with no changes(if you just use the base extracted text).
    upload_2016-7-5_2-47-27.png

    Of course... Here are some new screenshots. Now it really comes down getting a translator.... My friend seems to be enjoying Chaos;Head. On the grounds of TL help they have said to ask again once they finish Chaos;Head. I understand if they don't want to help out(hell even if they did a few lines I'd be more then grateful!) as translating takes a great amount of work. For example in scanlation(though on a smaller scale then game scripts as normally chapters are shorter). Well now that I got this working I guess I should get back to scanlating in the meantime... Translators Welcome!
    ULJM05821_00006.jpg
    ULJM05821_00007.jpg
    EDIT: Started playing track down the menu text... Steiner has made me even more hype for ChuChu. If you don't know Steiner. They were one of the translators who worked on the Steins;Gate VN translation! Posted here saying that it's quite good/well worth the play.

    EDIT: Friend would rather not translate and it's understandable. They also just got there copy of robotics notes... :| X3

    What does being a Translator for this project entail?
    Well it would entail translating text from within the game from Japanese to English. This text would consist mostly of dialogue, menu text, possible text within images. Though I laid out certain types of text you may be translating other types may appear from within the game during the project. Of course we aren't working on any schedule or deadline so there isn't a rush though it's preferable to get things done in an orderly manner(as in have a plan of what and when it may possibly be completed or at least a status update of the amount of text agreed upon). Any amount of worked done is highly appreciated be it 5, 25,625,etc.. lines.
     
    Last edited by RimiNishijou, Jul 11, 2016
    JamRules likes this.
  9. DarkSoulFlame

    DarkSoulFlame Advanced Member

    Newcomer
    83
    0
    Jan 20, 2008
    United States
    Dude, finally someone is taking the step on doing this. Thanks for this! I've been recently hooked onto SciAdv and it sucks that there aren't TLs for LCC and C;H Noah. I look forward to this.
     
  10. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    727
    409
    May 17, 2009
    United States
    You should post your help request at fuwanovel.net. If you did that already, I didn't see it. Worse case scenario: No one offers to help you.
    I have this weird feeling that this userbase (GBAtemp) likes gameplay in their games.
    You can also try posting a help wanted request at romhacking.net.

    I am busy with other projects. I don't like VNs that much either. I like my VNs to have a mix of VN-type gameplay and "real" gameplay. This is one is just pure text; most VNs are like that.
    Also the text looks very difficult, I had trouble with the first few lines.
     
    RimiNishijou likes this.
  11. RimiNishijou
    OP

    RimiNishijou Member

    Newcomer
    13
    45
    Jun 29, 2016
    United States