I've been looking at Grandia: Digital Museum recently and one of the first major problems I've (expectedly) ran into is that there isn't enough room within each file to edit in a decent translation. After having no joy with Sephiroth1311's PSX TOC modifying program, I went hunting for his Italian guide to doing it with a hex editor, and opened my ISO and followed along with the help of Google Translate. It all seemed to go smoothly:
(highlights added as reference notes for myself)
and CDmage was reporting the random new filesize I decided to give to this file (505,000 bytes). After saving, recompiling and mounting the ISO, Windows was happy with it but the SSF emulator wouldn't start the game (it was able to load from a save state and then work as normal, however). When I tried this last night, I tried a new file size of 508,000 and after mounting the image, Windows was giving me an error message whenever I tried to open the FIELD/ folder containing the file I'm trying to expand. I guess this is possibly because I was overwriting part of another file by overexpanding the one I was working with.
The game doesn't seem to have any "index" (though it does have IDX files if that's what that refers to) or "second TOC" (E800.MDT only matched once in an ISO search). The TOC changing guide mentions a formula for calculating the maximum file size, but I can't make sense of it:
LBA = 1 file to expand
LBA = 2 to the next file to be expanded
(LBA 2 - LBA 1) * 2048 = maximum result
...Well, the LBA of the file I'm trying to expand is 31,115 but how do I know what is "the next file to be expanded"? From the example I understood that it means the file listed previously in the TOC. This leaves me with -237568 bytes as my maximum file size, which obviously isn't right.
Does anyone know how to calculate the maximum filesize like this for Saturn games (Mode 1/2352 ISOs), or am I approaching this in the wrong way?
Edit: Yeah, the ISO stops working if I import a file that's even 1 byte bigger than the original. Also, when I mount the ISO after making my changes, Windows reports that the edited file is still the original size. There must be a check going on somewhere, right?