X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fz80if.c;h=5efeff894d34d1499718021f26542d3156c1eb6d;hb=c13c91cd04513cc6c0d12e9714a5952607323333;hp=d6dbfb86f90e726a9fff9cb3b3c46066d4cf17ec;hpb=cf82669f5072028f623a4b92516c74947040e563;p=picodrive.git diff --git a/pico/z80if.c b/pico/z80if.c index d6dbfb8..5efeff8 100644 --- a/pico/z80if.c +++ b/pico/z80if.c @@ -1,3 +1,11 @@ +/* + * PicoDrive + * (C) notaz, 2007-2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ + #include #include "pico_int.h" #include "memory.h" @@ -113,8 +121,8 @@ static int z80_unpack_legacy(const void *data) } #elif defined(_USE_CZ80) if (*(int *)data == 0x00007a43) { // "Cz" save? - memcpy(&CZ80, data+8, offsetof(cz80_struc, BasePC)); - Cz80_Set_Reg(&CZ80, CZ80_PC, *(int *)(data+4)); + memcpy(&CZ80, (int*)data+8, offsetof(cz80_struc, BasePC)); + Cz80_Set_Reg(&CZ80, CZ80_PC, *(int *)((int*)data+4)); return 0; } #endif @@ -156,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); @@ -215,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);