SRAM hex edit translations

Go down

SRAM hex edit translations Empty SRAM hex edit translations

Post by wizzrobemaster Mon 18 Dec 2017 - 8:02

When looking at the SRAM editing information, how do you find those addresses in a hex editor?

for example, how do I find $7ef?

wizzrobemaster
Ganon
Ganon

Since : 2015-01-04

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by zarby89 Mon 18 Dec 2017 - 12:23

You can't modify RAM/SRAM with hex editor from the rom, it on a different chip i think, (on emulator it in a file "rom.srm") when you run a rom the code will fill the RAM from the ROM and SRAM if it exist.
zarby89
zarby89

SRAM hex edit translations Image111

Since : 2016-10-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Puzzledude Mon 18 Dec 2017 - 12:35

When looking at the SRAM editing information, how do you find those addresses in a hex editor?

for example, how do I find $7ef?
By opening the SRM save file in a hex editor and going to 7EF.
However like Math On Napkings said in his docs, you can not edit the SRM in a hex editor and expect the changes to work/load, since every SRM has a safety check, the 2 bytes, which corespond to internal CRC. This is a safety for the save validation, which then prevents direct hex editing, unless if you later recalculate these 2 bytes correctly and change them as well.

Note: there is no direct need of knowing how the SRAM works unless you want to actually tackle with Rom to tell it how to save differently, however this is usually left alone.
Puzzledude
Puzzledude

SRAM hex edit translations Image213

Since : 2012-06-20

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by zarby89 Mon 18 Dec 2017 - 13:04

going to 7EF ? Confused the file doesnt start at 7EF already? for example 0x340 in the .SRM file is the bow but yeah it kinda useless to modify that file but it could be useful to make a sram viewer Razz
zarby89
zarby89

SRAM hex edit translations Image111

Since : 2016-10-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Conn Mon 18 Dec 2017 - 13:27

Well, the sram is part of the ram, with the only difference that it can be stored permanently.
So you need to look into the Rom with an hex editor, best with a Geiger trace log if you want to manipulate something there.

This is only an example and must not be the real Rom code: For example if the beginning sets 7ef3c5 to 00. You should find something like
lda #$00
Sta $7ef3c5
In Geiger trace log. Use breakpoint hook at write 7ef3c5
In the log you also find the byte opcode stuff, it translates t:
a9 00 8f c5 f3 7e.
Find this sequence in the Rom with your editor and change it to
a9 01 8f c5 f3 7e to start in part 1.
Conn
Conn

SRAM hex edit translations Image212

Since : 2013-06-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Puzzledude Mon 18 Dec 2017 - 16:06

zarby89 wrote:going to 7EF ? Confused the file doesnt start at 7EF already? for example 0x340 in the .SRM file is the bow but yeah it kinda useless to modify that file but it could be useful to make a sram viewer Razz
No idea what you mean Zarby. The file starts at 000000. 7EF is in the 2nd saved game.

Thus 7EF
according to MON, is
Slot 1: $000; Mirror: $F00
Slot 2: $500; Mirror: $1400
Slot 3: $A00; Mirror: $1900

Thus 2EF of the second saved game
Again from MON
$280-$2FF Overworld Event Information

SRAM hex edit translations Srmzar10

Puzzledude
Puzzledude

SRAM hex edit translations Image213

Since : 2012-06-20

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by wizzrobemaster Mon 18 Dec 2017 - 16:56

zarby89 wrote:You can't modify RAM/SRAM with hex editor from the rom, it on a different chip i think, (on emulator it in a file "rom.srm") when you run a rom the code will fill the RAM from the ROM and SRAM if it exist.

Okay so that explains why it is called an srm. I presume the srm file that needs to be edited is the one that appears when first loading the game?

wizzrobemaster
Ganon
Ganon

Since : 2015-01-04

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by zarby89 Mon 18 Dec 2017 - 18:46

