- Joined: 25 Feb 2023
- Posts: 99
|
Homebrew with Battery Back-up RAM
Posted: Thu Aug 17, 2023 12:56 am
|
Just wondering how to handle save games in homebrew development, as well as where the start and end points of the battery back-up RAM are. I'll need this information later for my FF1 port project, but it doesn't hurt to gather that information now.
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14769
- Location: London
|
Posted: Thu Aug 17, 2023 6:16 am
|
You page in SRAM by writing to $fffc and then you can write in the $8000-$bfff area. That’s it; you just need to decide what to read and write. Typically games ensure the important parts of game RAM are close together and block copy it.
You can also consider just having game state in the save RAM area the whole time.
|
- Joined: 31 Dec 2022
- Posts: 30
|
Posted: Wed Sep 13, 2023 9:29 pm
|
CerezaSaturn64 wrote Just wondering how to handle save games in homebrew development, as well as where the start and end points of the battery back-up RAM are. I'll need this information later for my FF1 port project, but it doesn't hurt to gather that information now.
if you are going the use custom electronics using memory chips with parallel address wiring, , with 1 ROM chip and 1 battery backed up RAM chip, for the cartridge hardware (with no mapper) then you can put the RAM location anywhere from 32K up to 48K. The custom electronics will involve needing some logic to decode the address , if the address is defined as a RAM address it writes or reads to the RAM chip, otherwise it's ROM and it is just read from. In machine code you can use a 16 bit register to read or write to a the RAM address.If you just want to store a few bytes in RAM then you would just fewer address pins on the ROM IC.So for example you may have 4 bytes to store in battery backed up RAM at the end of the 48K,from address 49148 to 49152. and the remainder will be 48K ROM.
|