Mercurial > repos > blastem
comparison system.h @ 1140:4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 02 Jan 2017 21:46:26 -0800 |
parents | 928a65750345 |
children | 6b0da6021544 |
comparison
equal
deleted
inserted
replaced
1139:160e3f597cec | 1140:4490c9c12272 |
---|---|
3 #include <stdint.h> | 3 #include <stdint.h> |
4 #include "arena.h" | 4 #include "arena.h" |
5 #include "romdb.h" | 5 #include "romdb.h" |
6 | 6 |
7 typedef struct system_header system_header; | 7 typedef struct system_header system_header; |
8 typedef struct system_media system_media; | |
8 | 9 |
9 typedef enum { | 10 typedef enum { |
10 SYSTEM_UNKNOWN, | 11 SYSTEM_UNKNOWN, |
11 SYSTEM_GENESIS, | 12 SYSTEM_GENESIS, |
12 SYSTEM_SMS, | 13 SYSTEM_SMS, |
43 uint8_t save_state; | 44 uint8_t save_state; |
44 debugger_type debugger_type; | 45 debugger_type debugger_type; |
45 system_type type; | 46 system_type type; |
46 }; | 47 }; |
47 | 48 |
49 struct system_media { | |
50 void *buffer; | |
51 char *extension; | |
52 system_media *chain; | |
53 uint32_t size; | |
54 }; | |
55 | |
48 #define OPT_ADDRESS_LOG (1U << 31U) | 56 #define OPT_ADDRESS_LOG (1U << 31U) |
49 | 57 |
50 system_type detect_system_type(uint8_t *rom, long filesize); | 58 system_type detect_system_type(system_media *media); |
51 system_header *alloc_config_system(system_type stype, void *rom, uint32_t rom_size, void *lock_on, uint32_t lock_on_size, uint32_t opts, uint8_t force_region, rom_info *info_out); | 59 system_header *alloc_config_system(system_type stype, system_media *media, uint32_t opts, uint8_t force_region, rom_info *info_out); |
52 | 60 |
53 #endif //SYSTEM_H_ | 61 #endif //SYSTEM_H_ |