From 83b1fb32799d32d8bc94ffa676742c778302e85a Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 28 Jul 2013 19:27:25 +0300 Subject: [PATCH] drz80: fix flag saving --- cpu/DrZ80/drz80.h | 4 ++-- pico/z80if.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/DrZ80/drz80.h b/cpu/DrZ80/drz80.h index e4156104..708f0a98 100644 --- a/cpu/DrZ80/drz80.h +++ b/cpu/DrZ80/drz80.h @@ -34,7 +34,7 @@ struct DrZ80 { unsigned int Z80PC; /*0x00 - PC Program Counter (Memory Base + PC) */ unsigned int Z80A; /*0x04 - A Register: 0xAA------ */ - unsigned int Z80F; /*0x08 - F Register: 0xFF------ */ + unsigned int Z80F; /*0x08 - F Register: 0x------FF */ unsigned int Z80BC; /*0x0C - BC Registers: 0xBBCC---- */ unsigned int Z80DE; /*0x10 - DE Registers: 0xDDEE---- */ unsigned int Z80HL; /*0x14 - HL Registers: 0xHHLL---- */ @@ -45,7 +45,7 @@ struct DrZ80 unsigned int Z80IY; /*0x28 - IY Index Register */ unsigned int Z80I; /*0x2C - I Interrupt Register */ unsigned int Z80A2; /*0x30 - A' Register: 0xAA------ */ - unsigned int Z80F2; /*0x34 - F' Register: 0xFF------ */ + unsigned int Z80F2; /*0x34 - F' Register: 0x------FF */ unsigned int Z80BC2; /*0x38 - B'C' Registers: 0xBBCC---- */ unsigned int Z80DE2; /*0x3C - D'E' Registers: 0xDDEE---- */ unsigned int Z80HL2; /*0x40 - H'L' Registers: 0xHHLL---- */ diff --git a/pico/z80if.c b/pico/z80if.c index cb0fa9b1..8db4aa5c 100644 --- a/pico/z80if.c +++ b/pico/z80if.c @@ -164,11 +164,11 @@ void z80_pack(void *data) #define DRR16(n) (drZ80.Z80##n >> 16) #define DRR16H(n) (drZ80.Z80##n >> 24) #define DRR16L(n) ((drZ80.Z80##n >> 16) & 0xff) - s->m.a = DRR8(A); s->m.f = DRR8(F); + s->m.a = DRR8(A); s->m.f = drZ80.Z80F; s->m.b = DRR16H(BC); s->m.c = DRR16L(BC); s->m.d = DRR16H(DE); s->m.e = DRR16L(DE); s->m.h = DRR16H(HL); s->m.l = DRR16L(HL); - s->a.a = DRR8(A2); s->a.f = DRR8(F2); + s->a.a = DRR8(A2); s->a.f = drZ80.Z80F2; s->a.b = DRR16H(BC2); s->a.c = DRR16L(BC2); s->a.d = DRR16H(DE2); s->a.e = DRR16L(DE2); s->a.h = DRR16H(HL2); s->a.l = DRR16L(HL2); @@ -223,11 +223,11 @@ int z80_unpack(const void *data) #define DRW8(n, v) drZ80.Z80##n = (u32)(v) << 24 #define DRW16(n, v) drZ80.Z80##n = (u32)(v) << 16 #define DRW16HL(n, h, l) drZ80.Z80##n = ((u32)(h) << 24) | ((u32)(l) << 16) - DRW8(A, s->m.a); DRW8(F, s->m.f); + DRW8(A, s->m.a); drZ80.Z80F = s->m.f; DRW16HL(BC, s->m.b, s->m.c); DRW16HL(DE, s->m.d, s->m.e); DRW16HL(HL, s->m.h, s->m.l); - DRW8(A2, s->a.a); DRW8(F2, s->a.f); + DRW8(A2, s->a.a); drZ80.Z80F2 = s->a.f; DRW16HL(BC2, s->a.b, s->a.c); DRW16HL(DE2, s->a.d, s->a.e); DRW16HL(HL2, s->a.h, s->a.l); -- 2.39.5