annotate romdb.h @ 905:b3b399665356

Don't try setting the window title on Android
author Michael Pavone <pavone@retrodev.com>
date Sat, 28 Nov 2015 14:49:34 -0800
parents cbf97d335444
children a5a51465f8b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
764
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #ifndef ROMDB_H_
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #define ROMDB_H_
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 #define REGION_J 1
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 #define REGION_U 2
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 #define REGION_E 4
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7
766
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
8 #define RAM_FLAG_ODD 0x18
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
9 #define RAM_FLAG_EVEN 0x10
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
10 #define RAM_FLAG_BOTH 0x00
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
11 #define RAM_FLAG_MASK RAM_FLAG_ODD
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
12 #define SAVE_I2C 0x01
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
13 #define SAVE_NONE 0xFF
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
14
764
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 #include "tern.h"
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 #include "backend.h"
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 typedef struct {
769
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
19 uint32_t start;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
20 uint32_t end;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
21 uint16_t sda_write_mask;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
22 uint16_t scl_mask;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
23 uint8_t sda_read_bit;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
24 } eeprom_map;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
25
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
26 typedef struct {
770
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
27 char *buffer;
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
28 uint32_t size;
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
29 uint16_t address;
769
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
30 uint8_t host_sda;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
31 uint8_t slave_sda;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
32 uint8_t scl;
770
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
33 uint8_t state;
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
34 uint8_t counter;
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
35 uint8_t latch;
769
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
36 } eeprom_state;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
37
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
38 typedef struct {
766
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
39 char *name;
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
40 memmap_chunk *map;
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
41 uint8_t *save_buffer;
769
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
42 eeprom_map *eeprom_map;
4638b88bc72d Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents: 767
diff changeset
43 uint32_t num_eeprom;
766
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
44 uint32_t map_chunks;
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
45 uint32_t save_size;
767
ea525f600b1d SRAM detection from ROM header is no working correctly again
Michael Pavone <pavone@retrodev.com>
parents: 766
diff changeset
46 uint32_t save_mask;
776
cbf97d335444 Full support for Sega mapper when it comes to data. Code in remapped sections may not work reliably. SSF2 now works.
Michael Pavone <pavone@retrodev.com>
parents: 770
diff changeset
47 uint16_t mapper_start_index;
766
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
48 uint8_t save_type;
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
49 uint8_t regions;
764
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 } rom_info;
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 tern_node *load_rom_db();
766
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
53 rom_info configure_rom(tern_node *rom_db, void *vrom, uint32_t rom_size, memmap_chunk const *base_map, uint32_t base_chunks);
1b2f8280ba81 WIP changes to support reading cart memory map from ROM DB
Michael Pavone <pavone@retrodev.com>
parents: 765
diff changeset
54 rom_info configure_rom_heuristics(uint8_t *rom, uint32_t rom_size, memmap_chunk const *base_map, uint32_t base_chunks);
765
dc54387ee1cd Allow regions to be set in ROM DB. Prefer default region if it is one of the valid regions for the ROM.
Michael Pavone <pavone@retrodev.com>
parents: 764
diff changeset
55 uint8_t translate_region_char(uint8_t c);
770
a3b90f746dcf Broken EEPROM support
Michael Pavone <pavone@retrodev.com>
parents: 769
diff changeset
56 void eeprom_init(eeprom_state *state, uint8_t *buffer, uint32_t size);
764
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57
bb60259e8edf Initial work on ROM database
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 #endif //ROMDB_H_