X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsms.c;fp=pico%2Fsms.c;h=a7a0f8f1f3bc35b07f18992f6b3523c9b716128b;hb=3e49ffd0bf13f3a889cfb5196c2a61962dff6d0b;hp=0000000000000000000000000000000000000000;hpb=d8f51995c466282c7c93f3666b1bc54b827ec19e;p=picodrive.git diff --git a/pico/sms.c b/pico/sms.c new file mode 100644 index 0000000..a7a0f8f --- /dev/null +++ b/pico/sms.c @@ -0,0 +1,55 @@ +#include "pico_int.h" + +static unsigned char z80_sms_in(unsigned short p) +{ + elprintf(EL_ANOMALY, "Z80 port %04x read", p); + return 0xff; +} + +static void z80_sms_out(unsigned short p, unsigned char d) +{ + elprintf(EL_ANOMALY, "Z80 port %04x write %02x", p, d); +} + +static unsigned char MEMH_FUNC xread(unsigned short a) +{ + elprintf(EL_ANOMALY, "Z80 read [%04x]", a); + return 0; +} + +static void MEMH_FUNC xwrite(unsigned int a, unsigned char data) +{ + elprintf(EL_ANOMALY, "Z80 write [%04x] %02x", a, data); +} + +void PicoPowerMS(void) +{ +} + +void PicoMemSetupMS(void) +{ + z80_map_set(z80_read_map, 0x0000, 0xbfff, Pico.rom, 0); + z80_map_set(z80_read_map, 0xc000, 0xdfff, Pico.zram, 0); + z80_map_set(z80_read_map, 0xe000, 0xffff, xread, 1); + + z80_map_set(z80_write_map, 0x0000, 0xbfff, Pico.rom, 0); + z80_map_set(z80_write_map, 0xc000, 0xdfff, Pico.zram, 0); + z80_map_set(z80_write_map, 0xe000, 0xffff, xwrite, 1); + +#ifdef _USE_DRZ80 + drZ80.z80_in = z80_sms_in; + drZ80.z80_out = z80_sms_out; +#endif +#ifdef _USE_CZ80 + Cz80_Set_Fetch(&CZ80, 0x0000, 0xbfff, (UINT32)Pico.rom); + Cz80_Set_Fetch(&CZ80, 0xc000, 0xdfff, (UINT32)Pico.zram); + Cz80_Set_INPort(&CZ80, z80_sms_in); + Cz80_Set_OUTPort(&CZ80, z80_sms_out); +#endif +} + +void PicoFrameMS(void) +{ + z80_run(OSC_NTSC / 13 / 60); +} +