News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Superman 2 - Darkseid Edition: Help editing PPU  (Read 1042 times)

CryinOnion

  • Jr. Member
  • **
  • Posts: 8
  • "Once upon a time, a terribly sad onion ..."
    • View Profile
Superman 2 - Darkseid Edition: Help editing PPU
« on: March 30, 2019, 11:19:33 pm »
Hi! I'm working on my own addendum for PACNSACDAVE hack, "Superman 2 - Lex Luthor Edition". I made the graphics for Intro and Title Screen, but I feeled very annoyed when I discovered the texts before enter the level (You know, "Stage 1 Metropolis!") are located on the PPU memory. I'm from Spain and is impossible to found tutorials about this in my language, or english tutorials easier to understand, or explained with screens, video, or step by step. I only need to change part of the text to contextualize Darkseid as the new boss for finish my project... HEEEELP!





« Last Edit: April 28, 2019, 11:17:53 am by CryinOnion »

sics

  • Full Member
  • ***
  • Posts: 197
  • Contact me!
    • View Profile
    • Deviantart: Terwilf
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #1 on: April 01, 2019, 04:44:57 am »
 If you want to edit the texts of a game and you do not have the necessary knowledge for it, I recommend that you simply analyze the work of someone else:

 You can do this by downloading some translation of the game you want to modify and comparing it with the original version of the cartridge.

 In this way you will be able to obtain the pointers where you need to make the changes for your game, use them in the hexadecimal editor, create a .TBL file and edit the texts.

Some Address:
08EFD
16F17 < Here are the texts that he mentions
177F0
23410
26C14
32A31

 I know I have not explained things in depth, because at this moment I do not have enough time, so I leave an old explanation based on another game, but directly related to what you try to do.

Si tu objetivo es traducir un juego, lo más practico es que directamente utilices otro hack como base, en vez de empezar de cero.

 ■ ¿Cómo deberías hacerlo?

 El objetivo será identificar los cambios importantes en el ROM, para eso debemos descartar todo lo que pueda entorpecer la búsqueda de estos datos, así que:

 1. Comenzaremos comparando los cambios gráficos, de ambas versiones identificándolos con ayuda de algún editor grafico, para restituir todo lo que hayan sido editados en el pasado.



 2. Guardaremos los cambios y para abriremos ambos Cartuchos con un "comparador Hexadecimal", en mi caso utilizo HexCmp2, en el deberás buscar y anotar los bloques con sectores modificados.



 2.a. Si haces las cosas correctamente obtendrás una lista como la siguiente:

  87E0
  BB8D
  1CDF6
  1DF50

 3. El siguiente paso es correr el juego modificado* en un emulador con editor Hexadecimal, te recomiendo utilizar Fceux.

 3.a. Adicionalmente puedes, crear una Tabla de caracteres para facilitarte la edición de texto más adelante.

 3.b Compruebas las coordenadas de cada carácter en el YY-CHR y las transcribes en el DarkTabler.



 4. En el editor Hexadecimal del emulador te diriges a la opción "View / Rom File".



 4.a Desde aquí en un futuro puedes también cargar tu archivo ".TBL".



 5. Ahora viene lo realmente importante, deberás dirigirte a cada sector de la lista con la opción "Go to the Address".



 5.a La forma más accesible de identificar cada sector es repasar primero la lista de direcciones con la tabla de caracteres activada para identificar los sectores con texto.

 5.b Luego de identificados dirigirte al resto de los sectores para ir reemplazando a poco a poco los datos con algún valor al azar, por ejemplo 00.

 5.c Luego de cada cambio deberás reiniciar el juego para poder chequear que ha provocado estos cambios.

 6. Por ultimo debes entender que estas buscando, aquí intentas encontrar principalmente los bloques de texto y sus punteros, usualmente los punteros se encuentran un poco antes que los textos donde apuntan, pero al ser un hack, en mi caso redirigí varios de estos punteros para mover un grupo de nombres a otro sector más amplio para traducir los nombres correctamente.

 
Spoiler:
* El el hack original, no la versión donde alteraste los gráficos al principio de este tutorial.

 Suerte con tu proyecto y disculpa por la falta de capturas estoy algo ocupado de momento  :thumbsup:

 Note: This article is not part of my answer and is kept in Spanish only for training purposes (Thanks for understanding :thumbsup:)
« Last Edit: April 01, 2019, 06:25:02 am by sics »

CryinOnion

  • Jr. Member
  • **
  • Posts: 8
  • "Once upon a time, a terribly sad onion ..."
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #2 on: April 01, 2019, 08:40:26 pm »
Hi! I appreciate any help. Probably I will need a bit of time to "digest" the info and put on practice. There's no translation of this game, but using same concept, I suppose I can use the text of the original game (Sunman prototype) to compare and found the pointers. If I fail, probably I will create a new post with "Explain to a 8YO child how to edit PPU" subject XD. Meanwhile, I have graphic work to do. There's new screen of the progress:

