Post subject: Probing NES WRAM initial state
Emulator Coder, Skilled player (1120)
Joined: 5/1/2010
Posts: 1217
There was discussion on IRC about probing the initial state of NES WRAM. The general idea was as follows: - Take a very cheap NES NROM (because those are the simplest) cart and replace the ROM chip with 32kB (E)EPROM chip. - Burn image that exports the contents of NES WRAM in image[*] - Run that cart. Oh, there is complication that NES has both PRG ROM and CHR ROM/RAM. Presumably the CHR ROM chip would have to be replaced too. As for SNES, similar things would work there, albeit with much larger (E)EPROM chips (e.g. 1024kB chip). [*] Other things like exporting the state through NES controller port (kinda like how ST-0018 firmware in SNES Shogi2 was dumped) could also be possible...
Post subject: Re: Probing NES WRAM initial state
Hoe
Joined: 7/31/2004
Posts: 183
Location: USA
Ilari wrote:
As for SNES, similar things would work there, albeit with much larger (E)EPROM chips (e.g. 1024kB chip).
You could likely use any sized ROM, just adapt the pins over. I used to make NES flash carts with 1mbit flash roms. Do any games read from prior to writing to WRAM? It's been like 10 years, but I recall seeing them zero it out, even. The contents are likely inconsistent and might be considered "undefinable." edit: sum the contents as the PRNG seed!
Site Admin, Skilled player (1256)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Relevant: http://tasvideos.org/forum/viewtopic.php?p=358364#358364
micro500 wrote:
To get a better idea of what kind of impact this would have, I decided to look at a number of NES games and see which access uninitialized RAM. I modified Bizhawk slightly to monitor the RAM usage. If the game read from a RAM address before it has written to it, I recorded that. I also recorded what addresses were written to. I took a list of NES games that the site has movies for, ran them for 600 frames each in that modified Bizhawk, and then outputted the data collected. I then turned the data into images to make it easier to digest the information. Here is the image set (warning: large/long images) Each 8x8 pixel block represents a RAM address, starting at 0x0000 at the top left, and ending at 0x07FF at the bottom right. The colors mean the following:
    Black - RAM was not read from or written to (still uninitialized) Green - RAM was written to first Red - RAM was read from before it was initialized, and still hasn't been written to (still uninitialized) Orange - RAM was read from before it was initialized, but has since been written to
Keep in mind that this data is from only 600 frames of the game, and with no input. The results may change if input is given or the analysis is run for longer. You can tell from the images that a large number of games access uninitialized memory, but I'm not sure what they are doing with it. As other people have said, some games start up in a different way depending on the initial state of the RAM. Being able to control this initial state might be beneficial to movie authors, but I'll leave that up to other users who know more about each game to determine. This data was simply to get an idea of how many games might be impacted by this new policy. Also, if anyone is interested in seeing my changes to Bizhawk or the raw data I made the pictures from I'll be happy to post it.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Skilled player (1744)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
creaothceann wrote:
http://board.byuu.org/viewtopic.php?f=5&t=2554
"The board requires you to be registered and logged in to view this forum" The 2nd link works though.