comparison romdb.h @ 1444:14a2834d010c

Save/restore mapper state in native save states
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Aug 2017 18:15:00 -0700
parents 11ac0b511cff
children a763523dadf4 1f745318f10a
comparison
equal deleted inserted replaced
1443:93c1b056ccdd 1444:14a2834d010c
12 #define SAVE_I2C 0x01 12 #define SAVE_I2C 0x01
13 #define SAVE_NOR 0x02 13 #define SAVE_NOR 0x02
14 #define SAVE_NONE 0xFF 14 #define SAVE_NONE 0xFF
15 15
16 #include "tern.h" 16 #include "tern.h"
17 #include "serialize.h"
17 18
18 typedef struct { 19 typedef struct {
19 uint32_t start; 20 uint32_t start;
20 uint32_t end; 21 uint32_t end;
21 uint16_t sda_write_mask; 22 uint16_t sda_write_mask;
34 uint8_t mode; 35 uint8_t mode;
35 uint8_t cmd_state; 36 uint8_t cmd_state;
36 uint8_t alt_cmd; 37 uint8_t alt_cmd;
37 uint8_t bus_flags; 38 uint8_t bus_flags;
38 } nor_state; 39 } nor_state;
40
41 enum {
42 MAPPER_NONE,
43 MAPPER_SEGA,
44 MAPPER_REALTEC,
45 MAPPER_XBAND,
46 MAPPER_MULTI_GAME
47 };
39 48
40 49
41 typedef struct rom_info rom_info; 50 typedef struct rom_info rom_info;
42 51
43 #include "backend.h" 52 #include "backend.h"
60 uint32_t save_page_size; 69 uint32_t save_page_size;
61 uint16_t save_product_id; 70 uint16_t save_product_id;
62 uint16_t mapper_start_index; 71 uint16_t mapper_start_index;
63 uint8_t save_type; 72 uint8_t save_type;
64 uint8_t save_bus; //only used for NOR currently 73 uint8_t save_bus; //only used for NOR currently
74 uint8_t mapper_type;
65 uint8_t regions; 75 uint8_t regions;
66 uint8_t is_save_lock_on; //Does the save buffer actually belong to a lock-on cart? 76 uint8_t is_save_lock_on; //Does the save buffer actually belong to a lock-on cart?
67 }; 77 };
68 78
69 #define GAME_ID_OFF 0x183 79 #define GAME_ID_OFF 0x183
75 uint8_t translate_region_char(uint8_t c); 85 uint8_t translate_region_char(uint8_t c);
76 char const *save_type_name(uint8_t save_type); 86 char const *save_type_name(uint8_t save_type);
77 //Note: free_rom_info only frees things pointed to by a rom_info struct, not the struct itself 87 //Note: free_rom_info only frees things pointed to by a rom_info struct, not the struct itself
78 //this is because rom_info structs are typically stack allocated 88 //this is because rom_info structs are typically stack allocated
79 void free_rom_info(rom_info *info); 89 void free_rom_info(rom_info *info);
90 void cart_serialize(system_header *sys, serialize_buffer *buf);
91 void cart_deserialize(deserialize_buffer *buf, void *vcontext);
80 92
81 #endif //ROMDB_H_ 93 #endif //ROMDB_H_