From ffbe30be2197b861c619e8dad9bf33e1497334ed Mon Sep 17 00:00:00 2001 From: redcode Date: Thu, 1 Dec 2022 12:21:42 +0100 Subject: [PATCH 1/2] Remove unneeded Z80 callbacks --- software/FusionX/src/driver/MZ700/z80driver.c | 47 ++++--------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/software/FusionX/src/driver/MZ700/z80driver.c b/software/FusionX/src/driver/MZ700/z80driver.c index 6ed61f9e5..797733323 100644 --- a/software/FusionX/src/driver/MZ700/z80driver.c +++ b/software/FusionX/src/driver/MZ700/z80driver.c @@ -622,12 +622,6 @@ static void z80_halt(void *context, zboolean state) } // Methods below are not yet implemented, Work In Progress! -static zuint8 z80_context(void *context, zuint16 address) -{ - Z_UNUSED(context) - printk("z80_context\n"); - return 0x00; -} static zuint8 z80_nmia(void *context, zuint16 address) { Z_UNUSED(context) @@ -646,32 +640,6 @@ static zuint8 z80_intFetch(void *context, zuint16 address) printk("z80_int_fetch\n"); return 0x00; } -static void z80_ldia(void *context) -{ - Z_UNUSED(context) - printk("z80_ldia\n"); -} -static void z80_ldra(void *context) -{ - Z_UNUSED(context) - printk("z80_ldra\n"); -} -static void z80_reti(void *context) -{ - Z_UNUSED(context) - printk("z80_reti\n"); -} -static void z80_retn(void *context) -{ - Z_UNUSED(context) - printk("z80_retn\n"); -} -static zuint8 z80_illegal(void *context, zuint8 opcode) -{ - Z_UNUSED(context) - printk("z80_illegal\n"); - return 0x00; -} // Z80 CPU Emulation Thread // ------------------------ @@ -1304,9 +1272,9 @@ static int __init ModuleInit(void) int ret = 0; // Setup the Z80 handlers. - Z80CPU.context = z80_context; - Z80CPU.fetch = z80_fetch; + Z80CPU.context = NULL; Z80CPU.fetch_opcode = z80_fetch_opcode; + Z80CPU.fetch = z80_fetch; Z80CPU.read = z80_read; Z80CPU.write = z80_write; Z80CPU.nop = z80_nop; @@ -1316,11 +1284,12 @@ static int __init ModuleInit(void) Z80CPU.nmia = z80_nmia; Z80CPU.inta = z80_inta; Z80CPU.int_fetch = z80_intFetch; - Z80CPU.ld_i_a = z80_ldia; - Z80CPU.ld_r_a = z80_ldra; - Z80CPU.reti = z80_reti; - Z80CPU.retn = z80_retn; - Z80CPU.illegal = z80_illegal; + Z80CPU.ld_i_a = NULL; + Z80CPU.ld_r_a = NULL; + Z80CPU.reti = NULL; + Z80CPU.retn = NULL; + Z80CPU.hook = NULL; + Z80CPU.illegal = NULL; mutex_init(&Z80DRV_MUTEX); From 37909eed59716cfe27b56481d9e681a42bbec2bc Mon Sep 17 00:00:00 2001 From: redcode Date: Thu, 1 Dec 2022 12:26:30 +0100 Subject: [PATCH 2/2] Configure the Z80 emulator as Zilog NMOS by default --- software/FusionX/src/driver/MZ700/z80driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/software/FusionX/src/driver/MZ700/z80driver.c b/software/FusionX/src/driver/MZ700/z80driver.c index 797733323..f1159cf18 100644 --- a/software/FusionX/src/driver/MZ700/z80driver.c +++ b/software/FusionX/src/driver/MZ700/z80driver.c @@ -1290,6 +1290,7 @@ static int __init ModuleInit(void) Z80CPU.retn = NULL; Z80CPU.hook = NULL; Z80CPU.illegal = NULL; + Z80CPU.options = Z80_MODEL_ZILOG_NMOS; mutex_init(&Z80DRV_MUTEX);