2 // This file is part of the Cyclone 68000 Emulator
\r
4 // Copyright (c) 2004,2011 FinalDave (emudave (at) gmail.com)
\r
5 // Copyright (c) 2005-2011 GraÅžvydas "notaz" Ignotas (notasas (at) gmail.com)
\r
7 // This code is licensed under the GNU General Public License version 2.0 and the MAME License.
\r
8 // You can choose the license that has the most advantages for you.
\r
10 // SVN repository can be found at http://code.google.com/p/cyclone68000/
\r
19 #define CONFIG_FILE "config.h"
\r
21 #include CONFIG_FILE
\r
24 #include "Disa/Disa.h"
\r
28 earwt_sign_extend = 1,
\r
31 earwt_msb_dont_care,
\r
34 extern int earead_check_addrerr;
\r
35 extern int eawrite_check_addrerr;
\r
36 extern int g_jmp_cycle_table[];
\r
37 extern int g_jsr_cycle_table[];
\r
38 extern int g_lea_cycle_table[];
\r
39 extern int g_pea_cycle_table[];
\r
40 extern int g_movem_cycle_table[];
\r
41 int Ea_add_ns(int *tab, int ea); // add nonstandard EA cycles
\r
42 int EaCalc(int a,int mask,int ea,int size,EaRWType type=earwt_sign_extend); // 6
\r
43 int EaRead(int a,int v,int ea,int size,int mask,EaRWType type=earwt_sign_extend,int set_nz=0); // 8
\r
44 int EaCalcRead(int r_ea,int r,int ea,int size,int mask,EaRWType type=earwt_sign_extend,int set_nz=0); // 7
\r
45 int EaCanRead(int ea,int size);
\r
46 int EaWrite(int a,int v,int ea,int size,int mask,EaRWType type=earwt_sign_extend);
\r
47 int EaCanWrite(int ea);
\r
51 extern int *CyJump; // Jump table
\r
52 extern int ms; // If non-zero, output in Microsoft ARMASM format
\r
53 extern const char * const Narm[4]; // Normal ARM Extensions for operand sizes 0,1,2
\r
54 extern const char * const Sarm[4]; // Sign-extend ARM Extensions for operand sizes 0,1,2
\r
55 extern int Cycles; // Current cycles for opcode
\r
56 extern int pc_dirty; // something changed PC during processing
\r
57 extern int arm_op_count; // for stats
\r
58 void ot(const char *format, ...)
\r
60 __attribute__((format(printf, 1, 2)));
\r
64 int MemHandler(int type,int size,int addrreg=0,int need_addrerr_check=1);
\r
65 void FlushPC(int force=0);
\r
69 extern int opend_op_changes_cycles, opend_check_interrupt, opend_check_trace;
\r
70 int OpGetFlags(int subtract,int xbit,int sprecialz=0);
\r
71 void OpGetFlagsNZ(int rd);
\r
72 void SignExtend(int rd, int rs, int size);
\r
73 void ZeroExtend(int rd, int rs, int size);
\r
74 void OpUse(int op,int use);
\r
75 void OpStart(int op,int sea=0,int tea=0,int op_changes_cycles=0,int supervisor_check=0);
\r
76 void OpEnd(int sea=0,int tea=0);
\r
77 int OpBase(int op,int size,int sepa=0);
\r
80 //----------------------
\r
82 int OpArith(int op);
\r
85 int OpArithReg(int op);
\r
89 int OpAritha(int op);
\r
91 int OpCmpEor(int op);
\r
94 int GetXBit(int subtract);
\r
98 void OpPushSr(int high);
\r
100 int OpLink(int op);
\r
101 int OpUnlk(int op);
\r
102 int Op4E70(int op);
\r
104 int OpBranch(int op);
\r
105 int OpDbra(int op);
\r
108 int OpBtstReg(int op);
\r
109 int OpBtstImm(int op);
\r
111 int OpSwap(int op);
\r
116 int OpAsrEa(int op);
\r
117 int OpTas(int op, int gen_special=0);
\r
118 const char *TestCond(int m68k_cc, int invert=0);
\r
121 int OpMove(int op);
\r
123 void OpFlagsToReg(int high);
\r
124 void OpRegToFlags(int high,int srh_reg=0);
\r
125 int OpMoveSr(int op);
\r
126 int OpArithSr(int op);
\r
128 int OpMovem(int op);
\r
129 int OpMoveq(int op);
\r
130 int OpMoveUsp(int op);
\r
132 int OpMovep(int op);
\r
133 int OpStopReset(int op);
\r
134 void SuperEnd(void);
\r
135 void SuperChange(int op,int srh_reg=-1);
\r