From: notaz Date: Fri, 30 May 2008 13:51:19 +0000 (+0000) Subject: changed EI handling a bit and types X-Git-Tag: v1.85~479 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c299a73848342a745422a2e1980ed7fcf7960f26;p=picodrive.git changed EI handling a bit and types git-svn-id: file:///home/notaz/opt/svn/PicoDrive@471 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index 18fd620e..20e8053f 100644 --- a/cpu/cz80/cz80.c +++ b/cpu/cz80/cz80.c @@ -242,6 +242,7 @@ INT32 Cz80_Exec(cz80_struc *CPU, INT32 cycles) UINT32 res; UINT32 val; int afterEI = 0; + union16 *data; PC = CPU->PC; #if CZ80_ENCRYPTED_ROM @@ -255,7 +256,8 @@ INT32 Cz80_Exec(cz80_struc *CPU, INT32 cycles) Cz80_Exec: if (CPU->ICount > 0) { - union16 *data = pzHL; +Cz80_Exec_nocheck: + data = pzHL; Opcode = READ_OP(); #if CZ80_EMULATE_R_EXACTLY zR++; diff --git a/cpu/cz80/cz80.h b/cpu/cz80/cz80.h index d23d7936..4e846423 100644 --- a/cpu/cz80/cz80.h +++ b/cpu/cz80/cz80.h @@ -24,7 +24,7 @@ extern "C" { #endif #ifndef INT8 -#define INT8 char +#define INT8 signed char #endif #ifndef UINT16 @@ -32,7 +32,7 @@ extern "C" { #endif #ifndef INT16 -#define INT16 short +#define INT16 signed short #endif #ifndef UINT32 @@ -40,7 +40,7 @@ extern "C" { #endif #ifndef INT32 -#define INT32 int +#define INT32 signed int #endif /*************************************/ diff --git a/cpu/cz80/cz80_op.c b/cpu/cz80/cz80_op.c index a4a5ef9b..8691452e 100644 --- a/cpu/cz80/cz80_op.c +++ b/cpu/cz80/cz80_op.c @@ -715,13 +715,9 @@ OP_EI: CPU->ExtraCycles += 1 - CPU->ICount; CPU->ICount = 1; } - else if (CPU->ICount <= 0) - { - CPU->ICount = 1; - } } else zIFF2 = (1 << 2); - goto Cz80_Exec; + goto Cz80_Exec_nocheck; /*----------------------------------------- INC r16