Proveaux

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #3 on: April 01, 2019, 10:42:33 pm »
Code: [Select]
016F1F 20 Up/Down
016F20 EB Left/Right
016F21 OD M 0D+0D=1A From PPU Viewer
016F22 05 E 05+05=0A From PPU Viewer
016F23 07 G 07+07=0E From PPU Viewer
016F24 01 A 01+01=02 From PPU Viewer
016F25 12 R 12+12=24 From PPU Viewer
016F26 0F O 0F+0F=1E From PPU Viewer
016F27 00 End
Changing the above to 20 EB 00 5A 05 0C 04 01 00 would change it from "MEGARO CITY!" to "ZELDA CITY!".

Psyklax

  • Hero Member
  • *****
  • Posts: 1001
    • View Profile
    • Psyklax Translations
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #4 on: April 02, 2019, 01:52:24 am »
Welcome to the forum! :)

I don't understand what you mean by "located on the PPU memory". All the graphics are loaded into the PPU's memory, but they're all in the ROM somewhere. In this case, Proveaux is correct: at $16F1F in the ROM is the location on-screen (in the name table) to place the first city name (MEGARO) and immediately after that is the actual text.

Finding it was very easy: I opened FCEUX's name table viewer and hovered the mouse over the tile containing the first letter, and saw it was $20EB. Now I could have used the debugger to find it but I went with what Proveaux had written and just searched the ROM for 20 EB, and there it is. This doesn't always work for games, of course, but for text like this, it's a good chance. :)

CryinOnion

  • Jr. Member
  • **
  • Posts: 8
  • "Once upon a time, a terribly sad onion ..."
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #5 on: April 19, 2019, 09:56:16 pm »
I'm sorry, but I'm still stuck ... My fault, hacking is not my specialty. I finished all the graphical improvements.



It looks great, but it's unfinished. If anyone can help ... Simply by changing Lex Luthor's references like the screens I share, I will be eternally grateful.

Original Stage 2 Screen



Stage 2 Screen (As should be)



Original Stage 4 Screen



Stage 4 Screen (As should be)



Original Stage 5 Screen



Stage 5 Screen (As should be)



Original Ending Screen



Ending Screen (As should be)




Psyklax

  • Hero Member
  • *****
  • Posts: 1001
    • View Profile
    • Psyklax Translations
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #6 on: April 20, 2019, 09:47:33 am »
Okay, we did the hard work for you: all that is left is really easy, so I'm not going to do it for you. :) Instead, I'll let you learn what's going on.

If you look at what Proveaux wrote, they determined that A is 01, E is 05 and so on. So you can guess that the alphabet in this game goes from 01, so I just wrote a table file, which I'm providing to you below. Just copy everything in the code box to a file, and call it superman.tbl or something, but remember that .tbl extension. Then you can load it in FCEUX's memory viewer, or an editing program like WH32EX, and all the text will be clear.

So, the table:

Code: [Select]
00=
01=A
02=B
03=C
04=D
05=E
06=F
07=G
08=H
09=I
0A=J
0B=K
0C=L
0D=M
0E=N
0F=O
10=P
11=Q
12=R
13=S
14=T
15=U
16=V
17=W
18=X
19=Y
1A=Z
1B=!
1D='
FE=&
FF=%

You'll notice that 00 is a blank space, and I figured out the ! and ' by process of elimination. There are two control codes: I used & to represent when the game needs a new screen location (for a new line of text) which is followed by the location in the name table; and I used % for when the text is done and the game can go back to what it's doing. I forgot to include the numbers, but that can be your homework. ;)

So I could just say "search the file for CANYON or something" to find it, but I'll be nice and remind you that the address where the first level text starts is at 16F15 in the ROM. So, load the ROM in FCEUX, click on Debug->Hex Editor, and View->ROM file. Then load your .tbl file and go to the address I just mentioned. Voila! Try typing something else and you'll see what I mean. Now you can just change all the text you want and save a new ROM file. Done. :) Oh, you can try changing the screen addresses to see what happens! Just for fun. :D

Questions?

sics

  • Full Member
  • ***
  • Posts: 197
  • Contact me!
    • View Profile
    • Deviantart: Terwilf
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #7 on: April 20, 2019, 11:15:10 am »
 I think that although I could do what you ask, it would be more beneficial for you if you tried to do it, since it's not really as difficult as you think.

 Here you have a simplified tutorial so you can achieve it:



 Remember that the table of characters and the address of the text block (16F17) are taken from my previous comment. Good luck :thumbsup:

CryinOnion

  • Jr. Member
  • **
  • Posts: 8
  • "Once upon a time, a terribly sad onion ..."
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #8 on: April 21, 2019, 03:41:24 pm »
Thanks to Everybody! The job is done (and the patch submitted) :laugh:

If I understood well, when I know the equivalence of each letter (or element that I want to change), just writing something like "01 = A" in a .txt file and saving it as a .tbl file, I get a easy way to locate/edit (like a Rosetta stone).

