• Rise from your gwave!

Translating Grandia

Discussion in 'Saturn Dev' started by TrekkiesUnite118, Sep 9, 2018.

  1. TrekkiesUnite118

    TrekkiesUnite118 New Member

    So I am still working on this. The main focus right now is on the menus. I'm starting with the Save menu and I've found out the following:

    • The SVLD.BIN file is what controls the Save and Load Screen. It appears to be uncompressed.
    • Save File names are not Stored in SVLD.BIN. They instead come from the Script in the MDT files.
    • There is a hard limit on the size of Save File names of 14 characters. This is the exact amount that will fit in the space available when using the 16x16 font.
    • The 8x16 font can still be enabled with the control code 0x03.
    • Using the 8x16 font will let the SVLD screen have more than 14 characters for a save file name, but even if you use it in the MDT file and extend the sizes accordingly, the game will crash when it loads an area with a Save Point that has a Save File name larger than 14 characters.
    • If the Script Header portion of the MDT files has a value of 0xE001, that code corresponds to the Save File Name.
    • The SVLD.BIN file is loaded into HWRAM at the offset 0x060B2000
    • The the pointers in the SVLD.BIN file for the text values are the HWRAM offsets, not the file offsets.
    • The text for the menu is drawn on VDP2 layer NGB3.
    • The text is written to VRAM bank A0.
    So with this info there the following issues and concerns:

    1. The 14 character limit is going to be a problem as some of the English scripts names for these files go beyond 14 characters.
    2. If we go the route of using the 0x03 control code size expansion is going to be a must. I've looked into this and I think it's possible but it's going to be a bit painful as it's most likely going to involve scanning SVLD.BIN for all pointers to each specific text value for the screen and updating them all as we expand the size. Not hard, but it needs to be perfect to work.
    3. Another route is changing the Save Load screen to use the 8x16 font by default. I've looked into this as well and it does give us enough space that size expansion may not be necessary outside of character names and one or two odd messages. However there is a snag here. While I can change the font, this screen seems to handle spacing a bit differently. If I just change the value to use the 8x16 font, I get this:
      [​IMG]
    4. With additional changes that control the spacing I can get it down to this at least:
      [​IMG]
    As you can see, there's still graphical garbage at the end of every bit of text. I've tracked it down and it looks like the game isn't blanking out as much of the buffer it uses to write each line, so garbage is getting into VRAM. When you use the 0x03 code this doesn't happen. You can also see that the highlighting bar isn't going the full width it should be.

    So I need to figure out how to fix these issues. If anyone wants to try messing with this, here's the values you need to change to enable the 8x16 font. Values are the offset in HWRAM, values for the SVLD.BIN file are in parentheses.:

    0xB4DC9 (0x2DC9) = Change the 02 to a 01.
    0xB37F7 (0x17F7) = Change the 02 to a 01.
    0xB3E94 (0x2E94) = Change the 00 to a 01.
     
    Last edited: Dec 5, 2018
    Ponut and vbt like this.
  2. klarth

    klarth New Member

    I think my thought on this right now is it might be best to make a text lookup table of all possible save locations in an unused RAM location. (Expand some standard file thats always in memory). The mdt filenames are modified to contain the 0x3 code followed by the indexes to these locations. Then the code that handles printing the names will, after seeing 0x3, start reading the text from the mdt file’s offset to write to the screen. Spacing should be fine, no corruption, and no crashing.

    This means the save data will not be expanded, which gets rid of the issue of having to remap all of those pointers. Also helps in making the save data format remain mostly compatible with grandia digital museum (when/if that gets translated)
     
  3. TrekkiesUnite118

    TrekkiesUnite118 New Member

    So that could work for the save file names. Though something like that is probably beyond my skillset to be honest.

    Though for some parts that are stored in the SVLD.BIN file we might still want to look into changing the font as there might not be enough space to have it point to an offset with the 0x03 code. For example Save and Load both only have 4 bytes available which might not be enough for a memory pointer and the 0x03 code depending on where it ends up at.
     

Share This Page