--- hatari/src/includes/m68000.h 2019/04/01 07:10:55 1.1.1.5 +++ hatari/src/includes/m68000.h 2019/04/01 07:11:30 1.1.1.6 @@ -8,16 +8,40 @@ #ifndef HATARI_M68000_H #define HATARI_M68000_H -extern unsigned long ExceptionVector; +#include "sound.h" /* for SoundCycles */ +#include "sysdeps.h" +#include "memory.h" +#include "newcpu.h" /* for regs */ + +#define Regs regs.regs /* Ugly hack to glue the WinSTon sources to the UAE CPU core. */ +#define SR regs.sr /* Don't forget to call MakeFromSR() and MakeSR() */ + + +extern void *PendingInterruptFunction; +extern short int PendingInterruptCount; + extern Uint32 BusAddressLocation; extern Uint32 BusErrorPC; -extern Uint16 BusErrorOpcode; +extern BOOL bBusErrorReadWrite; + + +/*-----------------------------------------------------------------------*/ +/* + Add CPU cycles. + NOTE: All times are rounded up to nearest 4 cycles. +*/ +static inline void M68000_AddCycles(int cycles) +{ + cycles = (cycles + 3) & ~3; + PendingInterruptCount -= cycles; + SoundCycles += cycles; +} extern void M68000_Reset(BOOL bCold); extern void M68000_MemorySnapShot_Capture(BOOL bSave); -extern void M68000_Decode_MemorySnapShot_Capture(BOOL bSave); -extern void M68000_BusError(unsigned long addr); +extern void M68000_BusError(unsigned long addr, BOOL bReadWrite); extern void M68000_AddressError(unsigned long addr); -extern void M68000_Exception(void); +extern void M68000_Exception(Uint32 ExceptionVector); +extern void M68000_WaitState(void); #endif