annotate sms.h @ 2521:8cf7cadc17ee

Initial SC-3000 support
author Michael Pavone <pavone@retrodev.com>
date Fri, 11 Oct 2024 00:46:53 -0700
parents 40290a923886
children 90a40be940f7
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"
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
14
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 #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
16 #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
17
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 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
19 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
20 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
21 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
22 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
23 sega_io io;
2521
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
24 i8255 *i8255;
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
25 uint16_t *keystate;
1141
7e199bebde2f Initial support for Sega's family of SMS mappers
Michael Pavone <pavone@retrodev.com>
parents: 1117
diff changeset
26 uint8_t *rom;
7e199bebde2f Initial support for Sega's family of SMS mappers
Michael Pavone <pavone@retrodev.com>
parents: 1117
diff changeset
27 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
28 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
29 uint32_t normal_clock;
2179
9a8dd4ba2753 Implement frame advance debugger command
Michael Pavone <pavone@retrodev.com>
parents: 1752
diff changeset
30 uint32_t last_frame;
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
31 uint8_t should_return;
2195
40290a923886 Implement Game Gear start button and region register
Michael Pavone <pavone@retrodev.com>
parents: 2179
diff changeset
32 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
33 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
34 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
35 uint8_t cart_ram[SMS_CART_RAM_SIZE];
2521
8cf7cadc17ee Initial SC-3000 support
Michael Pavone <pavone@retrodev.com>
parents: 2195
diff changeset
36 uint8_t kb_mux;
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
37 } 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
38
1595
360d5bab199f Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents: 1201
diff changeset
39 sms_context *alloc_configure_sms(system_media *media, 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
40
928a65750345 Initial support for Genesis/Megadrive PBC mode. VDP still needs Mode 4 to be useful.
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 #endif //SMS_H_