diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-02-03 11:05:40 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-02-03 11:05:40 -0800 |
commit | d69482b7a3e0a3af3558f37a8a4fbd294308571b (patch) | |
tree | a9575d5f664c94e3b3b7154c0a0ac69b8c97ffca /z80_util.c | |
parent | 822f91d0a3dd99351d881868f780058949099ffe (diff) |
Get new Z80 core running in CPM harness
Diffstat (limited to 'z80_util.c')
-rw-r--r-- | z80_util.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -13,8 +13,34 @@ void z80_write_8(z80_context *context) void z80_io_read8(z80_context *context) { + uint32_t tmp_mask = context->opts->gen.address_mask; + memmap_chunk const *tmp_map = context->opts->gen.memmap; + uint32_t tmp_chunks = context->opts->gen.memmap_chunks; + + context->opts->gen.address_mask = context->io_mask; + context->opts->gen.memmap = context->io_map; + context->opts->gen.memmap_chunks = context->io_chunks; + + context->scratch1 = read_byte(context->scratch1, NULL, &context->opts->gen, context); + + context->opts->gen.address_mask = tmp_mask; + context->opts->gen.memmap = tmp_map; + context->opts->gen.memmap_chunks = tmp_chunks; } void z80_io_write8(z80_context *context) { + uint32_t tmp_mask = context->opts->gen.address_mask; + memmap_chunk const *tmp_map = context->opts->gen.memmap; + uint32_t tmp_chunks = context->opts->gen.memmap_chunks; + + context->opts->gen.address_mask = context->io_mask; + context->opts->gen.memmap = context->io_map; + context->opts->gen.memmap_chunks = context->io_chunks; + + write_byte(context->scratch2, context->scratch1, NULL, &context->opts->gen, context); + + context->opts->gen.address_mask = tmp_mask; + context->opts->gen.memmap = tmp_map; + context->opts->gen.memmap_chunks = tmp_chunks; }
\ No newline at end of file |