From ca8b001b7ffb5141ff6b684cdacf1f8241acbdaa Mon Sep 17 00:00:00 2001 From: kub Date: Wed, 23 Jun 2021 19:13:54 +0200 Subject: [PATCH] z80, fix cz80 CPU reset (most regs not touched by reset) --- cpu/cz80/cz80.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index 7f432bda..82de13f8 100644 --- a/cpu/cz80/cz80.c +++ b/cpu/cz80/cz80.c @@ -211,7 +211,8 @@ void Cz80_Init(cz80_struc *CPU) void Cz80_Reset(cz80_struc *CPU) { - memset(CPU, 0, (FPTR)&CPU->BasePC - (FPTR)CPU); + // I, R, CPU and interrupts logic is reset, registers are untouched + memset(&CPU->R, 0, (FPTR)&CPU->BasePC - (FPTR)&CPU->R); Cz80_Set_Reg(CPU, CZ80_PC, 0); } -- 2.39.5