diff options
author | Michael Pavone <pavone@retrodev.com> | 2014-12-29 00:41:36 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2014-12-29 00:41:36 -0800 |
commit | dcaf14476d62f2d20420226b968156f14d394450 (patch) | |
tree | 5800ed6e8b6d000b2b2bdad3ad4d491ab56d20d2 /blastem.c | |
parent | 48c6f35700f1f985b36b56ced2683a7f8e622b37 (diff) |
Add support for Z80 access to VDP via bank area
Diffstat (limited to 'blastem.c')
-rw-r--r-- | blastem.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -732,7 +732,11 @@ uint8_t z80_read_bank(uint32_t location, void * vcontext) { z80_context * context = vcontext; uint32_t address = context->bank_reg << 15 | location; - fprintf(stderr, "Unhandled read by Z80 from address %X through banked memory area\n", address); + if (address >= 0xC00000 && address < 0xE00000) { + return z80_vdp_port_read(location & 0xFF, context); + } else { + fprintf(stderr, "Unhandled read by Z80 from address %X through banked memory area\n", address); + } return 0; } @@ -743,6 +747,8 @@ void *z80_write_bank(uint32_t location, void * vcontext, uint8_t value) if (address >= 0xE00000) { address &= 0xFFFF; ((uint8_t *)ram)[address ^ 1] = value; + } else if (address >= 0xC00000) { + z80_vdp_port_write(location & 0xFF, context, value); } else { fprintf(stderr, "Unhandled write by Z80 to address %X through banked memory area\n", address); } |