From: kub Date: Wed, 23 Jun 2021 17:13:54 +0000 (+0200) Subject: z80, fix cz80 CPU reset (most regs not touched by reset) X-Git-Tag: v2.00~507 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca8b001b7ffb5141ff6b684cdacf1f8241acbdaa;p=picodrive.git z80, fix cz80 CPU reset (most regs not touched by reset) --- 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); }