Mercurial > repos > blastem
annotate system.h @ 1124:e4deab85f9ac
The function of the HVC Latch enable bit in mode register 1 is different when not in mode 5
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 27 Dec 2016 13:38:58 -0800 |
parents | 928a65750345 |
children | 4490c9c12272 |
rev | line source |
---|---|
1111
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef SYSTEM_H_ |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define SYSTEM_H_ |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 #include <stdint.h> |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include "arena.h" |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 #include "romdb.h" |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 typedef struct system_header system_header; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 typedef enum { |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 SYSTEM_UNKNOWN, |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 SYSTEM_GENESIS, |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 SYSTEM_SMS, |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 SYSTEM_JAGUAR |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } system_type; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 typedef enum { |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 DEBUGGER_NATIVE, |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 DEBUGGER_GDB |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } debugger_type; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 typedef void (*system_fun)(system_header *); |
1117
928a65750345
Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
1113
diff
changeset
|
22 typedef uint16_t (*system_fun_r16)(system_header *); |
1111
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 typedef void (*start_system_fun)(system_header *, char *); |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 typedef void (*speed_system_fun)(system_header *, uint32_t); |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 struct system_header { |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 system_header *next_context; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 start_system_fun start_context; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 system_fun resume_context; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 system_fun load_save; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 system_fun persist_save; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 system_fun request_exit; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 system_fun free_context; |
1117
928a65750345
Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
1113
diff
changeset
|
34 system_fun_r16 get_open_bus_value; |
1111
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 speed_system_fun set_speed_percent; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 system_fun inc_debug_mode; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 system_fun inc_debug_pal; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 arena *arena; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 char *next_rom; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 char *save_dir; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 uint8_t enter_debugger; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 uint8_t should_exit; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 uint8_t save_state; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 debugger_type debugger_type; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 system_type type; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 }; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 |
1113
45db303fc705
Restore 68K address logging functionality
Michael Pavone <pavone@retrodev.com>
parents:
1111
diff
changeset
|
48 #define OPT_ADDRESS_LOG (1U << 31U) |
45db303fc705
Restore 68K address logging functionality
Michael Pavone <pavone@retrodev.com>
parents:
1111
diff
changeset
|
49 |
1111
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 system_type detect_system_type(uint8_t *rom, long filesize); |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
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); |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 #endif //SYSTEM_H_ |