News: 11 March 2016 - Forum Rules

Author Topic: Mesen hexa editor  (Read 1386 times)

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Mesen hexa editor
« on: January 04, 2022, 06:58:51 am »
Hi guys. If I want make easily more texts in NES games. Must I use the Mesen hexa editor (PPU viewer) from the debugger menu? I don't know how I can save my work by avoiding to retry all if I reload the ROM.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 764
  • I am the baldest romhacker
    • View Profile
Re: Mesen hexa editor
« Reply #1 on: January 04, 2022, 06:33:52 pm »
PPu Viewer is mostly just a viewer. I don't see how it can help you "make easily more texts in NES games". And what's that about getting your work saved before reloading?

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Mesen hexa editor
« Reply #2 on: January 05, 2022, 12:54:19 pm »
I wanted say in fact after to have modified anything in the hexa editor PPU I export the DMP file from PPU viewer on the Mesen emulator but I can't import it to continue.

Sanedan56

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Mesen hexa editor
« Reply #3 on: January 05, 2022, 03:17:46 pm »
The PPU viewer only allows you to view what's happening in the video memory at the time. I don't know why you can't import anything, but anything you do in the PPU viewer will disappear after you turn off the game or reset it. You have to edit the ROM to save your changes instead of volatile memory.

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Mesen hexa editor
« Reply #4 on: January 05, 2022, 05:07:51 pm »
The PPU viewer only allows you to view what's happening in the video memory at the time. I don't know why you can't import anything, but anything you do in the PPU viewer will disappear after you turn off the game or reset it. You have to edit the ROM to save your changes instead of volatile memory.

Ah? And must I do it with an .asm file? Where can I see a tuto about .asm file for NES games, please?

mkwong98

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Mesen hexa editor
« Reply #5 on: January 06, 2022, 12:22:59 am »
That is not the PPU Viewerhttps://www.mesen.ca/docs/debugging/ppuviewer.html, that is the Memory Toolshttps://www.mesen.ca/docs/debugging/memorytools.html and the documentation says you can save changes to PRG ROM and CHR ROM using "File→Save" or "File→Save edits as IPS" commands in the debugger window. Have you try that?

Bavi_H

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
    • Robert Hart's Homepage
Re: Mesen hexa editor
« Reply #6 on: January 06, 2022, 09:24:14 am »
As mkwong98 said, to save changes to the ROM, you can go to the Debugger, then go to the File menu and use one of the Save commands: "Save ROM", "Save ROM As", or "Save edits as IPS".

However be aware that if you modify a RAM address, that won't be saved. Only changes you make to ROM addresses will be saved.

In the Memory Tools window, when you are viewing PPU memory or CPU memory, you can right click on any value to help tell if the address is a RAM address or a ROM address. In the right-click menu, if you see an item like "View in CHR ROM" or "View in PRG ROM", that tells you the address is a ROM address. If you see an item like "View in Nametable RAM" or something else like "View in ___ RAM", that means the address is a RAM address.

If you want to save a change to something you see in a RAM address, you will have to find a spot in the ROM that affects that RAM address. Here are some ideas how to do that:

A. Reload the game so everything is unmodified. In the Memory Tools, when you see a PPU RAM address value you want to change, you can highlight some of the bytes you want to change, right-click, choose Copy. Now change the View drop-down box to "PRG ROM", go to the Search menu and choose the Find command, then paste in the bytes. Maybe you can find the same byte values in the PRG ROM.

B. You can set a write breakpoint on the address (right-click, Edit Breakpoint, check the Write box only). Then open the Debugger window. When the breakpoint is triggered, the Debugger window will highlight some code that is writing to that address. Look a little bit earlier in the code to see if it is loading some ROM data you can change.


January 06, 2022, 09:49:49 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Here is something else I just noticed:

In the Memory Tools, when the View drop-down box is set to "CPU Memory", "PPU Memory", "PRG ROM", or "CHR ROM", then the File menu Import command is disabled. But if the View drop-down box is set to any of the RAM types, then the Import command is enabled.

If you are looking at PPU memory that is RAM, you can right click on a value and choose "View in Nametable RAM", then you can Export and Import from there.

Be aware that Nametable RAM data will only make sense for the exact screen you are looking at. If you import at a different point in the game it might look different.

And since the game is often writing changes to the RAM, any import you do would only be a temporary change. But the export and import can help you experiment with changes and save a screen design you are working on.
« Last Edit: January 06, 2022, 10:12:58 am by Bavi_H »

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Mesen hexa editor
« Reply #7 on: January 06, 2022, 04:17:03 pm »
I managed to import files now! Thanks.

I want make more texts by using Nametable RAM, I copy and paste in Find command by using PRG ROM but it's written in red "No matches results".

If not, can I show you an example with a game?
« Last Edit: January 07, 2022, 06:15:00 am by Brutapode89 »

Bavi_H

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
    • Robert Hart's Homepage
Re: Mesen hexa editor
« Reply #8 on: January 08, 2022, 12:49:05 am »
I want make more texts by using Nametable RAM, I copy and paste in Find command by using PRG ROM but it's written in red "No matches results".

Maybe the game might be using some other kind of encoding or compression. What game is it? You might need to explore option B:

If you want to save a change to something you see in a RAM address, you will have to find a spot in the ROM that affects that RAM address. Here are some ideas how to do that: [...]

B. You can set a write breakpoint on the address (right-click, Edit Breakpoint, check the Write box only). Then open the Debugger window. When the breakpoint is triggered, the Debugger window will highlight some code that is writing to that address. Look a little bit earlier in the code to see if it is loading some ROM data you can change.

I'm looking for documents about 6502 machine language and related things about how the NES works to help you. Here are some initial ideas of things to read:

