News:

11 March 2016 - Forum Rules

Main Menu

[PSP] Opening and Editing a .FNT files

Started by 6Kyojin4, May 28, 2022, 03:51:42 PM

Previous topic - Next topic

6Kyojin4

Hello, Im trying to make a Japanese language translation for the game Sonic Rivals since the game never released in japan.

Since the games text is sored in a plain .txt file it will be very easy to modify the games text, but without being able to insert the necessary Japanese glyphs into the game's font files the translation cant happen.

That's why I need help opening and editing the games three .fnt files and the file GLOBAL_BINARY.STR
Files location: /USRDIR/FONTS/
36_pt_chrome.fnt
18_pt_chrome.fnt
12_pt_white.fnt


I've tried various texture, sprite, and Tile-Viewers tools, such as TileMolester, TiledGGD, and crystaltile2.
But no matter brute force this by changing various different setting on these programs, I can't display the font at all.

Can anyone help me figure out to successfully view and edit the game's font files

[Unknown]

I'm not that familiar with this game's font handling (just its RGB ramp handling which has caused performance issues in PPSSPP), but these might be PGFs, which are somewhat common on the PSP.  There are some tools for reading these, such as:
https://ppsspp-font.netlify.app/

They could also be compressed in some way, or something.  I'm definitely not sure they're PGFs.

I'd usually suggest using a debugger to figure out more about how the game reads them.  For example, in PPSSPP turn on IO logging and look at what file is even being read when.  Then you could set memory breakpoints to find what code reads from the files, once they're read into memory.

-[Unknown]

6Kyojin4

#2
Quote from: [Unknown] on May 28, 2022, 06:09:12 PM
I'm not that familiar with this game's font handling (just its RGB ramp handling which has caused performance issues in PPSSPP), but these might be PGFs, which are somewhat common on the PSP.  There are some tools for reading these, such as:
https://ppsspp-font.netlify.app/

They could also be compressed in some way, or something.  I'm definitely not sure they're PGFs.

I'd usually suggest using a debugger to figure out more about how the game reads them.  For example, in PPSSPP turn on IO logging and look at what file is even being read when.  Then you could set memory breakpoints to find what code reads from the files, once they're read into memory.

-[Unknown]

I've already used ppsspp's debugger but I haven't much any useful information from it. All I know this that the texture(s) are swizzled and that it is 512x128 size. But that info doesn't really help me figure out how to extract or edit the game's font. Do you have any other suggestions or is there something here I'm missing?


[Unknown]

If you open the log console and turn on the SCEIO logs at the debug level in developer settings, you'll see all the calls to sceIoRead and sceIoOpen.

The game must be opening the file off the disc and reading it into memory.  That's how you could set a breakpoint based on the file.

Conversely, you could set a breakpoint based on the texture, to see when that's written.  That would be based on the Texture L0 address in your screenshot.

The GE debugger isn't going to help you understand the file format.  The Disassembly is what might help you.

Make sure you're using a recent version of PPSSPP (ideally the latest git build.)  It has more features in the memory view, which may also help investigating.

-[Unknown]

6Kyojin4

Quote from: [Unknown] on May 28, 2022, 07:42:34 PM
If you open the log console and turn on the SCEIO logs at the debug level in developer settings, you'll see all the calls to sceIoRead and sceIoOpen.

The game must be opening the file off the disc and reading it into memory.  That's how you could set a breakpoint based on the file.

Conversely, you could set a breakpoint based on the texture, to see when that's written.  That would be based on the Texture L0 address in your screenshot.

The GE debugger isn't going to help you understand the file format.  The Disassembly is what might help you.

Make sure you're using a recent version of PPSSPP (ideally the latest git build.)  It has more features in the memory view, which may also help investigating.

-[Unknown]

I don't see a developer setting to turn on SCEIO logs. Also when messing around with the other developer settings the emulator dumped all three of the game's font sheets but it doesnt tell me which files the texture for the font sheets came from.




[Unknown]

Main screen (or Pause screen) -> Settings button -> Tools -> Developer tools -> Logging channels.  From there, change SCEIO to debug or verbose.

Admittedly, it's a bit buried.  You can also turn on the DevMenu there which gives quicker access to some dev tools while in game.  It's not available from the Windows menu.

Texture dumping works on textures loaded into RAM/VRAM and dumps them on usage.  It doesn't really know what file they came from, because game code is responsible for loading and processing files into textures.

That said, since those textures:
* Have colors and shading.
* Contain all letters.

I can tell you it's definitely not PGF, after all.  It wasn't as obvious to me from the GE debugger screenshot.

-[Unknown]