Need help with pointers in Resident Evil DS

Discussion in 'NDS - ROM Hacking and Translations' started by lps, Aug 7, 2014.

  1. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    Hi all, i wanna make translation of RE DS and trying to understand text format:

    Pointers:
    0x03B0 - first pointer 4 bytes, to address 0x3290, first 3 special bytes, and text from 0x3293
    0x03B4 - second pointer 4 bytes, to address 0x32A9, first 3 special bytes, and text from 0x32AC

    0x3280 - last pointer 4 bytes, to addres 0x016447

    End of pointers block, last 4 bytes - 0x328c before text on 0x3290

    Sometimes between pointers we have 4 special bytes 0x00730000. (???)
    Sometimes we have 2 or more pointers to the same text string.

    Encoding - ascii
    line brake - 0x01
    string end - 0x00
    Some special bytes:
    0x0300 - ??
    0x0301 - ??
    0x0302 - ??
    0x060002 - wait for input
    0x0600 - end of string with 0x060002, after 0x0600 always 0x00

    some variables:
    0x040105000400
    0x040105000400
    example: "Would you take %item%?" is "Would you take 0x040105000400?"

    Maybe somebody can help me?
    Sorry for bad english.
    sample
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,696
    9,565
    Nov 21, 2005
    United Kingdom
    I have yet to bother to set up properly on this machine for hacking so I am a bit limited in what I can do. Still having watched a few minutes of a playthrough it appears there is both text that appears all at once and other text that gets typed on the screen, such things are a good bet for that kind of markup. However the text location in the file seems to bear little resemblance to what order it comes up in the game (or at least Chris' playthrough).

    Have you tried to see what happens when you change the special bytes? If you do then make sure to load the game and use a normal save/start a new game. Using a savestate might not work. Alternatively if you can find the text in RAM then you might be able to edit that there.
     
  3. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    Dump the script with Cartographer using this table and this command file. The script will contain duplicate strings, just translate them all. Strings that contain control codes only, put them as they are without changing anything.

    After translating the script, put the following text at the top of the script file:
    Code:
    #VAR(MyTable, TABLE)
    #ADDTBL("Resident_Evil_DS.tbl", MyTable)
    #ACTIVETBL(MyTable)
    #JMP($3290)
    Then reinsert the script with Atlas using the same table file but remove "\n\n" from value "/0=<END>".

    The end credits are located in arm9.bin: 0x12E9BC. Pointers come after it: 0x12F2B8.

    The graphics are compressed in cpac_2d.bin.

    If you need any help, don't hesitate to ask.
     
    lps likes this.
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,696
    9,565
    Nov 21, 2005
    United Kingdom
    Impressive. Have you previously tackled this game?

    Some interesting parts of that table as well. "11011181118311861101=<S.T.A.R.S.>" is something I do not often see in DS games.
     
    lps likes this.
  5. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    lps likes this.
  6. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    Thank you, i'll try it!
     
  7. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    I'm trying to make test text insertion, but i dont see any changes in msgdat.en :/
    snake7beckham, can you check it? Here
    Ind can you tell me, how can i decompress gfx to editing it?
     
  8. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    Notice that you're translating commented strings. You have to put the translated text in the line after the commented string. If you want to translate the text directly, change #COMMENTS value to No in command file. Also do not forget to add the text I put up there at the top of the script file before insertion.

    As for graphics, open cpac_2d.bin in CrystalTile2 then: Tools -> LZ77/HUFFMAN compression Search...
    In the new window press Find and the result is 428. You have to Extract them one by one otherwise the program will crash. The program will also crash while extracting some of the addresses. I guess not all of them are compressed graphics. I had a list of all the images I managed to extract but I forgot where I saved it :(
    Here are some of addresses:
    Main Menu: 0x000AEA84
    CAPCOM - Licensed by Nintendo: 0x00008450
    Player Selection: 0x00010530

    After editing the graphics, re-compress them with CrystalTile. Tools -> LZ volume compression...
    As for reinserting them, here is how I do it:
    Open cpac_2d.bin in Windhex. Click Edit -> insert Binary Data. Select the compressed file you want to reinsert and enter its address in Start Offset field then press enter and save.
     
    lps likes this.
  9. Auryn

    Auryn GBAtemp Advanced Fan

    Member
    538
    350
    Jul 21, 2011
    Swaziland
    @snake7beckham: if CT2 crashed while batch extracting, you had some false positives on the list (some entries that CT2 identify as compressed files but they are not). Sad you don't find that list, lps could just have deleted the false positives from the list and then batch extract.
     
    snake7beckham likes this.
  10. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    snake7beckham: thx for your help, now i'm have another software for text editing with tbl file based on yours. After end of translation maybe i'll share it. (Now ~30% already translated).
    So, now i'm need help with palettes for compressed gfx. How i can find it? Or you just edits it on grayscale palette with CT2?
     
  11. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    It's good to hear that you've made it this far :)
    About the palettes, yes I edited the graphics using palettes provided in CT2.
     
  12. gudenau

    gudenau Largely ignored

    Member
    GBAtemp Patron
    gudenau is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    3,285
    1,252
    Jul 7, 2010
    United States
    /dev/random
    I was about to be all xkcd here, but you realy wanted pointers...
     
  13. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    snake7beckham: thx for your help. I'm working together with guy who already translate psx version of RE. He translates dialogs, i'm hack and translate file.
    Maybe you remember where is "yes/no" gfx located?
     
  14. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    gudenaurock: I don't understand what you mean but if you mean it's gonna be trouble dealing with pointers, Atlas will do that for you.

    lps: Actually the letters for "yes/no" are taken directly from the font file (fontsds.cfnt).
    [​IMG]
     
  15. gudenau

    gudenau Largely ignored

    Member
    GBAtemp Patron
    gudenau is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    3,285
    1,252
    Jul 7, 2010
    United States
    /dev/random

    [​IMG]
     
  16. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    Oh, "Yes/No" was located in arm9.bin
     
  17. lps
    OP

    lps man with no face

    Newcomer
    47
    6
    Sep 13, 2009
    Crimea, UA
    Also:
    0x9c50 - (C) CAPCOM CO., LTD. 1996,2006 ALL RIGHTS RESERVED
    0x519C - COMING SOON...
    0xB7D8 - Type A/B (Control Type)
    0xB0BF8 - Inventory
     
    snake7beckham likes this.
  18. snake7beckham

    snake7beckham Member

    Newcomer
    21
    4
    Aug 9, 2009
    0xAF75C - Resident Evil logo (End Credits)

    Slideshow graphics:
    0x4C5FC - Umbrella (Bio-Organic Weapon Official Report)
    0x4CF60 - CERBERUS (MA-39)
    0x4E7A0 - NEPTUNE (Fi-3)
    0x4FE48 - HUNTER (MA-121)
    0x51728 - TYRANT (T-002)
     
    lps likes this.