annotate sms.h @ 2688:b42f00a3a937 default tip

Fix default target. Ensure m68k.h and z80.h are built before anything else when no dep info is available
author Michael Pavone <pavone@retrodev.com>
date Mon, 31 Mar 2025 21:06:18 -0700
parents c768bbd912f1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #ifndef SMS_H_
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #define SMS_H_
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 #include "system.h"
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 #include "vdp.h"
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 #include "psg.h"
1752
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
7 #ifdef NEW_CORE
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
8 #include "z80.h"
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
9 #else
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 #include "z80_to_x86.h"
1752
d6d4c006a7b3 Initial attempt at interrupts in new Z80 core and integrating it into main executable
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
11 #endif
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 #include "io.h"
2521
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
13 #include "i8255.h"
2528
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
14 #include "wave.h"
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 #define SMS_RAM_SIZE (8*1024)
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: 1141
diff changeset
17 #define SMS_CART_RAM_SIZE (32*1024)
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 typedef struct {
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 system_header header;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 z80_context *z80;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 vdp_context *vdp;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 psg_context *psg;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 sega_io io;
2521
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
25 i8255 *i8255;
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
26 uint16_t *keystate;
1141
7e199bebde2f Initial support for Sega's family of SMS mappers
Michael Pavone <pavone@retrodev.com>
parents: 1117
diff changeset
27 uint8_t *rom;
2528
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
28 system_media *cassette;
1141
7e199bebde2f Initial support for Sega's family of SMS mappers
Michael Pavone <pavone@retrodev.com>
parents: 1117
diff changeset
29 uint32_t rom_size;
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 uint32_t master_clock;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 uint32_t normal_clock;
2179
9a8dd4ba2753 Implement frame advance debugger command
Michael Pavone <pavone@retrodev.com>
parents: 1752
diff changeset
32 uint32_t last_frame;
2532
f4a471730ba4 Implement clipboard paste for SC-3000
Michael Pavone <pavone@retrodev.com>
parents: 2528
diff changeset
33 uint32_t last_paste_cycle;
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 uint8_t should_return;
2195
40290a923886 Implement Game Gear start button and region register
Michael Pavone <pavone@retrodev.com>
parents: 2179
diff changeset
35 uint8_t start_button_region;
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36 uint8_t ram[SMS_RAM_SIZE];
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: 1141
diff changeset
37 uint8_t bank_regs[4];
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: 1141
diff changeset
38 uint8_t cart_ram[SMS_CART_RAM_SIZE];
2521
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
39 uint8_t kb_mux;
2532
f4a471730ba4 Implement clipboard paste for SC-3000
Michael Pavone <pavone@retrodev.com>
parents: 2528
diff changeset
40 uint8_t paste_toggle;
2535
0c6519125a28 Implement paste support for box drawing chars and Latin-1 character Æ
Michael Pavone <pavone@retrodev.com>
parents: 2532
diff changeset
41 uint8_t paste_state;
2528
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
42 uint8_t cassette_state;
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
43 uint32_t cassette_offset;
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
44 uint32_t cassette_cycle;
90a40be940f7 Implement read-only SC-3000 cassette support
Michael Pavone <pavone@retrodev.com>
parents: 2521
diff changeset
45 wave_header cassette_wave;
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 } sms_context;
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47
2604
c768bbd912f1 Give sega 8-bit consoles separate system_type enum values and allow selecting them from the command line
Michael Pavone <pavone@retrodev.com>
parents: 2535
diff changeset
48 sms_context *alloc_configure_sms(system_media *media, system_type stype, uint32_t opts, uint8_t force_region);
1117
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 #endif //SMS_H_