1 |
william |
31 |
/* PCSX2 - PS2 Emulator for PCs |
2 |
|
|
* Copyright (C) 2002-2010 PCSX2 Dev Team |
3 |
|
|
* |
4 |
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms |
5 |
|
|
* of the GNU Lesser General Public License as published by the Free Software Found- |
6 |
|
|
* ation, either version 3 of the License, or (at your option) any later version. |
7 |
|
|
* |
8 |
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
9 |
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
10 |
|
|
* PURPOSE. See the GNU General Public License for more details. |
11 |
|
|
* |
12 |
|
|
* You should have received a copy of the GNU General Public License along with PCSX2. |
13 |
|
|
* If not, see <http://www.gnu.org/licenses/>. |
14 |
|
|
*/ |
15 |
|
|
#ifndef _R5900_OPCODETABLES_H |
16 |
|
|
#define _R5900_OPCODETABLES_H |
17 |
|
|
|
18 |
|
|
#include "Pcsx2Defs.h" |
19 |
|
|
|
20 |
|
|
// TODO : Move these into the OpcodeTables namespace |
21 |
|
|
extern void (*Int_COP2PrintTable[32])(); |
22 |
|
|
extern void (*Int_COP2BC2PrintTable[32])(); |
23 |
|
|
extern void (*Int_COP2SPECIAL1PrintTable[64])(); |
24 |
|
|
extern void (*Int_COP2SPECIAL2PrintTable[128])(); |
25 |
|
|
|
26 |
|
|
void COP2_BC2(); |
27 |
|
|
void COP2_SPECIAL(); |
28 |
|
|
void COP2_SPECIAL2(); |
29 |
|
|
void COP2_Unknown(); |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
namespace R5900 |
33 |
|
|
{ |
34 |
|
|
namespace Dynarec { |
35 |
|
|
namespace OpcodeImpl |
36 |
|
|
{ |
37 |
|
|
void recNULL(); |
38 |
|
|
void recUnknown(); |
39 |
|
|
void recMMI_Unknown(); |
40 |
|
|
void recCOP0_Unknown(); |
41 |
|
|
void recCOP1_Unknown(); |
42 |
|
|
|
43 |
|
|
void recCOP2(); |
44 |
|
|
|
45 |
|
|
void recCACHE(); |
46 |
|
|
void recPREF(); |
47 |
|
|
void recSYSCALL(); |
48 |
|
|
void recBREAK(); |
49 |
|
|
void recSYNC(); |
50 |
|
|
|
51 |
|
|
void recMFSA(); |
52 |
|
|
void recMTSA(); |
53 |
|
|
void recMTSAB(); |
54 |
|
|
void recMTSAH(); |
55 |
|
|
|
56 |
|
|
void recTGE(); |
57 |
|
|
void recTGEU(); |
58 |
|
|
void recTLT(); |
59 |
|
|
void recTLTU(); |
60 |
|
|
void recTEQ(); |
61 |
|
|
void recTNE(); |
62 |
|
|
void recTGEI(); |
63 |
|
|
void recTGEIU(); |
64 |
|
|
void recTLTI(); |
65 |
|
|
void recTLTIU(); |
66 |
|
|
void recTEQI(); |
67 |
|
|
void recTNEI(); |
68 |
|
|
|
69 |
|
|
} } |
70 |
|
|
|
71 |
|
|
/////////////////////////////////////////////////////////////////////////// |
72 |
|
|
// Encapsulates information about every opcode on the Emotion Engine and |
73 |
|
|
// it's many co-processors. |
74 |
|
|
struct OPCODE |
75 |
|
|
{ |
76 |
|
|
// Textual name of the instruction. |
77 |
|
|
const char Name[16]; |
78 |
|
|
|
79 |
|
|
// Number of cycles this instruction normally uses. |
80 |
|
|
u8 cycles; |
81 |
|
|
|
82 |
|
|
const OPCODE& (*getsubclass)(); |
83 |
|
|
|
84 |
|
|
// Process the instruction using the interpreter. |
85 |
|
|
// The action is performed immediately on the EE's cpu state. |
86 |
|
|
void (*interpret)(); |
87 |
|
|
|
88 |
|
|
// Generate recompiled code for this instruction, injected into |
89 |
|
|
// the current EErec block state. |
90 |
|
|
void (*recompile)(); |
91 |
|
|
|
92 |
|
|
// Generates a string representation of the instruction and it's parameters, |
93 |
|
|
// and pastes it into the given output parameter. |
94 |
|
|
void (*disasm)( std::string& output ); |
95 |
|
|
}; |
96 |
|
|
|
97 |
|
|
// Returns the current real instruction, as per the current cpuRegs settings. |
98 |
|
|
const OPCODE& GetCurrentInstruction(); |
99 |
|
|
|
100 |
|
|
namespace OpcodeTables |
101 |
|
|
{ |
102 |
|
|
using ::R5900::OPCODE; |
103 |
|
|
|
104 |
|
|
extern const OPCODE tbl_Standard[64]; |
105 |
|
|
|
106 |
|
|
/*extern const OPCODE Standard[64]; |
107 |
|
|
extern const OPCODE Special[64]; |
108 |
|
|
extern const OPCODE RegImm[32]; |
109 |
|
|
extern const OPCODE MMI[64]; |
110 |
|
|
extern const OPCODE MMI0[32]; |
111 |
|
|
extern const OPCODE MMI1[32]; |
112 |
|
|
extern const OPCODE MMI2[32]; |
113 |
|
|
extern const OPCODE MMI3[32]; |
114 |
|
|
|
115 |
|
|
extern const OPCODE COP0[32]; |
116 |
|
|
extern const OPCODE COP0_BC0[32]; |
117 |
|
|
extern const OPCODE COP0_C0[64]; |
118 |
|
|
|
119 |
|
|
extern const OPCODE COP1[32]; |
120 |
|
|
extern const OPCODE COP1_BC1[32]; |
121 |
|
|
extern const OPCODE COP1_S[64]; |
122 |
|
|
extern const OPCODE COP1_W[64];*/ |
123 |
|
|
} |
124 |
|
|
|
125 |
|
|
namespace Opcodes |
126 |
|
|
{ |
127 |
|
|
using ::R5900::OPCODE; |
128 |
|
|
|
129 |
|
|
const OPCODE& Class_SPECIAL(); |
130 |
|
|
const OPCODE& Class_REGIMM(); |
131 |
|
|
const OPCODE& Class_MMI(); |
132 |
|
|
const OPCODE& Class_MMI0(); |
133 |
|
|
const OPCODE& Class_MMI1(); |
134 |
|
|
const OPCODE& Class_MMI2(); |
135 |
|
|
const OPCODE& Class_MMI3(); |
136 |
|
|
|
137 |
|
|
const OPCODE& Class_COP0(); |
138 |
|
|
const OPCODE& Class_COP0_BC0(); |
139 |
|
|
const OPCODE& Class_COP0_C0(); |
140 |
|
|
|
141 |
|
|
const OPCODE& Class_COP1(); |
142 |
|
|
const OPCODE& Class_COP1_BC1(); |
143 |
|
|
const OPCODE& Class_COP1_S(); |
144 |
|
|
const OPCODE& Class_COP1_W(); |
145 |
|
|
} |
146 |
|
|
|
147 |
|
|
namespace OpcodeDisasm |
148 |
|
|
{ |
149 |
|
|
//**************************************************************** |
150 |
|
|
void Unknown( std::string& output ); |
151 |
|
|
void COP0_Unknown( std::string& output ); |
152 |
|
|
void COP1_Unknown( std::string& output ); |
153 |
|
|
void MMI_Unknown( std::string& output ); |
154 |
|
|
|
155 |
|
|
void COP2( std::string& output ); |
156 |
|
|
|
157 |
|
|
// **********************Standard Opcodes************************** |
158 |
|
|
void J( std::string& output ); |
159 |
|
|
void JAL( std::string& output ); |
160 |
|
|
void BEQ( std::string& output ); |
161 |
|
|
void BNE( std::string& output ); |
162 |
|
|
void BLEZ( std::string& output ); |
163 |
|
|
void BGTZ( std::string& output ); |
164 |
|
|
void ADDI( std::string& output ); |
165 |
|
|
void ADDIU( std::string& output ); |
166 |
|
|
void SLTI( std::string& output ); |
167 |
|
|
void SLTIU( std::string& output ); |
168 |
|
|
void ANDI( std::string& output ); |
169 |
|
|
void ORI( std::string& output ); |
170 |
|
|
void XORI( std::string& output ); |
171 |
|
|
void LUI( std::string& output ); |
172 |
|
|
void BEQL( std::string& output ); |
173 |
|
|
void BNEL( std::string& output ); |
174 |
|
|
void BLEZL( std::string& output ); |
175 |
|
|
void BGTZL( std::string& output ); |
176 |
|
|
void DADDI( std::string& output ); |
177 |
|
|
void DADDIU( std::string& output ); |
178 |
|
|
void LDL( std::string& output ); |
179 |
|
|
void LDR( std::string& output ); |
180 |
|
|
void LB( std::string& output ); |
181 |
|
|
void LH( std::string& output ); |
182 |
|
|
void LWL( std::string& output ); |
183 |
|
|
void LW( std::string& output ); |
184 |
|
|
void LBU( std::string& output ); |
185 |
|
|
void LHU( std::string& output ); |
186 |
|
|
void LWR( std::string& output ); |
187 |
|
|
void LWU( std::string& output ); |
188 |
|
|
void SB( std::string& output ); |
189 |
|
|
void SH( std::string& output ); |
190 |
|
|
void SWL( std::string& output ); |
191 |
|
|
void SW( std::string& output ); |
192 |
|
|
void SDL( std::string& output ); |
193 |
|
|
void SDR( std::string& output ); |
194 |
|
|
void SWR( std::string& output ); |
195 |
|
|
void CACHE( std::string& output ); |
196 |
|
|
void LWC1( std::string& output ); |
197 |
|
|
void PREF( std::string& output ); |
198 |
|
|
void LQC2( std::string& output ); |
199 |
|
|
void LD( std::string& output ); |
200 |
|
|
void SQC2( std::string& output ); |
201 |
|
|
void SD( std::string& output ); |
202 |
|
|
void LQ( std::string& output ); |
203 |
|
|
void SQ( std::string& output ); |
204 |
|
|
void SWC1( std::string& output ); |
205 |
|
|
//*****************end of standard opcodes********************** |
206 |
|
|
//********************SPECIAL OPCODES*************************** |
207 |
|
|
void SLL( std::string& output ); |
208 |
|
|
void SRL( std::string& output ); |
209 |
|
|
void SRA( std::string& output ); |
210 |
|
|
void SLLV( std::string& output ); |
211 |
|
|
void SRLV( std::string& output ); |
212 |
|
|
void SRAV( std::string& output ); |
213 |
|
|
void JR( std::string& output ); |
214 |
|
|
void JALR( std::string& output ); |
215 |
|
|
void SYSCALL( std::string& output ); |
216 |
|
|
void BREAK( std::string& output ); |
217 |
|
|
void SYNC( std::string& output ); |
218 |
|
|
void MFHI( std::string& output ); |
219 |
|
|
void MTHI( std::string& output ); |
220 |
|
|
void MFLO( std::string& output ); |
221 |
|
|
void MTLO( std::string& output ); |
222 |
|
|
void DSLLV( std::string& output ); |
223 |
|
|
void DSRLV( std::string& output ); |
224 |
|
|
void DSRAV( std::string& output ); |
225 |
|
|
void MULT( std::string& output ); |
226 |
|
|
void MULTU( std::string& output ); |
227 |
|
|
void DIV( std::string& output ); |
228 |
|
|
void DIVU( std::string& output ); |
229 |
|
|
void ADD( std::string& output ); |
230 |
|
|
void ADDU( std::string& output ); |
231 |
|
|
void SUB( std::string& output ); |
232 |
|
|
void SUBU( std::string& output ); |
233 |
|
|
void AND( std::string& output ); |
234 |
|
|
void OR( std::string& output ); |
235 |
|
|
void XOR( std::string& output ); |
236 |
|
|
void NOR( std::string& output ); |
237 |
|
|
void SLT( std::string& output ); |
238 |
|
|
void SLTU( std::string& output ); |
239 |
|
|
void DADD( std::string& output ); |
240 |
|
|
void DADDU( std::string& output ); |
241 |
|
|
void DSUB( std::string& output ); |
242 |
|
|
void DSUBU( std::string& output ); |
243 |
|
|
void TGE( std::string& output ); |
244 |
|
|
void TGEU( std::string& output ); |
245 |
|
|
void TLT( std::string& output ); |
246 |
|
|
void TLTU( std::string& output ); |
247 |
|
|
void TEQ( std::string& output ); |
248 |
|
|
void TNE( std::string& output ); |
249 |
|
|
void DSLL( std::string& output ); |
250 |
|
|
void DSRL( std::string& output ); |
251 |
|
|
void DSRA( std::string& output ); |
252 |
|
|
void DSLL32( std::string& output ); |
253 |
|
|
void DSRL32( std::string& output ); |
254 |
|
|
void DSRA32( std::string& output ); |
255 |
|
|
void MOVZ( std::string& output ); |
256 |
|
|
void MOVN( std::string& output ); |
257 |
|
|
void MFSA( std::string& output ); |
258 |
|
|
void MTSA( std::string& output ); |
259 |
|
|
//*******************END OF SPECIAL OPCODES************************ |
260 |
|
|
//***********************REGIMM OPCODES**************************** |
261 |
|
|
void BLTZ( std::string& output ); |
262 |
|
|
void BGEZ( std::string& output ); |
263 |
|
|
void BLTZL( std::string& output ); |
264 |
|
|
void BGEZL( std::string& output ); |
265 |
|
|
void TGEI( std::string& output ); |
266 |
|
|
void TGEIU( std::string& output ); |
267 |
|
|
void TLTI( std::string& output ); |
268 |
|
|
void TLTIU( std::string& output ); |
269 |
|
|
void TEQI( std::string& output ); |
270 |
|
|
void TNEI( std::string& output ); |
271 |
|
|
void BLTZAL( std::string& output ); |
272 |
|
|
void BGEZAL( std::string& output ); |
273 |
|
|
void BLTZALL( std::string& output ); |
274 |
|
|
void BGEZALL( std::string& output ); |
275 |
|
|
void MTSAB( std::string& output ); |
276 |
|
|
void MTSAH( std::string& output ); |
277 |
|
|
//*******************END OF REGIMM OPCODES*********************** |
278 |
|
|
//***********************MMI OPCODES***************************** |
279 |
|
|
void MADD( std::string& output ); |
280 |
|
|
void MADDU( std::string& output ); |
281 |
|
|
void PLZCW( std::string& output ); |
282 |
|
|
void MADD1( std::string& output ); |
283 |
|
|
void MADDU1( std::string& output ); |
284 |
|
|
void MFHI1( std::string& output ); |
285 |
|
|
void MTHI1( std::string& output ); |
286 |
|
|
void MFLO1( std::string& output ); |
287 |
|
|
void MTLO1( std::string& output ); |
288 |
|
|
void MULT1( std::string& output ); |
289 |
|
|
void MULTU1( std::string& output ); |
290 |
|
|
void DIV1( std::string& output ); |
291 |
|
|
void DIVU1( std::string& output ); |
292 |
|
|
void PMFHL( std::string& output ); |
293 |
|
|
void PMTHL( std::string& output ); |
294 |
|
|
void PSLLH( std::string& output ); |
295 |
|
|
void PSRLH( std::string& output ); |
296 |
|
|
void PSRAH( std::string& output ); |
297 |
|
|
void PSLLW( std::string& output ); |
298 |
|
|
void PSRLW( std::string& output ); |
299 |
|
|
void PSRAW( std::string& output ); |
300 |
|
|
//********************END OF MMI OPCODES*********************** |
301 |
|
|
//***********************MMI0 OPCODES************************** |
302 |
|
|
void PADDW( std::string& output ); |
303 |
|
|
void PSUBW( std::string& output ); |
304 |
|
|
void PCGTW( std::string& output ); |
305 |
|
|
void PMAXW( std::string& output ); |
306 |
|
|
void PADDH( std::string& output ); |
307 |
|
|
void PSUBH( std::string& output ); |
308 |
|
|
void PCGTH( std::string& output ); |
309 |
|
|
void PMAXH( std::string& output ); |
310 |
|
|
void PADDB( std::string& output ); |
311 |
|
|
void PSUBB( std::string& output ); |
312 |
|
|
void PCGTB( std::string& output ); |
313 |
|
|
void PADDSW( std::string& output ); |
314 |
|
|
void PSUBSW( std::string& output ); |
315 |
|
|
void PEXTLW( std::string& output ); |
316 |
|
|
void PPACW( std::string& output ); |
317 |
|
|
void PADDSH( std::string& output ); |
318 |
|
|
void PSUBSH( std::string& output ); |
319 |
|
|
void PEXTLH( std::string& output ); |
320 |
|
|
void PPACH( std::string& output ); |
321 |
|
|
void PADDSB( std::string& output ); |
322 |
|
|
void PSUBSB( std::string& output ); |
323 |
|
|
void PEXTLB( std::string& output ); |
324 |
|
|
void PPACB( std::string& output ); |
325 |
|
|
void PEXT5( std::string& output ); |
326 |
|
|
void PPAC5( std::string& output ); |
327 |
|
|
//******************END OF MMI0 OPCODES*********************** |
328 |
|
|
//*********************MMI1 OPCODES*************************** |
329 |
|
|
void PABSW( std::string& output ); |
330 |
|
|
void PCEQW( std::string& output ); |
331 |
|
|
void PMINW( std::string& output ); |
332 |
|
|
void PADSBH( std::string& output ); |
333 |
|
|
void PABSH( std::string& output ); |
334 |
|
|
void PCEQH( std::string& output ); |
335 |
|
|
void PMINH( std::string& output ); |
336 |
|
|
void PCEQB( std::string& output ); |
337 |
|
|
void PADDUW( std::string& output ); |
338 |
|
|
void PSUBUW( std::string& output ); |
339 |
|
|
void PEXTUW( std::string& output ); |
340 |
|
|
void PADDUH( std::string& output ); |
341 |
|
|
void PSUBUH( std::string& output ); |
342 |
|
|
void PEXTUH( std::string& output ); |
343 |
|
|
void PADDUB( std::string& output ); |
344 |
|
|
void PSUBUB( std::string& output ); |
345 |
|
|
void PEXTUB( std::string& output ); |
346 |
|
|
void QFSRV( std::string& output ); |
347 |
|
|
//*****************END OF MMI1 OPCODES*********************** |
348 |
|
|
//*********************MMI2 OPCODES************************** |
349 |
|
|
void PMADDW( std::string& output ); |
350 |
|
|
void PSLLVW( std::string& output ); |
351 |
|
|
void PSRLVW( std::string& output ); |
352 |
|
|
void PMSUBW( std::string& output ); |
353 |
|
|
void PMFHI( std::string& output ); |
354 |
|
|
void PMFLO( std::string& output ); |
355 |
|
|
void PINTH( std::string& output ); |
356 |
|
|
void PMULTW( std::string& output ); |
357 |
|
|
void PDIVW( std::string& output ); |
358 |
|
|
void PCPYLD( std::string& output ); |
359 |
|
|
void PMADDH( std::string& output ); |
360 |
|
|
void PHMADH( std::string& output ); |
361 |
|
|
void PAND( std::string& output ); |
362 |
|
|
void PXOR( std::string& output ); |
363 |
|
|
void PMSUBH( std::string& output ); |
364 |
|
|
void PHMSBH( std::string& output ); |
365 |
|
|
void PEXEH( std::string& output ); |
366 |
|
|
void PREVH( std::string& output ); |
367 |
|
|
void PMULTH( std::string& output ); |
368 |
|
|
void PDIVBW( std::string& output ); |
369 |
|
|
void PEXEW( std::string& output ); |
370 |
|
|
void PROT3W( std::string& output ); |
371 |
|
|
//********************END OF MMI2 OPCODES******************** |
372 |
|
|
//***********************MMI3 OPCODES************************ |
373 |
|
|
void PMADDUW( std::string& output ); |
374 |
|
|
void PSRAVW( std::string& output ); |
375 |
|
|
void PMTHI( std::string& output ); |
376 |
|
|
void PMTLO( std::string& output ); |
377 |
|
|
void PINTEH( std::string& output ); |
378 |
|
|
void PMULTUW( std::string& output ); |
379 |
|
|
void PDIVUW( std::string& output ); |
380 |
|
|
void PCPYUD( std::string& output ); |
381 |
|
|
void POR( std::string& output ); |
382 |
|
|
void PNOR( std::string& output ); |
383 |
|
|
void PEXCH( std::string& output ); |
384 |
|
|
void PCPYH( std::string& output ); |
385 |
|
|
void PEXCW( std::string& output ); |
386 |
|
|
//*********************END OF MMI3 OPCODES******************* |
387 |
|
|
//************************COP0 OPCODES*********************** |
388 |
|
|
void MFC0( std::string& output ); |
389 |
|
|
void MTC0( std::string& output ); |
390 |
|
|
void BC0F( std::string& output ); |
391 |
|
|
void BC0T( std::string& output ); |
392 |
|
|
void BC0FL( std::string& output ); |
393 |
|
|
void BC0TL( std::string& output ); |
394 |
|
|
void TLBR( std::string& output ); |
395 |
|
|
void TLBWI( std::string& output ); |
396 |
|
|
void TLBWR( std::string& output ); |
397 |
|
|
void TLBP( std::string& output ); |
398 |
|
|
void ERET( std::string& output ); |
399 |
|
|
void DI( std::string& output ); |
400 |
|
|
void EI( std::string& output ); |
401 |
|
|
//***********************END OF COP0************************* |
402 |
|
|
//**************COP1 - Floating Point Unit (FPU)************* |
403 |
|
|
void MFC1( std::string& output ); |
404 |
|
|
void CFC1( std::string& output ); |
405 |
|
|
void MTC1( std::string& output ); |
406 |
|
|
void CTC1( std::string& output ); |
407 |
|
|
void BC1F( std::string& output ); |
408 |
|
|
void BC1T( std::string& output ); |
409 |
|
|
void BC1FL( std::string& output ); |
410 |
|
|
void BC1TL( std::string& output ); |
411 |
|
|
void ADD_S( std::string& output ); |
412 |
|
|
void SUB_S( std::string& output ); |
413 |
|
|
void MUL_S( std::string& output ); |
414 |
|
|
void DIV_S( std::string& output ); |
415 |
|
|
void SQRT_S( std::string& output ); |
416 |
|
|
void ABS_S( std::string& output ); |
417 |
|
|
void MOV_S( std::string& output ); |
418 |
|
|
void NEG_S( std::string& output ); |
419 |
|
|
void RSQRT_S( std::string& output ); |
420 |
|
|
void ADDA_S( std::string& output ); |
421 |
|
|
void SUBA_S( std::string& output ); |
422 |
|
|
void MULA_S( std::string& output ); |
423 |
|
|
void MADD_S( std::string& output ); |
424 |
|
|
void MSUB_S( std::string& output ); |
425 |
|
|
void MADDA_S( std::string& output ); |
426 |
|
|
void MSUBA_S( std::string& output ); |
427 |
|
|
void CVT_W( std::string& output ); |
428 |
|
|
void MAX_S( std::string& output ); |
429 |
|
|
void MIN_S( std::string& output ); |
430 |
|
|
void C_F( std::string& output ); |
431 |
|
|
void C_EQ( std::string& output ); |
432 |
|
|
void C_LT( std::string& output ); |
433 |
|
|
void C_LE( std::string& output ); |
434 |
|
|
void CVT_S( std::string& output ); |
435 |
|
|
//**********************END OF COP1*********************** |
436 |
|
|
} |
437 |
|
|
|
438 |
|
|
namespace Interpreter { |
439 |
|
|
namespace OpcodeImpl |
440 |
|
|
{ |
441 |
|
|
using namespace ::R5900; |
442 |
|
|
|
443 |
|
|
void COP2(); |
444 |
|
|
|
445 |
|
|
void Unknown(); |
446 |
|
|
void MMI_Unknown(); |
447 |
|
|
void COP0_Unknown(); |
448 |
|
|
void COP1_Unknown(); |
449 |
|
|
|
450 |
|
|
// **********************Standard Opcodes************************** |
451 |
|
|
void J(); |
452 |
|
|
void JAL(); |
453 |
|
|
void BEQ(); |
454 |
|
|
void BNE(); |
455 |
|
|
void BLEZ(); |
456 |
|
|
void BGTZ(); |
457 |
|
|
void ADDI(); |
458 |
|
|
void ADDIU(); |
459 |
|
|
void SLTI(); |
460 |
|
|
void SLTIU(); |
461 |
|
|
void ANDI(); |
462 |
|
|
void ORI(); |
463 |
|
|
void XORI(); |
464 |
|
|
void LUI(); |
465 |
|
|
void BEQL(); |
466 |
|
|
void BNEL(); |
467 |
|
|
void BLEZL(); |
468 |
|
|
void BGTZL(); |
469 |
|
|
void DADDI(); |
470 |
|
|
void DADDIU(); |
471 |
|
|
void LDL(); |
472 |
|
|
void LDR(); |
473 |
|
|
void LB(); |
474 |
|
|
void LH(); |
475 |
|
|
void LWL(); |
476 |
|
|
void LW(); |
477 |
|
|
void LBU(); |
478 |
|
|
void LHU(); |
479 |
|
|
void LWR(); |
480 |
|
|
void LWU(); |
481 |
|
|
void SB(); |
482 |
|
|
void SH(); |
483 |
|
|
void SWL(); |
484 |
|
|
void SW(); |
485 |
|
|
void SDL(); |
486 |
|
|
void SDR(); |
487 |
|
|
void SWR(); |
488 |
|
|
void CACHE(); |
489 |
|
|
void LWC1(); |
490 |
|
|
void PREF(); |
491 |
|
|
void LQC2(); |
492 |
|
|
void LD(); |
493 |
|
|
void SQC2(); |
494 |
|
|
void SD(); |
495 |
|
|
void LQ(); |
496 |
|
|
void SQ(); |
497 |
|
|
void SWC1(); |
498 |
|
|
//*****************end of standard opcodes********************** |
499 |
|
|
//********************SPECIAL OPCODES*************************** |
500 |
|
|
void SLL(); |
501 |
|
|
void SRL(); |
502 |
|
|
void SRA(); |
503 |
|
|
void SLLV(); |
504 |
|
|
void SRLV(); |
505 |
|
|
void SRAV(); |
506 |
|
|
void JR(); |
507 |
|
|
void JALR(); |
508 |
|
|
void SYSCALL(); |
509 |
|
|
void BREAK(); |
510 |
|
|
void SYNC(); |
511 |
|
|
void MFHI(); |
512 |
|
|
void MTHI(); |
513 |
|
|
void MFLO(); |
514 |
|
|
void MTLO(); |
515 |
|
|
void DSLLV(); |
516 |
|
|
void DSRLV(); |
517 |
|
|
void DSRAV(); |
518 |
|
|
void MULT(); |
519 |
|
|
void MULTU(); |
520 |
|
|
void DIV(); |
521 |
|
|
void DIVU(); |
522 |
|
|
void ADD(); |
523 |
|
|
void ADDU(); |
524 |
|
|
void SUB(); |
525 |
|
|
void SUBU(); |
526 |
|
|
void AND(); |
527 |
|
|
void OR(); |
528 |
|
|
void XOR(); |
529 |
|
|
void NOR(); |
530 |
|
|
void SLT(); |
531 |
|
|
void SLTU(); |
532 |
|
|
void DADD(); |
533 |
|
|
void DADDU(); |
534 |
|
|
void DSUB(); |
535 |
|
|
void DSUBU(); |
536 |
|
|
void TGE(); |
537 |
|
|
void TGEU(); |
538 |
|
|
void TLT(); |
539 |
|
|
void TLTU(); |
540 |
|
|
void TEQ(); |
541 |
|
|
void TNE(); |
542 |
|
|
void DSLL(); |
543 |
|
|
void DSRL(); |
544 |
|
|
void DSRA(); |
545 |
|
|
void DSLL32(); |
546 |
|
|
void DSRL32(); |
547 |
|
|
void DSRA32(); |
548 |
|
|
void MOVZ(); |
549 |
|
|
void MOVN(); |
550 |
|
|
void MFSA(); |
551 |
|
|
void MTSA(); |
552 |
|
|
//*******************END OF SPECIAL OPCODES************************ |
553 |
|
|
//***********************REGIMM OPCODES**************************** |
554 |
|
|
void BLTZ(); |
555 |
|
|
void BGEZ(); |
556 |
|
|
void BLTZL(); |
557 |
|
|
void BGEZL(); |
558 |
|
|
void TGEI(); |
559 |
|
|
void TGEIU(); |
560 |
|
|
void TLTI(); |
561 |
|
|
void TLTIU(); |
562 |
|
|
void TEQI(); |
563 |
|
|
void TNEI(); |
564 |
|
|
void BLTZAL(); |
565 |
|
|
void BGEZAL(); |
566 |
|
|
void BLTZALL(); |
567 |
|
|
void BGEZALL(); |
568 |
|
|
void MTSAB(); |
569 |
|
|
void MTSAH(); |
570 |
|
|
//*******************END OF REGIMM OPCODES*********************** |
571 |
|
|
//***********************MMI OPCODES***************************** |
572 |
|
|
void MADD(); |
573 |
|
|
void MADDU(); |
574 |
|
|
void MADD1(); |
575 |
|
|
void MADDU1(); |
576 |
|
|
void MFHI1(); |
577 |
|
|
void MTHI1(); |
578 |
|
|
void MFLO1(); |
579 |
|
|
void MTLO1(); |
580 |
|
|
void MULT1(); |
581 |
|
|
void MULTU1(); |
582 |
|
|
void DIV1(); |
583 |
|
|
void DIVU1(); |
584 |
|
|
|
585 |
|
|
namespace MMI { |
586 |
|
|
void PLZCW(); |
587 |
|
|
void PMFHL(); |
588 |
|
|
void PMTHL(); |
589 |
|
|
void PSLLH(); |
590 |
|
|
void PSRLH(); |
591 |
|
|
void PSRAH(); |
592 |
|
|
void PSLLW(); |
593 |
|
|
void PSRLW(); |
594 |
|
|
void PSRAW(); |
595 |
|
|
//********************END OF MMI OPCODES*********************** |
596 |
|
|
//***********************MMI0 OPCODES************************** |
597 |
|
|
void PADDW(); |
598 |
|
|
void PSUBW(); |
599 |
|
|
void PCGTW(); |
600 |
|
|
void PMAXW(); |
601 |
|
|
void PADDH(); |
602 |
|
|
void PSUBH(); |
603 |
|
|
void PCGTH(); |
604 |
|
|
void PMAXH(); |
605 |
|
|
void PADDB(); |
606 |
|
|
void PSUBB(); |
607 |
|
|
void PCGTB(); |
608 |
|
|
void PADDSW(); |
609 |
|
|
void PSUBSW(); |
610 |
|
|
void PEXTLW(); |
611 |
|
|
void PPACW(); |
612 |
|
|
void PADDSH(); |
613 |
|
|
void PSUBSH(); |
614 |
|
|
void PEXTLH(); |
615 |
|
|
void PPACH(); |
616 |
|
|
void PADDSB(); |
617 |
|
|
void PSUBSB(); |
618 |
|
|
void PEXTLB(); |
619 |
|
|
void PPACB(); |
620 |
|
|
void PEXT5(); |
621 |
|
|
void PPAC5(); |
622 |
|
|
//******************END OF MMI0 OPCODES*********************** |
623 |
|
|
//*********************MMI1 OPCODES*************************** |
624 |
|
|
void PABSW(); |
625 |
|
|
void PCEQW(); |
626 |
|
|
void PMINW(); |
627 |
|
|
void PADSBH(); |
628 |
|
|
void PABSH(); |
629 |
|
|
void PCEQH(); |
630 |
|
|
void PMINH(); |
631 |
|
|
void PCEQB(); |
632 |
|
|
void PADDUW(); |
633 |
|
|
void PSUBUW(); |
634 |
|
|
void PEXTUW(); |
635 |
|
|
void PADDUH(); |
636 |
|
|
void PSUBUH(); |
637 |
|
|
void PEXTUH(); |
638 |
|
|
void PADDUB(); |
639 |
|
|
void PSUBUB(); |
640 |
|
|
void PEXTUB(); |
641 |
|
|
void QFSRV(); |
642 |
|
|
//*****************END OF MMI1 OPCODES*********************** |
643 |
|
|
//*********************MMI2 OPCODES************************** |
644 |
|
|
void PMADDW(); |
645 |
|
|
void PSLLVW(); |
646 |
|
|
void PSRLVW(); |
647 |
|
|
void PMSUBW(); |
648 |
|
|
void PMFHI(); |
649 |
|
|
void PMFLO(); |
650 |
|
|
void PINTH(); |
651 |
|
|
void PMULTW(); |
652 |
|
|
void PDIVW(); |
653 |
|
|
void PCPYLD(); |
654 |
|
|
void PMADDH(); |
655 |
|
|
void PHMADH(); |
656 |
|
|
void PAND(); |
657 |
|
|
void PXOR(); |
658 |
|
|
void PMSUBH(); |
659 |
|
|
void PHMSBH(); |
660 |
|
|
void PEXEH(); |
661 |
|
|
void PREVH(); |
662 |
|
|
void PMULTH(); |
663 |
|
|
void PDIVBW(); |
664 |
|
|
void PEXEW(); |
665 |
|
|
void PROT3W(); |
666 |
|
|
//********************END OF MMI2 OPCODES******************** |
667 |
|
|
//***********************MMI3 OPCODES************************ |
668 |
|
|
void PMADDUW(); |
669 |
|
|
void PSRAVW(); |
670 |
|
|
void PMTHI(); |
671 |
|
|
void PMTLO(); |
672 |
|
|
void PINTEH(); |
673 |
|
|
void PMULTUW(); |
674 |
|
|
void PDIVUW(); |
675 |
|
|
void PCPYUD(); |
676 |
|
|
void POR(); |
677 |
|
|
void PNOR(); |
678 |
|
|
void PEXCH(); |
679 |
|
|
void PCPYH(); |
680 |
|
|
void PEXCW(); |
681 |
|
|
} |
682 |
|
|
//**********************END OF MMI3 OPCODES******************** |
683 |
|
|
//*************************COP0 OPCODES************************ |
684 |
|
|
namespace COP0 { |
685 |
|
|
void MFC0(); |
686 |
|
|
void MTC0(); |
687 |
|
|
void BC0F(); |
688 |
|
|
void BC0T(); |
689 |
|
|
void BC0FL(); |
690 |
|
|
void BC0TL(); |
691 |
|
|
void TLBR(); |
692 |
|
|
void TLBWI(); |
693 |
|
|
void TLBWR(); |
694 |
|
|
void TLBP(); |
695 |
|
|
void ERET(); |
696 |
|
|
void DI(); |
697 |
|
|
void EI(); |
698 |
|
|
} |
699 |
|
|
//********************END OF COP0 OPCODES************************ |
700 |
|
|
//************COP1 OPCODES - Floating Point Unit***************** |
701 |
|
|
namespace COP1 { |
702 |
|
|
void MFC1(); |
703 |
|
|
void CFC1(); |
704 |
|
|
void MTC1(); |
705 |
|
|
void CTC1(); |
706 |
|
|
void BC1F(); |
707 |
|
|
void BC1T(); |
708 |
|
|
void BC1FL(); |
709 |
|
|
void BC1TL(); |
710 |
|
|
void ADD_S(); |
711 |
|
|
void SUB_S(); |
712 |
|
|
void MUL_S(); |
713 |
|
|
void DIV_S(); |
714 |
|
|
void SQRT_S(); |
715 |
|
|
void ABS_S(); |
716 |
|
|
void MOV_S(); |
717 |
|
|
void NEG_S(); |
718 |
|
|
void RSQRT_S(); |
719 |
|
|
void ADDA_S(); |
720 |
|
|
void SUBA_S(); |
721 |
|
|
void MULA_S(); |
722 |
|
|
void MADD_S(); |
723 |
|
|
void MSUB_S(); |
724 |
|
|
void MADDA_S(); |
725 |
|
|
void MSUBA_S(); |
726 |
|
|
void CVT_W(); |
727 |
|
|
void MAX_S(); |
728 |
|
|
void MIN_S(); |
729 |
|
|
void C_F(); |
730 |
|
|
void C_EQ(); |
731 |
|
|
void C_LT(); |
732 |
|
|
void C_LE(); |
733 |
|
|
void CVT_S(); |
734 |
|
|
} |
735 |
|
|
} } |
736 |
|
|
} // End namespace R5900 |
737 |
|
|
|
738 |
|
|
//**************************************************************************** |
739 |
|
|
//** COP2 - (VU0) ** |
740 |
|
|
//**************************************************************************** |
741 |
|
|
void QMFC2(); |
742 |
|
|
void CFC2(); |
743 |
|
|
void QMTC2(); |
744 |
|
|
void CTC2(); |
745 |
|
|
void BC2F(); |
746 |
|
|
void BC2T(); |
747 |
|
|
void BC2FL(); |
748 |
|
|
void BC2TL(); |
749 |
|
|
//*****************SPECIAL 1 VUO TABLE******************************* |
750 |
|
|
void VADDx(); |
751 |
|
|
void VADDy(); |
752 |
|
|
void VADDz(); |
753 |
|
|
void VADDw(); |
754 |
|
|
void VSUBx(); |
755 |
|
|
void VSUBy(); |
756 |
|
|
void VSUBz(); |
757 |
|
|
void VSUBw(); |
758 |
|
|
void VMADDx(); |
759 |
|
|
void VMADDy(); |
760 |
|
|
void VMADDz(); |
761 |
|
|
void VMADDw(); |
762 |
|
|
void VMSUBx(); |
763 |
|
|
void VMSUBy(); |
764 |
|
|
void VMSUBz(); |
765 |
|
|
void VMSUBw(); |
766 |
|
|
void VMAXx(); |
767 |
|
|
void VMAXy(); |
768 |
|
|
void VMAXz(); |
769 |
|
|
void VMAXw(); |
770 |
|
|
void VMINIx(); |
771 |
|
|
void VMINIy(); |
772 |
|
|
void VMINIz(); |
773 |
|
|
void VMINIw(); |
774 |
|
|
void VMULx(); |
775 |
|
|
void VMULy(); |
776 |
|
|
void VMULz(); |
777 |
|
|
void VMULw(); |
778 |
|
|
void VMULq(); |
779 |
|
|
void VMAXi(); |
780 |
|
|
void VMULi(); |
781 |
|
|
void VMINIi(); |
782 |
|
|
void VADDq(); |
783 |
|
|
void VMADDq(); |
784 |
|
|
void VADDi(); |
785 |
|
|
void VMADDi(); |
786 |
|
|
void VSUBq(); |
787 |
|
|
void VMSUBq(); |
788 |
|
|
void VSUBi(); |
789 |
|
|
void VMSUBi(); |
790 |
|
|
void VADD(); |
791 |
|
|
void VMADD(); |
792 |
|
|
void VMUL(); |
793 |
|
|
void VMAX(); |
794 |
|
|
void VSUB(); |
795 |
|
|
void VMSUB(); |
796 |
|
|
void VOPMSUB(); |
797 |
|
|
void VMINI(); |
798 |
|
|
void VIADD(); |
799 |
|
|
void VISUB(); |
800 |
|
|
void VIADDI(); |
801 |
|
|
void VIAND(); |
802 |
|
|
void VIOR(); |
803 |
|
|
void VCALLMS(); |
804 |
|
|
void VCALLMSR(); |
805 |
|
|
//***********************************END OF SPECIAL1 VU0 TABLE***************************** |
806 |
|
|
//******************************SPECIAL2 VUO TABLE***************************************** |
807 |
|
|
void VADDAx(); |
808 |
|
|
void VADDAy(); |
809 |
|
|
void VADDAz(); |
810 |
|
|
void VADDAw(); |
811 |
|
|
void VSUBAx(); |
812 |
|
|
void VSUBAy(); |
813 |
|
|
void VSUBAz(); |
814 |
|
|
void VSUBAw(); |
815 |
|
|
void VMADDAx(); |
816 |
|
|
void VMADDAy(); |
817 |
|
|
void VMADDAz(); |
818 |
|
|
void VMADDAw(); |
819 |
|
|
void VMSUBAx(); |
820 |
|
|
void VMSUBAy(); |
821 |
|
|
void VMSUBAz(); |
822 |
|
|
void VMSUBAw(); |
823 |
|
|
void VITOF0(); |
824 |
|
|
void VITOF4(); |
825 |
|
|
void VITOF12(); |
826 |
|
|
void VITOF15(); |
827 |
|
|
void VFTOI0(); |
828 |
|
|
void VFTOI4(); |
829 |
|
|
void VFTOI12(); |
830 |
|
|
void VFTOI15(); |
831 |
|
|
void VMULAx(); |
832 |
|
|
void VMULAy(); |
833 |
|
|
void VMULAz(); |
834 |
|
|
void VMULAw(); |
835 |
|
|
void VMULAq(); |
836 |
|
|
void VABS(); |
837 |
|
|
void VMULAi(); |
838 |
|
|
void VCLIPw(); |
839 |
|
|
void VADDAq(); |
840 |
|
|
void VMADDAq(); |
841 |
|
|
void VADDAi(); |
842 |
|
|
void VMADDAi(); |
843 |
|
|
void VSUBAq(); |
844 |
|
|
void VMSUBAq(); |
845 |
|
|
void VSUBAi(); |
846 |
|
|
void VMSUBAi(); |
847 |
|
|
void VADDA(); |
848 |
|
|
void VMADDA(); |
849 |
|
|
void VMULA(); |
850 |
|
|
void VSUBA(); |
851 |
|
|
void VMSUBA(); |
852 |
|
|
void VOPMULA(); |
853 |
|
|
void VNOP(); |
854 |
|
|
void VMOVE(); |
855 |
|
|
void VMR32(); |
856 |
|
|
void VLQI(); |
857 |
|
|
void VSQI(); |
858 |
|
|
void VLQD(); |
859 |
|
|
void VSQD(); |
860 |
|
|
void VDIV(); |
861 |
|
|
void VSQRT(); |
862 |
|
|
void VRSQRT(); |
863 |
|
|
void VWAITQ(); |
864 |
|
|
void VMTIR(); |
865 |
|
|
void VMFIR(); |
866 |
|
|
void VILWR(); |
867 |
|
|
void VISWR(); |
868 |
|
|
void VRNEXT(); |
869 |
|
|
void VRGET(); |
870 |
|
|
void VRINIT(); |
871 |
|
|
void VRXOR(); |
872 |
|
|
//*******************END OF SPECIAL2 ********************* |
873 |
|
|
|
874 |
|
|
#endif |