--- hatari/src/uae-cpu/newcpu.h 2019/04/01 07:11:01 1.1.1.6 +++ hatari/src/uae-cpu/newcpu.h 2019/04/01 07:13:12 1.1.1.9 @@ -18,7 +18,7 @@ #include "m68k.h" -/* custom chip support */ +/* Special flags */ #define SPCFLAG_STOP 2 #define SPCFLAG_BUSERROR 4 #define SPCFLAG_INT 8 @@ -27,10 +27,11 @@ #define SPCFLAG_TRACE 0x40 #define SPCFLAG_DOTRACE 0x80 #define SPCFLAG_DOINT 0x100 -/*#define SPCFLAG_BLTNASTY 0x200 */ +#define SPCFLAG_MFP 0x200 #define SPCFLAG_EXEC 0x400 #define SPCFLAG_MODE_CHANGE 0x800 + #ifndef SET_CFLG #define SET_CFLG(x) (CFLG = (x)) @@ -55,8 +56,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]; @@ -66,7 +67,6 @@ extern int fpp_movem_index1[256]; extern int fpp_movem_index2[256]; extern int fpp_movem_next[256]; -extern int broken_in; typedef unsigned long cpuop_func (uae_u32) REGPARAM; @@ -152,9 +152,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 +166,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 +199,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,7 +310,6 @@ extern void fbcc_opp (uae_u32, uaecptr, extern void fsave_opp (uae_u32); extern void frestore_opp (uae_u32); -extern int lastInstructionCycles; /* Opcode of faulting instruction */ extern uae_u16 last_op_for_exception_3; @@ -322,18 +321,20 @@ 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; + #endif /* UAE_NEWCPU_H */