From c299a73848342a745422a2e1980ed7fcf7960f26 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 30 May 2008 13:51:19 +0000 Subject: [PATCH] changed EI handling a bit and types git-svn-id: file:///home/notaz/opt/svn/PicoDrive@471 be3aeb3a-fb24-0410-a615-afba39da0efa --- cpu/cz80/cz80.c | 4 +++- cpu/cz80/cz80.h | 6 +++--- cpu/cz80/cz80_op.c | 6 +----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index 18fd620..20e8053 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 d23d793..4e84642 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 a4a5ef9..8691452 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 -- 2.39.2