Improve save types

This commit is contained in:
Robin Jones 2023-03-12 23:46:19 +00:00
parent 56158ba5f7
commit 828c2416d0
3 changed files with 22 additions and 10 deletions

View File

@ -45,6 +45,7 @@ Save it to the root folder on your SD card.
`4` = SRAM_BANKED `4` = SRAM_BANKED
`5` = SRAM_128K `5` = SRAM_128K
`6` = FLASHRAM `6` = FLASHRAM
~~`15` = CART_HEADER~~
### ED64 ### ED64

View File

@ -33,11 +33,16 @@ uint8_t rom_db_match_save_type(uint16_t id, uint32_t crc) {
// SRAM // SRAM
"AL", "AY", "A2", "DA", "FZ", "GP", "G6", "K4", "KG", "MF", "OB", "RE", "RI", "TE", "VB", "VP", "AL", "AY", "A2", "DA", "FZ", "GP", "G6", "K4", "KG", "MF", "OB", "RE", "RI", "TE", "VB", "VP",
"WI", "W2", "WX", "WZ", "YW", "ZL", "WI", "W2", "WX", "WZ", "YW", "ZL",
// SRAM_BANKED
"DZ",
// SRAM_128K
// FLASHRAM // FLASHRAM
"AF", "CC", "CK", "DL", "DP", "JD", "JF", "KJ", "M6", "MQ", "P2", "P3", "PF", "PH", "PN", "PO", "AF", "CC", "CK", "DL", "DP", "JD", "JF", "KJ", "M6", "MQ", "P2", "P3", "PF", "PH", "PN", "PO",
"PS", "RH", "SI", "SQ", "T9", "W4", "ZS", "PS", "RH", "SI", "SQ", "T9", "W4", "ZS",
// SRAM_BANKED // Last entry
"DZ" "!!"
}; };
static int save_types[] = { static int save_types[] = {
// EEP4K // EEP4K
@ -54,11 +59,13 @@ uint8_t rom_db_match_save_type(uint16_t id, uint32_t crc) {
// SRAM // SRAM
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
// FLASHRAM
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
// SRAM_BANKED // SRAM_BANKED
0x05, 0x04,
// SRAM_128K
// FLASHRAM
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
// Last entry. // Last entry.
0xff 0xff
}; };
@ -70,8 +77,10 @@ uint8_t rom_db_match_save_type(uint16_t id, uint32_t crc) {
// i = i == 1 ? DB_SAVE_TYPE_EEPROM_4K : // i = i == 1 ? DB_SAVE_TYPE_EEPROM_4K :
// i == 2 ? DB_SAVE_TYPE_EEPROM_16K : // i == 2 ? DB_SAVE_TYPE_EEPROM_16K :
// i == 3 ? DB_SAVE_TYPE_SRAM : // i == 3 ? DB_SAVE_TYPE_SRAM :
// i == 4 ? DB_SAVE_TYPE_FLASHRAM : // i == 4 ? DB_SAVE_TYPE_SRAM_BANKED :
// i == 5 ? DB_SAVE_TYPE_SRAM_BANKED : // i == 5 ? DB_SAVE_TYPE_SRAM_128K :
// i == 6 ? DB_SAVE_TYPE_FLASHRAM :
// // i == 15 ? DB_SAVE_TYPE_CART_SPECIFIED :
// DB_SAVE_TYPE_NONE; // DB_SAVE_TYPE_NONE;
return i; return i;
} }

View File

@ -1,12 +1,14 @@
#include <stdint.h> #include <stdint.h>
// NOTE: these values are independent of flashcart / OS // NOTE: these values are independent of flashcart / OS
// But by default align to SC64.
#define DB_SAVE_TYPE_NONE 0x00 #define DB_SAVE_TYPE_NONE 0x00
#define DB_SAVE_TYPE_EEPROM_4K 0x01 #define DB_SAVE_TYPE_EEPROM_4K 0x01
#define DB_SAVE_TYPE_EEPROM_16K 0x02 #define DB_SAVE_TYPE_EEPROM_16K 0x02
#define DB_SAVE_TYPE_SRAM 0x03 #define DB_SAVE_TYPE_SRAM 0x03
#define DB_SAVE_TYPE_FLASHRAM 0x04 #define DB_SAVE_TYPE_SRAM_BANKED 0x04
#define DB_SAVE_TYPE_SRAM_BANKED 0x05 #define DB_SAVE_TYPE_SRAM_128K 0x05
#define DB_SAVE_TYPE_FLASHRAM 0x06
#define DB_SAVE_TYPE_CART_SPECIFIED 0x0f #define DB_SAVE_TYPE_CART_SPECIFIED 0x0f
uint8_t rom_db_match_save_type(uint16_t id, uint32_t crc); uint8_t rom_db_match_save_type(uint16_t id, uint32_t crc);