How To

Persistent RAM...What about other unused memory?

0

Alice 2020-11-13 06:58

Is it posible to use other memory as persistent memory?...(peek/poke)

$0000 - Cartridge ROM (32 KB)...maybe part of this?

$8000 - Character Data (4 KB)...maybe part this?
$9000 - BG0 Data (2 KB)...maybe part of this?
$9800 - BG1 Data (2 KB)...maybe part of this?

$A000 - Working RAM (16 KB)

$E000 - Persistent RAM (4 KB)...this is already usable.

$FE00 - Sprite Registers (256 B)
$FF00 - Color Registers (32 B)
$FF20 - Video Registers
$FF40 - Audio Registers
$FF70 - I/O Registers


was8bit 2020-11-13 07:31

Nope, currently PERSIST MEMORY is $E000-$EFFF only... if is enough to hold the entire contents of both 32x32 sized background layers ...


was8bit 2020-11-13 07:33

The purpose of PERSIST is to save game states... that is it... like a save point, or high score...


was8bit 2020-11-13 07:38 (Edited)

Remember, lowres NX simulates a hand-held game player device... where you pop in a game cartridge... and in this scenario, PERSIST represents a memory card, to save where you are at in your game, so you can continue playing it later...

The parts you mentioned for reuse as persist actually represent the memory chips onboard the players "motherboard" and when powered down, all this memory is lost...

Except the Cartridge rom, it represents the game cartridge that gets popped into the player...


Alice 2020-11-13 08:01

Ok.


Alice 2020-11-13 08:06

Looking to save states of numerous variables (entities actually)...I’ll just single out the comparative differences and save those, mostly numerical references. Thanks for the info.


Timo 2020-11-13 09:23

The persistant RAM simulates battery powered RAM inside the game cartridge, so each game stores this data separately. "Working" RAM is built into the simulated console and, as was8bit said, gets cleared when you leave the game.


was8bit 2020-11-13 09:33

@Alice, you can econimize your available space by matching your game data range with persist's range...

For maximum storage capacity, if you limit your variable data (that will be stored) to 0-255 then this is one byte data that uses PEEK POKE...

This would give you a maximum total of 4,096 total variables you can store in persist memory :)


was8bit 2020-11-13 09:39

Another idea (if you know how to read bit data) is the storage of YES/NO or ON/OFF bit variables... like (player had crown?, Level1Boss defeated?) you can squeeze 8 such bit variables into one byte of data, so one PEEK/POKE command can acces 8 bit variables.. 10bytes can hold 80 bit variables ;)


was8bit 2020-11-13 09:39

Another idea (if you know how to read bit data) is the storage of YES/NO or ON/OFF bit variables... like (player had crown?, Level1Boss defeated?) you can squeeze 8 such bit variables into one byte of data, so one PEEK/POKE command can acces 8 bit variables.. 10bytes can hold 80 bit variables ;)


Alice 2020-11-13 09:52

Yep...that’s the direction I’m going. Just adds coding...but that’s ok.


was8bit 2020-11-13 11:18

:D


Log in to reply.