X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Fcz80%2Fcz80.c;h=18fd620eda7c6a53c17f5edfae642fc26b9f9d2a;hb=28d596af3666635348d797806779f7d69d65b4a4;hp=bcff740aca14b7aab90ae6116ce919ad485172b2;hpb=a4221917e147ba303f2cf6c09d12362bf2802084;p=picodrive.git diff --git a/cpu/cz80/cz80.c b/cpu/cz80/cz80.c index bcff740..18fd620 100644 --- a/cpu/cz80/cz80.c +++ b/cpu/cz80/cz80.c @@ -13,9 +13,21 @@ #include #include "cz80.h" +#if PICODRIVE_HACKS +#undef EMU_M68K +#include +#endif + #ifndef ALIGN_DATA +#ifdef _MSC_VER +#define ALIGN_DATA +#define inline +#undef CZ80_USE_JUMPTABLE +#define CZ80_USE_JUMPTABLE 0 +#else #define ALIGN_DATA __attribute__((aligned(4))) #endif +#endif #define CF 0x01 #define NF 0x02 @@ -203,6 +215,13 @@ void Cz80_Reset(cz80_struc *CPU) Cz80_Set_Reg(CPU, CZ80_PC, 0); } +/* */ +#if PICODRIVE_HACKS +static inline unsigned char picodrive_read(unsigned short a) +{ + return (a < 0x4000) ? Pico.zram[a&0x1fff] : z80_read(a); +} +#endif /*-------------------------------------------------------- CPUŽÀs @@ -248,7 +267,12 @@ Cz80_Exec: { afterEI = 0; Cz80_Check_Interrupt: - CHECK_INT + if (CPU->IRQState != CLEAR_LINE) + { + CHECK_INT + CPU->ICount -= CPU->ExtraCycles; + CPU->ExtraCycles = 0; + } goto Cz80_Exec; } }