Difference between RAM and cartridge SRAM?
Moderator: Moderators
Re: Difference between RAM and cartridge SRAM?
$700-$7FF is just regular NES RAM same as the rest of it, using it for a stack in the compiled C code is a CC65 specific thing.
Re: Difference between RAM and cartridge SRAM?
Yes, the 6502 is hardwired to always use page 1 ($0100 to $01FF) for the hardware stack.
- rainwarrior
- Posts: 7979
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Difference between RAM and cartridge SRAM?
It's not even a cc65 specific thing. You can put cc65's software stack anywhere in RAM, and it doesn't need to take up a whole page either. It's not really relevant to this discussion about hardware RAM layout though.
The hardware stack at $100-$1FF is relevant, though that's not what aquasnake brought up.
The hardware stack at $100-$1FF is relevant, though that's not what aquasnake brought up.
Re: Difference between RAM and cartridge SRAM?
Also, since page 0 and page 1 are mapped to the internal RAM on the NES they can also still be used as normal RAM. They are not magical in any way except that they can be used by zero page addressing and the hardware stack respectively. Of course any usage of page 1 should be carefully controlled so that it doesn't clash with the stack.
Ever since I learned that mappers like both MMC1 and MMC3 has write protection of the cartridge RAM, I've been wondering why games like Dragon Quest always reminds you of holding RESET when turning off power. Isn't the write protection enough?
Good point.Sumez wrote:Important difference is though, that most mappers with battery backed RAM also often include a way to protect writes to the RAM, since unintended writes while turning off power to the console could potentially corrupt battery backed RAM. For cartridge RAM only used as "WRAM", that corruption wouldn't matter.Pokun wrote:but battery backed WRAM is also used, and besides it can still be used as normal work RAM no matter if it has a battery or not.
So if you want to use the cartridge RAM for both saves and extra work RAM, you need to either restrict usages to specific situations where you open the mapper for writes, or simple accept a higher risk of corrupted saves.
I'm not sure what actual licensed games historically did in these situations.
Ever since I learned that mappers like both MMC1 and MMC3 has write protection of the cartridge RAM, I've been wondering why games like Dragon Quest always reminds you of holding RESET when turning off power. Isn't the write protection enough?
- rainwarrior
- Posts: 7979
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Difference between RAM and cartridge SRAM?
I think the write protect registers are mostly just protection against software bugs, but the chaos of power-off had other ways to corrupt it.
I think later games have diodes on the board that help protect against the power-off problem. Like StarTropics doesn't give you any special power-off instructions, it just warns you not to switch off during the brief moment while the game is in-progress of a save.
I think later games have diodes on the board that help protect against the power-off problem. Like StarTropics doesn't give you any special power-off instructions, it just warns you not to switch off during the brief moment while the game is in-progress of a save.
Re: Difference between RAM and cartridge SRAM?
That write protection exists only in MMC1B or newer. Apart from that, I don't know if that protection flag is enough, if neccessary one could combine it with additional "analog" protections, like checking if VCC is higher than 3V.Pokun wrote:Ever since I learned that mappers like both MMC1 and MMC3 has write protection of the cartridge RAM, I've been wondering why games like Dragon Quest always reminds you of holding RESET when turning off power. Isn't the write protection enough?
Re: Difference between RAM and cartridge SRAM?
Was unable to view this thread coz of router login issue which got resolved with the help of 192.168.178.1 Admin Login, User, Password & IPguide. Okay so, SRAM is a memory chip that is faster and requires less power than DRAM. More costly than DRAM, SRAM is generally used by the computer as cache memory. ... DRAM is a memory chip that can hold more data than an SRAM chip, although it is slower and needs more power
Last edited by blocker1 on Sun Nov 17, 2019 10:28 pm, edited 1 time in total.
Re: Difference between RAM and cartridge SRAM?
rainwarrior wrote:I think the write protect registers are mostly just protection against software bugs, but the chaos of power-off had other ways to corrupt it.
I think later games have diodes on the board that help protect against the power-off problem. Like StarTropics doesn't give you any special power-off instructions, it just warns you not to switch off during the brief moment while the game is in-progress of a save.
I see, so the flag might not be reliable as the voltage drops.nocash wrote:That write protection exists only in MMC1B or newer. Apart from that, I don't know if that protection flag is enough, if neccessary one could combine it with additional "analog" protections, like checking if VCC is higher than 3V.Pokun wrote:Ever since I learned that mappers like both MMC1 and MMC3 has write protection of the cartridge RAM, I've been wondering why games like Dragon Quest always reminds you of holding RESET when turning off power. Isn't the write protection enough?
On the SNES they say it didn't have the hold-RESET requirement, but it sounds like protecting the cartridge memory is a job for the cartridge and have nothing to do with the console. Actraiser is the only SNES game that I remember to actually have the Dragon Quest-style "please hold RESET when turning off the system" kind of message when saving and quitting (it's an Enix game after all).
Re: Difference between RAM and cartridge SRAM?
I always assumed that MMC1 write protection was for the power-on state, rather than power-off. Since you can never predict when the user will cut the power, you'd have to disable the RAM all the time to keep it safe. Which seems totally useless.
There was another technology that's not in any game carts (AFAIK), but there were some chips that were a drop-in replacement for SRAM, but it was a combined SRAM and Flash. It would restore the SRAM contents on power-on, and save the SRAM contents automatically when the chip loses power. Seems to have died out and/or been a boutique part though.
Kind of interesting that they used it once in a fairly big release, then seemingly never used it again in any game carts (AFAIK). It must have been 256 bytes or something small. I remember in 2005 or so I briefly considered using FRAM in my Squeedo design before I understood it had read endurance. I'm not 100% sure but I want to say the price difference was something like $1.50 for 32kB SRAM, VS $10 for 8kB FRAM. Neat stuff, but too expensive, using Flash+SRAM made more sense than EPROM+FRAM.tepples wrote:Others are ferroelectric RAM (FeRAM), as used in Sonic the Hedgehog 3.
There was another technology that's not in any game carts (AFAIK), but there were some chips that were a drop-in replacement for SRAM, but it was a combined SRAM and Flash. It would restore the SRAM contents on power-on, and save the SRAM contents automatically when the chip loses power. Seems to have died out and/or been a boutique part though.