/[pcsx2_0.9.7]/trunk/pcsx2/DebugTools/DisVU0Micro.cpp
ViewVC logotype

Contents of /trunk/pcsx2/DebugTools/DisVU0Micro.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 10 months ago) by william
File size: 3552 byte(s)
committing r3113 initial commit again...
1 /* 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
16
17 #include "PrecompiledHeader.h"
18
19 #include "Debug.h"
20
21 static char ostr[1024];
22
23 // Type deffinition of our functions
24 #define DisFInterface (u32 code, u32 pc)
25 #define DisFInterfaceT (u32, u32)
26 #define DisFInterfaceN (code, pc)
27
28 typedef char* (*TdisR5900F)DisFInterface;
29
30 // These macros are used to assemble the disassembler functions
31 #define MakeDisF(fn, b) \
32 char* fn DisFInterface { \
33 sprintf (ostr, "%8.8x %8.8x:", pc, code); \
34 b; /*ostr[(strlen(ostr) - 1)] = 0;*/ return ostr; \
35 }
36
37 //Lower/Upper instructions can use that..
38 #define _Ft_ ((code >> 16) & 0x1F) // The rt part of the instruction register
39 #define _Fs_ ((code >> 11) & 0x1F) // The rd part of the instruction register
40 #define _Fd_ ((code >> 6) & 0x1F) // The sa part of the instruction register
41 #define _It_ (_Ft_ & 15)
42 #define _Is_ (_Fs_ & 15)
43 #define _Id_ (_Fd_ & 15)
44
45 #define dName(i) sprintf(ostr, "%s %-7s,", ostr, i)
46 #define dNameU(i) { char op[256]; sprintf(op, "%s.%s%s%s%s", i, _X ? "x" : "", _Y ? "y" : "", _Z ? "z" : "", _W ? "w" : ""); sprintf(ostr, "%s %-7s,", ostr, op); }
47
48
49 #define dCP2128f(i) sprintf(ostr, "%s w=%f z=%f y=%f x=%f (%s),", ostr, VU0.VF[i].f.w, VU0.VF[i].f.z, VU0.VF[i].f.y, VU0.VF[i].f.x, disRNameCP2f[i])
50 #define dCP232x(i) sprintf(ostr, "%s x=%f (%s),", ostr, VU0.VF[i].f.x, disRNameCP2f[i])
51 #define dCP232y(i) sprintf(ostr, "%s y=%f (%s),", ostr, VU0.VF[i].f.y, disRNameCP2f[i])
52 #define dCP232z(i) sprintf(ostr, "%s z=%f (%s),", ostr, VU0.VF[i].f.z, disRNameCP2f[i])
53 #define dCP232w(i) sprintf(ostr, "%s w=%f (%s),", ostr, VU0.VF[i].f.w, disRNameCP2f[i])
54 #define dCP2ACCf() sprintf(ostr, "%s w=%f z=%f y=%f x=%f (ACC),", ostr, VU0.ACC.f.w, VU0.ACC.f.z, VU0.ACC.f.y, VU0.ACC.f.x)
55 #define dCP232i(i) sprintf(ostr, "%s %8.8x (%s),", ostr, VU0.VI[i].UL, disRNameCP2i[i])
56 #define dCP232iF(i) sprintf(ostr, "%s %f (%s),", ostr, VU0.VI[i].F, disRNameCP2i[i])
57 #define dCP232f(i, j) sprintf(ostr, "%s Q %s=%f (%s),", ostr, CP2VFnames[j], VU0.VF[i].F[j], disRNameCP2f[i])
58 #define dImm5() sprintf(ostr, "%s %d,", ostr, (code >> 6) & 0x1f)
59 #define dImm11() sprintf(ostr, "%s %d,", ostr, code & 0x7ff)
60 #define dImm15() sprintf(ostr, "%s %d,", ostr, ( ( code >> 10 ) & 0x7800 ) | ( code & 0x7ff ))
61
62 #define _X ((code>>24) & 0x1)
63 #define _Y ((code>>23) & 0x1)
64 #define _Z ((code>>22) & 0x1)
65 #define _W ((code>>21) & 0x1)
66
67 #define _Fsf_ ((code >> 21) & 0x03)
68 #define _Ftf_ ((code >> 23) & 0x03)
69
70
71 /*********************************************************
72 * Unknown instruction (would generate an exception) *
73 * Format: ? *
74 *********************************************************/
75 //extern char* disNULL DisFInterface;
76 static MakeDisF(disNULL, dName("*** Bad OP ***");)
77
78 #include "DisVUmicro.h"
79 #include "DisVUops.h"
80 #include "VU.h"
81
82 _disVUOpcodes(VU0);
83 _disVUTables(VU0);
84

  ViewVC Help
Powered by ViewVC 1.1.22