edit text ppu
Moderator: Moderators
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
edit text ppu
Hello, I have a question. Can someone tell me how to edit text in PPU in the game Dynowarz Destruction of Spondylus? I made a table with the missing letters in YY-CHR because there were missing letters like Z J and so on, but now the problem is different. When I want to change the word GRK PUNCH and others to another word, the PROGRAM shows that there is no such word in PPU, even though when I loaded the table it shows that I am in PPU.
Can someone help me with this or give me some program that will detect unavailable words such as GRK PUNCH AND OTHERS even though I created a table from the title screen and in the game?
Can someone help me with this or give me some program that will detect unavailable words such as GRK PUNCH AND OTHERS even though I created a table from the title screen and in the game?
Re: edit text ppu
I am not sure this is the best way to approach this but here is what I have done for something like this before. You never know how the code works that writes the text to the nametable, so you have to find the code and see how it works. I used FCEUx but I am guessing you can do something similar and probably better in Mesen.
I opened the Name Table Viewer and I hovered the mouse over each character. The nametable address that you are hovering over is shown at the bottom of the window. (Due to mirroring, there may be 2 or more of these addresses.) I then used the debugger to set a breakpoint on writes to that PPU memory address. Then reset the game. You can find the spot that writes the character to the nametable this way, and it will show you the specific part of the code that wrote it. You can then look at the code to figure out how it works and where it gets its data from, etc, so you can modify it.
Note that there are probably a lot of different places that write to the nametable, including init functions that might write 00s to the full memory, etc. You may need to look at multiple writes to that same location until you find the one where the correct character appears on the screen. i.e. clicking Run again, waiting for another breakpoint to happen, etc.
I opened the Name Table Viewer and I hovered the mouse over each character. The nametable address that you are hovering over is shown at the bottom of the window. (Due to mirroring, there may be 2 or more of these addresses.) I then used the debugger to set a breakpoint on writes to that PPU memory address. Then reset the game. You can find the spot that writes the character to the nametable this way, and it will show you the specific part of the code that wrote it. You can then look at the code to figure out how it works and where it gets its data from, etc, so you can modify it.
Note that there are probably a lot of different places that write to the nametable, including init functions that might write 00s to the full memory, etc. You may need to look at multiple writes to that same location until you find the one where the correct character appears on the screen. i.e. clicking Run again, waiting for another breakpoint to happen, etc.
Re: edit text ppu
Digging into this a little bit, I found this in the english version:
You can see, there are some interleaved bytes in the ROM. Then I edited it:
You can see, there are some interleaved bytes in the ROM. Then I edited it:
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
Re: edit text ppu
thank you buddy can you search for these addresses in the HXd program because I need to change them
Re: edit text ppu
I can help teach you how to find it yourself. I have some instructions above with FCEUx. Please tell me where you get stuck and I can help.
Re: edit text ppu
The charset encoding is just the positions of the characters in the background CHR section, so you can handle this sort of thing as a general case of encoding conversion. The canonical way on UNIX systems is the iconv(1) utility which takes two files, each mapping a character set to a series of symbolic names. You produce one for the source and one for the destination, essentially you're saying "convert every 0x0A to 0x41", "convert every 0x0B to 0x42" etc.
As for the symbolic name, this is just something like <U0041> for "UTF-8 code-point 0x41" or <KEYA> for "the A key". This is used to join the source and destination encodings between the two files. Fair warning, POSIX iconv(1) is picky in that if you use either a user-supplied source or destination charmap, you have to provide both, you can't say go from a custom Nintendo encoding to the system's UTF-8, you have to spin a destination UTF-8 mapping yourself. From the standard:
The -c and -s options help with leveraging only partial charmap files but it is generally suggested to have a mapping for every possible character. Non-printable source bytes can be simply converted to unrelated random characters in the host charmap. I'd generally suggest non-printing and/or non-textual characters, that'll help with scenarios like text recognition.
So basically:
May yield some interesting results if srcmap maps CHR codepoints to symbolic names that then are mapped to the system charmap.
What's helpful is the charmap formats are the same, so you can even use iconv(1) to first translate a string from the ROM to UTF-8, edit that string in a host text editor, then use iconv(1) with the charmaps swapped to insert the text back in with, for instance, dd(1). The whole thing could even be setup as a pipeline akin to (options omitted):
meaning snip the piece out, convert to UTF-8, make some systematic edit, convert back to the game's encoding, then insert the snip back in. Make the dd(1), iconv(1), and sed(1) parameters variables and you've got a nice little spot text editor for NES ROMs as long as you draft charmap files reflecting the realities of the background CHR.
Granted you can always consider seeing if your integrated tool of choice such as a text editor, debugger, IDE, what have you, has a memory viewer in which you can set the encoding. However, I find iconv(1) helpful because it acts as a filter so can be hooked up down in just about anything I need. As always, found on any UNIX near you, check into compatibility layers if you're on WinNT.
Edit: For posterity, I wanted to add that this editing mechanism only works if the original and edited strings are the same length, start changing the lengths of strings in ROMS arbitrarily without keeping bound and you break pointers all over the place.
As for the symbolic name, this is just something like <U0041> for "UTF-8 code-point 0x41" or <KEYA> for "the A key". This is used to join the source and destination encodings between the two files. Fair warning, POSIX iconv(1) is picky in that if you use either a user-supplied source or destination charmap, you have to provide both, you can't say go from a custom Nintendo encoding to the system's UTF-8, you have to spin a destination UTF-8 mapping yourself. From the standard:
In other words, the standard defines the format of charmap files and that selection of system charmaps by symbolic name should work, but makes no guarantees of the symbolic names for individual characters used. However <UXXXX> is a widely-used convention when UTF-8 is involved.The iconv utility can be used portably only when the user provides two charmap files as option-arguments. This is because a single charmap provided by the user cannot reliably be joined with the names in a system-provided character set description.
The -c and -s options help with leveraging only partial charmap files but it is generally suggested to have a mapping for every possible character. Non-printable source bytes can be simply converted to unrelated random characters in the host charmap. I'd generally suggest non-printing and/or non-textual characters, that'll help with scenarios like text recognition.
So basically:
Code: Select all
iconv -f ./srcmap -t ./destmap rom.nes | strings
What's helpful is the charmap formats are the same, so you can even use iconv(1) to first translate a string from the ROM to UTF-8, edit that string in a host text editor, then use iconv(1) with the charmaps swapped to insert the text back in with, for instance, dd(1). The whole thing could even be setup as a pipeline akin to (options omitted):
Code: Select all
dd | iconv | sed 's///g' | iconv | dd
Granted you can always consider seeing if your integrated tool of choice such as a text editor, debugger, IDE, what have you, has a memory viewer in which you can set the encoding. However, I find iconv(1) helpful because it acts as a filter so can be hooked up down in just about anything I need. As always, found on any UNIX near you, check into compatibility layers if you're on WinNT.
Edit: For posterity, I wanted to add that this editing mechanism only works if the original and edited strings are the same length, start changing the lengths of strings in ROMS arbitrarily without keeping bound and you break pointers all over the place.
Last edited by segaloco on Sun May 11, 2025 10:35 am, edited 1 time in total.
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
Re: edit text ppu
I got it all sorted out but now I have another problem because I'm talking about the game Summer Carnival 92 Recca, I want to change the inscription complete to finished and game over to the end of the game but it's not there anywhere because the table is a bit weird
could you find me an address where the words complete and game over are located
could you find me an address where the words complete and game over are located
Re: edit text ppu
Open Sprite Viewer. If you see the "GAME OVER" letters there, you won't be able to make "END OF GAME" (what is this? Zoop?) because the text is written with sprites, and only 8 sprites can be displayed on the same scanline.
First, you'll want to set the mapping on the second pattern table (the one with sprite tiles) to 8x16 so that the tiles line up. This will show most of the alphabet in tiles $00-$3F.
Methods that game engines use to draw sprites differ more than how they draw text to the nametable. You'll probably need to do a lot more reverse engineering of the program code, working backward from the output (sprites on screen) to the input (metasprite tables in ROM). First you'll need to figure out where in RAM the game stores its 256-byte "shadow OAM" (display list where the CPU builds sprite positions). Put a write breakpoint on $4014; any value written is the high byte of the starting address of shadow OAM. For example, many games write $02, which causes the CPU to copy 512 bytes from $0200-$02FF to object attribute memory (OAM) on the PPU. Then by correlating PPU Viewer, Sprite Viewer, and Hex Editor, you can find where in RAM it writes the sprites. By putting a write breakpoint on addresses in shadow OAM, you can find what code is writing to shadow OAM and what table it's reading in ROM.
First, you'll want to set the mapping on the second pattern table (the one with sprite tiles) to 8x16 so that the tiles line up. This will show most of the alphabet in tiles $00-$3F.
Methods that game engines use to draw sprites differ more than how they draw text to the nametable. You'll probably need to do a lot more reverse engineering of the program code, working backward from the output (sprites on screen) to the input (metasprite tables in ROM). First you'll need to figure out where in RAM the game stores its 256-byte "shadow OAM" (display list where the CPU builds sprite positions). Put a write breakpoint on $4014; any value written is the high byte of the starting address of shadow OAM. For example, many games write $02, which causes the CPU to copy 512 bytes from $0200-$02FF to object attribute memory (OAM) on the PPU. Then by correlating PPU Viewer, Sprite Viewer, and Hex Editor, you can find where in RAM it writes the sprites. By putting a write breakpoint on addresses in shadow OAM, you can find what code is writing to shadow OAM and what table it's reading in ROM.
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
Re: edit text ppu
Can you explain it to me in more detail, how to handle it, for example like in dynowarz in the pictures, because I don't get it
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
Re: edit text ppu
this thing has a mirror image, we'll play around in Djinn Tile Mapper and I found it but I can't find the game over text
Re: edit text ppu
Note: TheBoxGamePL appears to be using a version of FCEUX which doesn't have a sprite viewer. (It looks like the Qt/SDL version of FCEUX has a Sprite Viewer, but the Windows version of FCEUX does not.)tepples wrote: Sat May 10, 2025 6:58 am Open Sprite Viewer. If you see the "GAME OVER" letters there, you won't be able to make "END OF GAME" [...] because the text is written with sprites, and only 8 sprites can be displayed on the same scanline.
As an alternative, you can do the following:
- Once you are on a screen with the text you are interested in, pause the emulator.
- Go to the Config menu, the Display sub-menu, then uncheck the item "Graphics: BG" leaving only "Graphics: OBJ" checked. When the emulator draws another frame, these display settings will hide the background tiles leaving only the sprite tiles showing.
- Press the shortcut key for Frame Advance to draw one frame. (I believe the Frame Advance key is "\" by default, but you can go to the Config menu and the command "Map Hotkeys" to check.)
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
-
- Posts: 106
- Joined: Thu Aug 10, 2023 3:08 am
Re: edit text ppu
<link to commercial rom download removed by mods>
Could you please help me sort this out because it doesn't show me the tiles?
Could you please help me sort this out because it doesn't show me the tiles?