Hello, I was wondering if anyone had any sample code (either using libdragon or just low-level C code) for reading/writing data to/from cartridge SRAM/EEPROM/whatever its called on the Nintendo 64. Thanks in advance if so. - Jason
EEPROM, SRAM, and FLASH are all very different. EEPROM is accessed the same way as you'd read the controller, but SRAM and FLASH require PI I/O. So, first question is how much memory do you need for saving?
The most possibly available. If there is an option in the 128KB range that would be good, but I don't know if there is. I know Memory Pak is 32KB and I've already started to target that.
Not sure if this will help Source: http://themanbehindcurtain.blogspot.de/2013/08/n64-sramflashram-results.html Sadly I could not find any contact info on his site, he is a member on assemblergames though http://www.assemblergames.com/forum...cartridge-savegames-to-a-64drive-everdrive-64
you can use this code for writing to sram :> i would recommend to set the game-ID to some sram 256 game, so the LUT autosets it for you. https://github.com/parasyte/alt64/blob/master/utils.c https://github.com/parasyte/alt64/blob/master/sram.c [TABLE="class: highlight tab-size-8 js-file-line-container"] [TR] [TD="class: blob-num js-line-number, align: right"][/TD] [TD="class: blob-code js-file-line"]int getSRAM32( uint8_t *buffer);[/TD] [/TR] [TR] [TD="class: blob-num js-line-number, align: right"][/TD] [TD="class: blob-code js-file-line"][/TD] [/TR] [TR] [TD="class: blob-num js-line-number, align: right"][/TD] [TD="class: blob-code js-file-line"]int setSRAM32( uint8_t *buffer);[/TD] [/TR] [/TABLE]
I found "hkz-libn64" which has a filesystem-style wrapper around FlashRAM access for saving data. Going to give it a shot.