This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Dumping RAM variables from Emulator?

Dumping RAM variables from Emulator?
by on (#47354)
Does anyone know of a clever way that I could dump a portion of RAM from an emulator (Nestopia) so that I can access the binary file from my computer?

I'm writing a NES drum-sound editor and want to be able to save the sound tables to include in my sound engine.

by on (#47355)
Won't emulators automatically save battery-backed RAM to a file? If so you could put your tables there.

by on (#47358)
Hmmmm, it seems it does but getting it to work seems quite far from "automatic" :)

Can anyone help? I'm guessing I have to configure my iNES header to use an MMC1 mapper with batter-backed RAM option?

I think I've done that because now when I load the ROM file into Nestopia it comes up with the battery-file-not-found-one-will-be-created dialogue box.

However, despite what it says it doesn't seem to create a file anywhere. Though I've tried it with a game ROM and the correct <game>.IPS file gets created. I tried writing a bunch of numbers to $6000 (and onwards) but still nothing.

I seem to remember you have to do some MMC1 register stuff but I've no chance of remembering and can't find anything relevant on the net.

by on (#47359)
Enabling the PRG RAM..?

by on (#47360)
mic_ wrote:


:)

I've just tried that by doing;


Code:
lda #%00000000
ldx #$80
stx $FFFF
sta $FFFF
lsr a
sta $FFFF
lsr a
sta $FFFF
lsr a
sta $FFFF
lsr a
sta $FFFF


to no avail :(

1) Do you have to write all of the MMC1 registers in sequence or can you just write to one (as I've done)?
2) Presumably, writing to the SRAM area you can just write to it like normal RAM;


Code:
        ldx #$00
--a     lda some_variables,x
        sta $6000,x
        inx
        bne --a


[/code]

by on (#47361)
Setting the save file directory in nestopia?

by on (#47362)
Dwedit wrote:
Setting the save file directory in nestopia?


There's no (obvious) setting for it. That may be particular to the OSX version though?

But in any case, commercial game ROMs seem able to create an .IPS file in the folder where the ROM is. :(

by on (#47363)
neilbaldwin wrote:
But in any case, commercial game ROMs seem able to create an .IPS file in the folder where the ROM is. :(


I don't know about MMC1 but if commercial games does create the save file then the emulator seems to be working fine.

In that case, there is a good chance that it's a setting problem in your ines header. What I would do in that situation is to try to find a commercial game that support the same setting and see what is the difference between your header and the commercial game one.

Or even more simple, you could post your ines header setting and people could confirm if your settings are fine or not.

by on (#47364)
Banshaku wrote:
neilbaldwin wrote:
But in any case, commercial game ROMs seem able to create an .IPS file in the folder where the ROM is. :(


I don't know about MMC1 but if commercial games does create the save file then the emulator seems to be working fine.

In that case, there is a good chance that it's a setting problem in your ines header. What I would do in that situation is to try to find a commercial game that support the same setting and see what is the difference between your header and the commercial game one.

Or even more simple, you could post your ines header setting and people could confirm if your settings are fine or not.


Two good ideas. While I'm off to try the first one, here's the second one :)

Code:
; iNES header

; iNES identifier
.byte "NES",$1a

; Number of PRG-ROM blocks
.byte $02

; Number of CHR-ROM blocks
.byte $01

; ROM control bytes: Horizontal mirroring, no SRAM
; or trainer, Mapper #0
.byte %00010010, %00000000

; Filler
.byte $00,$00,$00,$00,$00,$00,$00,$00

by on (#47365)
The comments in that iNES header code are irrelevant :)

by on (#47367)
hmm.. I don't see any problem here, your ines header seems fine.

Since I don't know much about MMC1 I did an overview of the doc made by Disch and some revision of the MMC1 required you to set a flag here:

Code:
$E000-FFFF:  [...W PPPP]
    W = WRAM Disable (0=enabled, 1=disabled)

Disabled WRAM cannot be read or written.  Earlier MMC1 versions apparently do not have this bit implemented. Later ones do.



Maybe some emulator requires it but now I'm just speculating. I wanted to help you more but my knowledge about the subject stop there. I'm sure someone else on the board should be able to confirm the cause of your problem.

by on (#47368)
Banshaku wrote:
Maybe some emulator requires it but now I'm just speculating. I wanted to help you more but my knowledge about the subject stop there. I'm sure someone else on the board should be able to confirm the cause of your problem.


No problem, thanks for the info.

It's got to be something simple/silly - it always is :)