--- hatari/src/uae-cpu/newcpu.h 2019/04/01 07:11:37 1.1.1.7 +++ hatari/src/uae-cpu/newcpu.h 2019/04/01 07:13:47 1.1.1.10 @@ -16,6 +16,7 @@ #include "readcpu.h" #include "m68k.h" +#include "memory.h" /* Special flags */ @@ -56,8 +57,8 @@ #define COPY_CARRY (SET_XFLG (GET_CFLG)) #endif -extern int areg_byteinc[]; -extern int imm8_table[]; +extern const int areg_byteinc[]; +extern const int imm8_table[]; extern int movem_index1[256]; extern int movem_index2[256]; @@ -152,9 +153,9 @@ STATIC_INLINE uaecptr m68k_getpc_p (uae_ return regs.pc + ((char *)p - (char *)regs.pc_oldp); } -#define get_ibyte(o) do_get_mem_byte((uae_u8 *)(regs.pc_p + (o) + 1)) -#define get_iword(o) do_get_mem_word((uae_u16 *)(regs.pc_p + (o))) -#define get_ilong(o) do_get_mem_long((uae_u32 *)(regs.pc_p + (o))) +#define get_ibyte(o) do_get_mem_byte(regs.pc_p + (o) + 1) +#define get_iword(o) do_get_mem_word(regs.pc_p + (o)) +#define get_ilong(o) do_get_mem_long(regs.pc_p + (o)) STATIC_INLINE void refill_prefetch (uae_u32 currpc, uae_u32 offs) { @@ -166,7 +167,7 @@ STATIC_INLINE void refill_prefetch (uae_ r = *(uae_u32 *)ptr; regs.prefetch = r; #else - r = do_get_mem_long ((uae_u32 *)ptr); + r = do_get_mem_long (ptr); do_put_mem_long (®s.prefetch, r); #endif /* printf ("PC %lx T %lx PCPOFFS %d R %lx\n", currpc, t, pc_p_offs, r); */ @@ -199,7 +200,7 @@ STATIC_INLINE uae_u32 get_iword_prefetch refill_prefetch (currpc, o); offs = addr - regs.prefetch_pc; } - v = do_get_mem_word ((uae_u16 *)(((uae_u8 *)®s.prefetch) + offs)); + v = do_get_mem_word (((uae_u8 *)®s.prefetch) + offs); if (offs >= 2) refill_prefetch (currpc, 2); /* printf ("get_iword PC %lx ADDR %lx OFFS %lx V %lx\n", currpc, addr, offs, v); */ @@ -310,6 +311,8 @@ extern void fbcc_opp (uae_u32, uaecptr, extern void fsave_opp (uae_u32); extern void frestore_opp (uae_u32); +extern int getDivu68kCycles (uae_u32 dividend, uae_u16 divisor); +extern int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor); /* Opcode of faulting instruction */ extern uae_u16 last_op_for_exception_3; @@ -321,20 +324,23 @@ extern uaecptr last_fault_for_exception_ #define CPU_OP_NAME(a) op ## a /* 68040 */ -extern struct cputbl op_smalltbl_0_ff[]; +extern const struct cputbl op_smalltbl_0_ff[]; /* 68020 + 68881 */ -extern struct cputbl op_smalltbl_1_ff[]; +extern const struct cputbl op_smalltbl_1_ff[]; /* 68020 */ -extern struct cputbl op_smalltbl_2_ff[]; +extern const struct cputbl op_smalltbl_2_ff[]; /* 68010 */ -extern struct cputbl op_smalltbl_3_ff[]; +extern const struct cputbl op_smalltbl_3_ff[]; /* 68000 */ -extern struct cputbl op_smalltbl_4_ff[]; +extern const struct cputbl op_smalltbl_4_ff[]; /* 68000 slow but compatible. */ -extern struct cputbl op_smalltbl_5_ff[]; +extern const struct cputbl op_smalltbl_5_ff[]; extern cpuop_func *cpufunctbl[65536]; -extern uae_u32 reg_caar, reg_cacr; +extern uae_u32 caar, cacr; + +/* Family of the latest instruction executed (to check for pairing) */ +extern int OpcodeFamily; /* see instrmnem in readcpu.h */ #endif /* UAE_NEWCPU_H */