As a rookie, I'm not familiar with most of those tricks and I've been conforming to made changes locating the address of the tiles in the PPU Viewer. I wanna go a step beyond... but I still stuck XD. I mean, I don't understand how can I found some elements using the Name Table Viewer, Debugger, etc. I tried to follow the instructions of some of You, but is like some steps are missed. Example:



The hack of this title screen was easy, cause only use a few tiles to compose it. In "rookie words", I was find the address/name of each tile in the PPU Viewer, and then on the Rom file (a stuff like "20, 2D, 23, 00...etc.". Creating my own equivalence table, I was able to reordenate all those tiles and replace "Kung Fu" to "Ranma".



Now I want to do the same with the DD2 title screen: Move the tiles to fill the empty spaces between the chinese letters. Much tiles, much work, but same process, right? Wrong. Thats where my nightmare starts. If I try to find the tiles of the first letter using the name/address of the PPU Viewer (in that case "01, 02, 03, 04 and then a blank space 00") on the rom file I don't have result. But if I check on the PPU:



 :banghead: Here is. Of course, I know that's useless, cause the PPU rewrites the changes and make it disappear, but "Oh, how easy will be if..." XD.

Now, the point is: Someone can teach me to do this kind of things, explaining step by step, and with simplistic words, like attempting to teach a 8 Y.O. child? I wanna learn, but theres no good tutorials of this kind in my language, or there are too technical for me. Or I throw the towel and look for some aid, some "Robin" to do my "caped crusades"? XD

Psyklax

  • Hero Member
  • *****
  • Posts: 1001
    • View Profile
    • Psyklax Translations
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #9 on: April 21, 2019, 06:21:03 pm »
Someone can teach me to do this kind of things, explaining step by step, and with simplistic words, like attempting to teach a 8 Y.O. child? I wanna learn, but theres no good tutorials of this kind in my language, or there are too technical for me.

I understand that if English isn't your first language, it can be hard when most of the help is in English (although your English seems rather good to me ;) ). The reality is that a real ROM hacker doesn't need to be stepped through things like an 8yo child. Rather, like a real 8yo child, a real ROM hacker just figures things out because they want to. A decent tutorial or some helpful words should be the beginning, not the end.

I can think of several bits of help that really pushed me to do amazing things. One was a user on this forum sending me a PM telling me how a little bit of assembly knowledge would improve one of my hacks, as what he showed me made me realise that assembly isn't all that hard, and I began to learn more as a result. Another thing that helped me after that was KingMike's tutorial about dual tile encoding, because I had just started to figure out how assembly worked, and seeing an actual example with clear explanations of how it worked sparked things off for me, so much so that I was then able to write my own routines for DTE and other things, and recently I was even able to crack a graphics compression scheme in a game.

These few things made a difference to me, which is why I try to help people on the forum - but not just do things for them. With a bit of a push in the right direction, and with a lot of patience and the right attitude, you can do it. :)

Regarding your question about the table file, that's the basic idea. You see, eventually the game has to see some values in the RAM to draw things on the screen. In the case of the NES, the area from $0000 to $1FFF in the PPU memory is the pattern table, which is what the graphics look like. It doesn't include the colour palette, just what each colour the pixels are (out of four possibilities). From $2000 to $27FF is the two name tables (there are two full screens), which say where everything from the pattern table should be placed on the screen.

So let's say for example that $2152 in VRAM is 93 - this means that tile number 93 is here. Tile number 93 refers to either $0930-093F or $1930-193F. So, if you want to know how to read the data in the ROM as text, you have to know how the game ended up putting 93 in that part of VRAM. It may simply be that 93 is a letter of the alphabet, and the rest of the alphabet follows logically, but not necessarily. In the case of Sunman, the letters are on alternate spaces in the Pattern Table (02, 04, 06 etc) but in the ROM, the text is stored without those spaces (01, 02, 03 etc). The way to be sure of this is learning assembly, but again, it's not hard once you get started.

I've said a lot, but the point is just to explain that by working on things a little bit, you can do a lot. There are good tutorials out there, but you need to try yourself a bit. Good luck! :)

denshousha

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #10 on: April 24, 2019, 03:24:23 pm »
Hi CryinOnion, I'm enjoying your project.
There's an early prototype of this game with the classic Superman theme called "Superman (Sunsoft) (USA) (Proto).nes" CRC32: 9AFF332F
I was wondering if there was any way in incorporating that music into your project.

CryinOnion

  • Jr. Member
  • **
  • Posts: 8
  • "Once upon a time, a terribly sad onion ..."
    • View Profile
Re: Superman 2 - Darkseid Edition: Help editing PPU
« Reply #11 on: April 29, 2019, 12:44:19 am »
Greetings from Spain,

Thanks for your words. I would appreciate a small review to encourage other users to take it a look ;)



I heard about this prototype and I agree, add John Williams soundtrack to this game would be awesome (or any other soundtrack, cause the original one sucks  :laugh: ).