Puzzledude wrote:
Thus 7EF
according to MON, is
Slot 1: $000; Mirror: $F00
Slot 2: $500; Mirror: $1400
Slot 3: $A00; Mirror: $1900

Thus 2EF of the second saved game
Again from MON
$280-$2FF Overworld Event Information

slot 1: $000

the F00 is the mirror in the ROM if you wanna get or set info in that sram slot you use LDA/STA $7EF000
in the sram file it start at $000 so for the bow which is $7EF340 from ROM become $000340

wizzrobemaster wrote:Okay so that explains why it is called an srm. I presume the srm file that needs to be edited is the one that appears when first loading the game?

it depends what you wanna do but yeah when you create a file it fill the sram data with the new data, everytime you save the game it will save all the ram 7EF000 to 7EF500 into the sram if the slot used is the 1st one


Last edited by zarby89 on Mon 18 Dec 2017 - 18:54; edited 1 time in total
zarby89
zarby89

SRAM hex edit translations Image111

Since : 2016-10-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by wizzrobemaster Thu 21 Dec 2017 - 10:40

So will I need to download Geiger (which I recall only works with Snes9x) to edit the SRAM?

wizzrobemaster
Ganon
Ganon

Since : 2015-01-04

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by zarby89 Thu 21 Dec 2017 - 12:02

i don't know what you are trying to do but you should not have to modify the sram at any point ... it contain nothing else than save data for the player
zarby89
zarby89

SRAM hex edit translations Image111

Since : 2016-10-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Puzzledude Thu 21 Dec 2017 - 12:20

wizzrobemaster wrote:So will I need to download Geiger (which I recall only works with Snes9x)  to edit the SRAM?
Not really. Geiger is a tracer. You don't need to edit SRAM at all.
Puzzledude
Puzzledude

SRAM hex edit translations Image213

Since : 2012-06-20

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by wizzrobemaster Thu 21 Dec 2017 - 18:59

zarby89 wrote:i don't know what you are trying to do but you should not have to modify the sram at any point ... it contain nothing else than save data for the player

What about this:
https://www.zeldix.net/t389-start-sram-modifier



wizzrobemaster
Ganon
Ganon

Since : 2015-01-04

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Puzzledude Fri 22 Dec 2017 - 6:06

That's different. This is the starting SRAM, thus a number of things which you can edit before you even start. This is the "internal" SRAM and it is located in the Rom itself (and is highly useful for editing). It then goes to "actual" SRM file.
Puzzledude
Puzzledude

SRAM hex edit translations Image213

Since : 2012-06-20

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by Conn Sun 24 Dec 2017 - 9:12

you see, ram is mapped from 7e/0000 to 7f/ffff. So when addressing stuff you can decide wheterh you address rom or ram data,
e.g.,
LDA $7ef374  - address ram data
LDA $088423 - address rom data in bank 08

If the game needs sram to continue at later point you can store a part of the ram to sram, this  can be addressed in Zelda 3 from 70/0000-70/1fff.

So in Zelda3, ram 7E/f000-7e/f4ff will be stored into sram.

As example, if you look in MoN's sram guide you find the entry:
$000 - $24F : Data for Rooms (two bytes per room)
This means that 7Ef000-7ef24f (room data) is transferred to sram. Other data stored is overworld data, items, progress flags and such.

If you look closely you have $2000 bytes of sram (70/0000-70/1fff), but only $500 bytes get stored (7E/f000-7e/f4ff). But remember that you have 3 slots. The remaining $500 bytes goes as overall infos like how many slots are used.
Conn
Conn

SRAM hex edit translations Image212

Since : 2013-06-30

Back to top Go down

SRAM hex edit translations Empty Re: SRAM hex edit translations

Post by wizzrobemaster Fri 29 Dec 2017 - 1:45

Is there a Geiger program for NES?

wizzrobemaster
Ganon
Ganon

Since : 2015-01-04

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum