Mercurial > repos > blastem
annotate system.h @ 2487:2ea2f3aa5aa8
Remove dis.exe and zdis.exe from Windows builds due to silly antivirus false positives
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 15 Apr 2024 23:00:02 -0700 |
parents | cb62730d5c99 |
children |
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_ |
1690
319d90025d50
Implement serialization/deserialization in libretro build
Mike Pavone <pavone@retrodev.com>
parents:
1643
diff
changeset
|
3 #include <stddef.h> |
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
|
4 #include <stdint.h> |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
5 #include <stdio.h> |
2298
9d68799f945b
Added basic FLAC seek implementation and added support for FLAC tracks in CUE sheets
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
6 #include "flac.h" |
2438
bed4d3db8a3f
More flexible loading of Pico storyware assets
Michael Pavone <pavone@retrodev.com>
parents:
2428
diff
changeset
|
7 #include "zip.h" |
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
|
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 struct system_header system_header; |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
10 typedef struct system_media system_media; |
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
|
11 |
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 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
|
13 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
|
14 SYSTEM_GENESIS, |
1946 | 15 SYSTEM_GENESIS_PLAYER, |
1472
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
16 SYSTEM_SEGACD, |
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
|
17 SYSTEM_SMS, |
1946 | 18 SYSTEM_SMS_PLAYER, |
19 SYSTEM_JAGUAR, | |
2413
64cf80e683aa
Initial support for Colecovision emulation
Michael Pavone <pavone@retrodev.com>
parents:
2404
diff
changeset
|
20 SYSTEM_MEDIA_PLAYER, |
2428 | 21 SYSTEM_COLECOVISION, |
2459
cb62730d5c99
Initial work on Copera emulation
Michael Pavone <pavone@retrodev.com>
parents:
2438
diff
changeset
|
22 SYSTEM_PICO, |
cb62730d5c99
Initial work on Copera emulation
Michael Pavone <pavone@retrodev.com>
parents:
2438
diff
changeset
|
23 SYSTEM_COPERA |
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
|
24 } 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
|
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 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
|
27 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
|
28 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
|
29 } 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
|
30 |
2243
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
31 enum { |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
32 DEBUG_PLANE, |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
33 DEBUG_VRAM, |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
34 DEBUG_CRAM, |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
35 DEBUG_COMPOSITE, |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
36 DEBUG_OSCILLOSCOPE, |
2271
3ef80963c2a7
Fix stamp address mask and add WIP CD graphics debug view
Michael Pavone <pavone@retrodev.com>
parents:
2243
diff
changeset
|
37 DEBUG_CD_GRAPHICS, |
2243
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
38 NUM_DEBUG_TYPES |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
39 }; |
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
40 |
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
|
41 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
|
42 typedef uint16_t (*system_fun_r16)(system_header *); |
1149
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
43 typedef void (*system_str_fun)(system_header *, char *); |
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
44 typedef uint8_t (*system_str_fun_r8)(system_header *, char *); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
45 typedef void (*system_u32_fun)(system_header *, uint32_t); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
46 typedef void (*system_u8_fun)(system_header *, uint8_t); |
1433
c886c54d8cf1
Added save states to SMS emulation
Michael Pavone <pavone@retrodev.com>
parents:
1208
diff
changeset
|
47 typedef uint8_t (*system_u8_fun_r8)(system_header *, uint8_t); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
48 typedef void (*system_u8_u8_fun)(system_header *, uint8_t, uint8_t); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
49 typedef void (*system_mabs_fun)(system_header *, uint8_t, uint16_t, uint16_t); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
50 typedef void (*system_mrel_fun)(system_header *, uint8_t, int32_t, int32_t); |
1690
319d90025d50
Implement serialization/deserialization in libretro build
Mike Pavone <pavone@retrodev.com>
parents:
1643
diff
changeset
|
51 typedef uint8_t *(*system_ptrszt_fun_rptr8)(system_header *, size_t *); |
319d90025d50
Implement serialization/deserialization in libretro build
Mike Pavone <pavone@retrodev.com>
parents:
1643
diff
changeset
|
52 typedef void (*system_ptr8_sizet_fun)(system_header *, uint8_t *, size_t); |
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
|
53 |
1149
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
54 #include "arena.h" |
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
55 #include "romdb.h" |
2215
a8af8d898a7c
Fix windows build for real
Michael Pavone <pavone@retrodev.com>
parents:
2179
diff
changeset
|
56 typedef struct event_reader event_reader; |
1149
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
57 |
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
|
58 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
|
59 system_header *next_context; |
1149
6b0da6021544
Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents:
1140
diff
changeset
|
60 system_str_fun start_context; |
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
|
61 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
|
62 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
|
63 system_fun persist_save; |
1433
c886c54d8cf1
Added save states to SMS emulation
Michael Pavone <pavone@retrodev.com>
parents:
1208
diff
changeset
|
64 system_u8_fun_r8 load_state; |
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
|
65 system_fun request_exit; |
1208
95f5253e75c7
Implement soft reset in Genesis mode
Michael Pavone <pavone@retrodev.com>
parents:
1201
diff
changeset
|
66 system_fun soft_reset; |
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
|
67 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
|
68 system_fun_r16 get_open_bus_value; |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
69 system_u32_fun set_speed_percent; |
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
|
70 system_fun inc_debug_mode; |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
71 system_u8_u8_fun gamepad_down; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
72 system_u8_u8_fun gamepad_up; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
73 system_u8_u8_fun mouse_down; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
74 system_u8_u8_fun mouse_up; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
75 system_mabs_fun mouse_motion_absolute; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
76 system_mrel_fun mouse_motion_relative; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
77 system_u8_fun keyboard_down; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
78 system_u8_fun keyboard_up; |
1595
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
1583
diff
changeset
|
79 system_fun config_updated; |
1690
319d90025d50
Implement serialization/deserialization in libretro build
Mike Pavone <pavone@retrodev.com>
parents:
1643
diff
changeset
|
80 system_ptrszt_fun_rptr8 serialize; |
319d90025d50
Implement serialization/deserialization in libretro build
Mike Pavone <pavone@retrodev.com>
parents:
1643
diff
changeset
|
81 system_ptr8_sizet_fun deserialize; |
1909
508522f08e4d
Initial stab at VGM logging support
Michael Pavone <pavone@retrodev.com>
parents:
1690
diff
changeset
|
82 system_str_fun start_vgm_log; |
508522f08e4d
Initial stab at VGM logging support
Michael Pavone <pavone@retrodev.com>
parents:
1690
diff
changeset
|
83 system_fun stop_vgm_log; |
2243
0d1d5dccdd28
Initial implementation of oscilloscope debug view
Michael Pavone <pavone@retrodev.com>
parents:
2215
diff
changeset
|
84 system_u8_fun toggle_debug_view; |
1595
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
1583
diff
changeset
|
85 rom_info info; |
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
|
86 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
|
87 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
|
88 char *save_dir; |
2179
9a8dd4ba2753
Implement frame advance debugger command
Michael Pavone <pavone@retrodev.com>
parents:
2116
diff
changeset
|
89 int enter_debugger_frames; |
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
|
90 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
|
91 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
|
92 uint8_t save_state; |
1479
a568dca999b2
Fix genesis save state loading via Nuklear UI, sms probably still needs work
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
93 uint8_t delayed_load_slot; |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
1479
diff
changeset
|
94 uint8_t has_keyboard; |
1909
508522f08e4d
Initial stab at VGM logging support
Michael Pavone <pavone@retrodev.com>
parents:
1690
diff
changeset
|
95 uint8_t vgm_logging; |
1980
81df9aa2de9b
Less hacky run on audio thread mode
Michael Pavone <pavone@retrodev.com>
parents:
1946
diff
changeset
|
96 uint8_t force_release; |
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
|
97 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
|
98 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
|
99 }; |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
100 |
1472
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
101 typedef enum { |
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
102 MEDIA_CART, |
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
103 MEDIA_CDROM |
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
104 } media_type; |
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
105 |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
106 typedef enum { |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
107 TRACK_AUDIO, |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
108 TRACK_DATA |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
109 } track_type; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
110 |
2116
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
111 enum { |
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
112 SUBCODES_NONE, |
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
113 SUBCODES_RAW, |
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
114 SUBCODES_COOKED |
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
115 }; |
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
116 |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
117 typedef struct { |
2114
2449c88cea36
Enhance support for CUE files and add initial support for cdrdao TOC files
Michael Pavone <pavone@retrodev.com>
parents:
2089
diff
changeset
|
118 FILE *f; |
2298
9d68799f945b
Added basic FLAC seek implementation and added support for FLAC tracks in CUE sheets
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
119 flac_file *flac; |
2114
2449c88cea36
Enhance support for CUE files and add initial support for cdrdao TOC files
Michael Pavone <pavone@retrodev.com>
parents:
2089
diff
changeset
|
120 uint32_t file_offset; |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
121 uint32_t fake_pregap; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
122 uint32_t pregap_lba; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
123 uint32_t start_lba; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
124 uint32_t end_lba; |
2114
2449c88cea36
Enhance support for CUE files and add initial support for cdrdao TOC files
Michael Pavone <pavone@retrodev.com>
parents:
2089
diff
changeset
|
125 uint16_t sector_bytes; |
2089
0db3af42dd72
Fix some byte order stuff for audio tracks
Michael Pavone <pavone@retrodev.com>
parents:
2080
diff
changeset
|
126 uint8_t need_swap; |
2116
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
127 uint8_t has_subcodes; |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
128 track_type type; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
129 } track_info; |
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
130 |
2080 | 131 typedef uint8_t (*seek_fun)(system_media *media, uint32_t sector); |
2076
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
132 typedef uint8_t (*read_fun)(system_media *media, uint32_t offset); |
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
133 |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
134 struct system_media { |
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
135 void *buffer; |
1438
e2bd03ed3190
Allow reloading current ROM with a hotkey (default F5) and allow locking on a cartridge via menu
Michael Pavone <pavone@retrodev.com>
parents:
1433
diff
changeset
|
136 char *dir; |
1201
aee2177a1630
Use filename for game title in SMS mode
Michael Pavone <pavone@retrodev.com>
parents:
1149
diff
changeset
|
137 char *name; |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
138 char *extension; |
2404
6f8400ce7a0f
Fix reload of zipped and gzipped ROMS
Michael Pavone <pavone@retrodev.com>
parents:
2342
diff
changeset
|
139 char *orig_path; //Full path before splitting and any extension manipulation |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
140 system_media *chain; |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
141 track_info *tracks; |
2116
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
142 uint8_t *tmp_buffer; |
2438
bed4d3db8a3f
More flexible loading of Pico storyware assets
Michael Pavone <pavone@retrodev.com>
parents:
2428
diff
changeset
|
143 zip_file *zip; |
2076
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
144 seek_fun seek; |
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
145 read_fun read; |
2116
cd057d6fe030
Initial stab at subcode emulation
Michael Pavone <pavone@retrodev.com>
parents:
2114
diff
changeset
|
146 read_fun read_subcodes; |
2059
6399a776e981
Add basic support for BIN/CUE images
Michael Pavone <pavone@retrodev.com>
parents:
2053
diff
changeset
|
147 uint32_t num_tracks; |
2089
0db3af42dd72
Fix some byte order stuff for audio tracks
Michael Pavone <pavone@retrodev.com>
parents:
2080
diff
changeset
|
148 uint32_t cur_track; |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
149 uint32_t size; |
2076
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
150 uint32_t cur_sector; |
2342
9f0c67e5c50a
Implement CD-ROM data sector scrambling/descrambling
Michael Pavone <pavone@retrodev.com>
parents:
2298
diff
changeset
|
151 uint16_t cdrom_scramble_lsfr; |
1472
d2d637dbacfb
Change load_rom into load_media with some interface changes in preparation for CD support
Michael Pavone <pavone@retrodev.com>
parents:
1438
diff
changeset
|
152 media_type type; |
2076
3f29e2726522
Added basic support for ISO images for games that only have a data track
Michael Pavone <pavone@retrodev.com>
parents:
2059
diff
changeset
|
153 uint8_t in_fake_pregap; |
2298
9d68799f945b
Added basic FLAC seek implementation and added support for FLAC tracks in CUE sheets
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
154 uint8_t byte_storage[3]; |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
155 }; |
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
156 |
1113
45db303fc705
Restore 68K address logging functionality
Michael Pavone <pavone@retrodev.com>
parents:
1111
diff
changeset
|
157 #define OPT_ADDRESS_LOG (1U << 31U) |
45db303fc705
Restore 68K address logging functionality
Michael Pavone <pavone@retrodev.com>
parents:
1111
diff
changeset
|
158 |
1140
4490c9c12272
Detect system type from filename if header based methods fail. Allow overriding system type from command line.
Michael Pavone <pavone@retrodev.com>
parents:
1117
diff
changeset
|
159 system_type detect_system_type(system_media *media); |
1595
360d5bab199f
Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents:
1583
diff
changeset
|
160 system_header *alloc_config_system(system_type stype, system_media *media, uint32_t opts, uint8_t force_region); |
1946 | 161 system_header *alloc_config_player(system_type stype, event_reader *reader); |
1980
81df9aa2de9b
Less hacky run on audio thread mode
Michael Pavone <pavone@retrodev.com>
parents:
1946
diff
changeset
|
162 void system_request_exit(system_header *system, uint8_t force_release); |
2438
bed4d3db8a3f
More flexible loading of Pico storyware assets
Michael Pavone <pavone@retrodev.com>
parents:
2428
diff
changeset
|
163 void* load_media_subfile(const system_media *media, char *path, uint32_t *sizeout); |
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
|
164 |
2eb54e24914e
Mostly working changes to allow support for multiple emulated system types in main blastem program
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
165 #endif //SYSTEM_H_ |