Easy 6502 -- An introduction to 6502 assembly language with examples you run in a simulator.

6502 Instruction Set references:
6502 Instruction Set
NMOS 6502 Opcodes

NesDev Wiki

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Mesen hexa editor
« Reply #9 on: January 08, 2022, 08:23:33 pm »
Maybe the game might be using some other kind of encoding or compression. What game is it? You might need to explore option B:

The ROM is Super Mario Bros. 2 (U) (PRG1) [!]. I would change these words to avoid make small and tight writing, in fact:

to

to

Bavi_H

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
    • Robert Hart's Homepage
Re: Mesen hexa editor
« Reply #10 on: January 09, 2022, 12:50:32 pm »
(Note: Super Mario Bros. 2 uses the same byte values for text characters in PRG ROM as it does in PPU Memory or Nametable RAM. For example "GAME  OVER" is hex E0 DA E6 DE FB FB E8 EF DE EB. If it is okay to use the same number of characters or less, you could use method A to find the byte values in PRG ROM. When you use the Find command, be sure the check box for "Text search" is unchecked so you can search for hex values.)

Since you want to use more characters than the original text, you would have to learn about NES memory addresses, how to use the debugger, breakpoints, and understand the disassembled code to figure out a way to add more bytes somewhere.

I encourage you to keep learning about it, and hope you find it fun to learn about. I haven't yet found a good introduction documentation for complete beginners, but you can check out the links in my previous post. Also here is an additional link: Nintendo Entertainment System Documentation [PDF]. (Some of the information in that PDF file may be old, so also look around the NesDev wiki.)

My Patch

I looked at the code some more since the last time I showed you how to move the continue digit one character to the right. (I also found a Super Mario Bros. 2 disassembly and looked at it some, but it doesn't show the CPU addresses so it was hard to match with the debugger code.)

I noticed an unused area beginning at CPU address ED60 (NES file offset 1ED70). I was able to put the same format of text bytes there with more characters. I also found and modified certain numbers in the code that were embedded addresses and sizes.

If you want to see information about how I patched the game, you can look at the following attachment. Let me know any questions you have. If this patch helped you, please credit me in your translation patch.

Attachment: Super Mario Bros. 2 - Game Over / Continue / Retry text patching information [HTML]
Select the code below and copy it. In a new tab, go to the address box, paste the code and press Enter.
Code: [Select]
data:text/html;base64,PGh0bWw+DQo8aGVhZD4NCjx0aXRsZT5TdXBlciBNYXJpbyBCcm9zLiAyIC0gR2FtZSBPdmVyIC8gQ29udGludWUgLyBSZXRyeSB0ZXh0IHBhdGNoaW5nIGluZm9ybWF0aW9uPC90aXRsZT4NCjxzdHlsZT4NCnRhYmxlIHsgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTsgfQ0KdGQsIHRoIHsgYm9yZGVyOiAuMDVyZW0gc29saWQgc2lsdmVyOyB9DQp0ZCB7IHZlcnRpY2FsLWFsaWduOiB0b3A7IH0NCnRoIHsgYmFja2dyb3VuZDogI2VlZTsgZm9udC13ZWlnaHQ6IG5vcm1hbDsgdGV4dC1hbGlnbjogbGVmdDsgdmVydGljYWwtYWxpZ246IGJvdHRvbTsgfQ0KdGguZ2ggeyBmb250LXdlaWdodDogYm9sZDsgdGV4dC1hbGlnbjogY2VudGVyOyB9DQpib2R5IHsgZm9udC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GQ+PHRkPkY2IEZCIEVCIERFIERDIEU4IEU2IEU2IERFIEU3IERDIERFIEVCPC90ZD48dGQ+IiogUkVUUlkiIC8gIiogUkVDT01NRU5DRVIiPC90ZD48L3RyPg0KPHRyPjx0ZD48L3RkPjx0ZD48L3RkPjx0ZD4yMSBDQjwvdGQ+PHRkPjwvdGQ+PHRkPjwvdGQ+PHRkPjIxIEM5PC90ZD48dGQ+UFBVIGFkZHJlc3M8L3RkPjwvdHI+DQo8dHI+PHRkPjwvdGQ+PHRkPjwvdGQ+PHRkPjBBPC90ZD48dGQ+PC90ZD48dGQ+PC90ZD48dGQ+MEY8L3RkPjx0ZD5sZW5ndGg8L3RkPjwvdHI+DQo8dHI+PHRkPjwvdGQ+PHRkPjwvdGQ+PHRkPkZCIEZCIEZCIEZCIEZCIEZCIEZCIEZCIEZCIEZCPC90ZD48dGQ+PC90ZD48dGQ+PC90ZD48dGQ+RkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkIgRkI8L3RkPjx0ZD4xMCBzcGFjZXMgLyAxNSBzcGFjZXM8L3RkPjwvdHI+DQo8dHI+PHRkPjwvdGQ+PHRkPjwvdGQ+PHRkPjAwPC90ZD48dGQ+PC90ZD48dGQ+PC90ZD48dGQ+MDA8L3RkPjx0ZD5lbmQ8L3RkPjwvdHI+DQo8L3RhYmxlPg0KDQo8L2JvZHk+DQo8L2h0bWw+DQo=

Brutapode89

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Mesen hexa editor
« Reply #11 on: January 14, 2022, 02:57:04 pm »
Sorry for the late...

Oh! Great! It works! Thanks :D But details are so complexe for me, sorry if I need anybody to find codes.

to

to

Prologues:

Part 1
to

Part 2
to
« Last Edit: January 19, 2022, 02:39:08 am by Brutapode89 »