--- previous/src/includes/m68000.h 2018/04/24 19:25:10 1.1 +++ previous/src/includes/m68000.h 2018/04/24 19:30:35 1.1.1.3 @@ -105,8 +105,6 @@ enum { #define Regs regs.regs -#if defined(UAE_NEWCPU_H) - # define M68000_GetPC() m68k_getpc() # define M68000_SetPC(val) m68k_setpc(val) @@ -124,34 +122,13 @@ static inline void M68000_SetSR(Uint16 v # define M68000_SetSpecial(flags) set_special(flags) # define M68000_UnsetSpecial(flags) unset_special(flags) -#else /* following code is for WinUAE CPU: */ - -# define M68000_GetPC() m68k_getpc(®s) -# define M68000_SetPC(val) m68k_setpc(®s,val) - -static inline Uint16 M68000_GetSR(void) -{ - MakeSR(®s); - return regs.sr; -} -static inline void M68000_SetSR(Uint16 v) -{ - regs.sr = v; - MakeFromSR(®s); -} - -# define M68000_SetSpecial(flags) set_special(®s,flags) -# define M68000_UnsetSpecial(flags) unset_special(®s,flags) - -#endif /* defined(UAE_NEWCPU_H) */ - /* bus error mode */ #define BUS_ERROR_WRITE 0 #define BUS_ERROR_READ 1 -/* bus acces mode */ +/* bus access mode */ #define BUS_MODE_CPU 0 /* bus is owned by the cpu */ #define BUS_MODE_BLITTER 1 /* bus is owned by the blitter */ @@ -160,6 +137,8 @@ extern Uint32 BusErrorAddress; extern Uint32 BusErrorPC; extern bool bBusErrorReadWrite; extern int nCpuFreqShift; +extern int nCpuFreqDivider; +#define USE_FREQ_DIVIDER 1 extern int nWaitStateCycles; extern int BusMode; @@ -178,7 +157,11 @@ extern const char *OpcodeName[]; static inline void M68000_AddCycles(int cycles) { cycles = (cycles + 3) & ~3; - cycles = cycles >> nCpuFreqShift; +#if USE_FREQ_DIVIDER + cycles = cycles / nCpuFreqDivider; +#else + cycles = cycles >> nCpuFreqShift; +#endif PendingInterruptCount -= INT_CONVERT_TO_INTERNAL(cycles, INT_CPU_CYCLE); nCyclesMainCounter += cycles; @@ -269,9 +252,11 @@ static inline void M68000_AddCyclesWithP cycles += BusCyclePenalty; /* >0 if d8(an,ix) was used */ cycles = (cycles + 3) & ~3; /* no pairing, round current instr to 4 cycles */ } - +#if USE_FREQ_DIVIDER + cycles = cycles / nCpuFreqDivider; +#else cycles = cycles >> nCpuFreqShift; - +#endif PendingInterruptCount -= INT_CONVERT_TO_INTERNAL ( cycles , INT_CPU_CYCLE ); nCyclesMainCounter += cycles; @@ -281,8 +266,9 @@ static inline void M68000_AddCyclesWithP extern void M68000_Init(void); extern void M68000_Reset(bool bCold); +extern void M68000_Stop(void); extern void M68000_Start(void); -extern void M68000_CheckCpuLevel(void); +extern void M68000_CheckCpuSettings(void); extern void M68000_MemorySnapShot_Capture(bool bSave); extern void M68000_BusError(Uint32 addr, bool bReadWrite); extern void M68000_Exception(Uint32 ExceptionVector , int ExceptionSource);