News: 11 March 2016 - Forum Rules

Author Topic: Move the hex code to another position in the hex editor  (Read 523 times)

ballony

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Move the hex code to another position in the hex editor
« on: November 30, 2021, 04:10:04 am »
Hello!

I have a question about changing a hex code of a text message that starts at 03C93790 column 00, and goes to 03C937E0 column 0B. I want to move this code of this text message to 03C9E900 so that the text starts there. I am translating a hack into another language, and where the text is now is not enough space for the complete translation. I would have to accept cuts. Can someone help me further!? How do I have to do this?!


FAST6191

  • Hero Member
  • *****
  • Posts: 3390
    • View Profile
Re: Move the hex code to another position in the hex editor
« Reply #1 on: November 30, 2021, 11:43:02 am »
Sounds like you are going to have to learn about pointers.

Games by and large don't have time to parse the ROM to find the text like the web browser we are communicating on or documents you might write as it takes valuable CPU resources, and usually text does not change between boots Read Only Memory after all) so even worse to waste it. To this end they have pointers which are lists of locations (memory level, ROM level, file level... it depends what system, game and setup you are using, and can vary within the game, and there are multiple approaches to doing pointers but I will leave that for a moment) of places where text is at. Older systems might well do it line by line with the pointers serving to mark end of line, later ones might do section by section or screen by screen.

If we knew what system and what game that might help some more but still going to have to learn about pointers.

ballony

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Move the hex code to another position in the hex editor
« Reply #2 on: November 30, 2021, 12:04:31 pm »
I do not know how this works with the pointers. Would be glad if you could help me. The game I am working on is a Super Mario 64 hack.

FAST6191

  • Hero Member
  • *****
  • Posts: 3390
    • View Profile
Re: Move the hex code to another position in the hex editor
« Reply #3 on: November 30, 2021, 05:48:20 pm »
For Mario64 most will probably tell you to go look at the source code and recompile that these days. That will sort many things out almost automatically and possibly reduce any text editing efforts to it actually being harder to edit a post here.

Anyway the N64 did not have a file system (a means to have the big ROM break down into component files, think like a CD based game) so we are back to ROM level and RAM level efforts depending upon what the devs did.

ROM level is much as it sounds and is mostly finding values that count from the start of the ROM (or some fixed point) and where the text is.
RAM level will take where the ROM appears in RAM (for any console this is rarely starting at 00 and instead will be somewhere else in the main system memory, possibly even split up to allow it to do things -- see bankswitching on older consoles).
Most look immediately before or after the text in question as a lot of the times the pointers are there. Otherwise you are looking for values that correspond to locations in ROM/RAM for the text as these will tend to be the pointer.
There are further things that make pointers sometimes more annoying -- text formatting can be included in them, and the are the various ideas of how pointers can be used within programming -- above the thing where I said start at the start of the ROM and count from there is standard pointers, offset pointers is when you start somewhere else (usually the start of the text section) and you have relative (adding the value of the pointer to the current location is sometimes done for various programming related reasons).

You might also find something in http://www.romhacking.net/?page=utilities&category=&platform=&game=847&author=&os=&level=&perpage=20&title=&desc=&utilsearch=Go
https://hack64.net/wiki/doku.php?id=super_mario_64:ram_memory_map might do something more but I am not seeing things for text.