/[pcsx2_0.9.7]/trunk/pcsx2/x86/newVif.h
ViewVC logotype

Contents of /trunk/pcsx2/x86/newVif.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 148 - (show annotations) (download)
Fri Sep 10 17:22:32 2010 UTC (9 years, 4 months ago) by william
File MIME type: text/plain
File size: 3574 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.3746 local: v0.9.7.138) in ./trunk
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 #pragma once
17
18 #include "Vif.h"
19 #include "VU.h"
20
21 #include "x86emitter/x86emitter.h"
22 using namespace x86Emitter;
23
24 #define aMax(x, y) std::max(x,y)
25 #define aMin(x, y) std::min(x,y)
26
27 // newVif_HashBucket.h uses this typedef, so it has to be declared first.
28 typedef u32 (__fastcall *nVifCall)(void*, const void*);
29 typedef void (__fastcall *nVifrecCall)(uptr dest, uptr src);
30
31 #include "newVif_BlockBuffer.h"
32 #include "newVif_HashBucket.h"
33
34 extern void mVUmergeRegs(const xRegisterSSE& dest, const xRegisterSSE& src, int xyzw, bool modXYZW = 0);
35 extern void _nVifUnpack (int idx, const u8 *data, u32 size, bool isFill);
36 extern void dVifUnpack (int idx, const u8 *data, u32 size, bool isFill);
37 extern void dVifReset (int idx);
38 extern void dVifClose (int idx);
39 extern void VifUnpackSSE_Init();
40
41 #define VUFT VIFUnpackFuncTable
42 #define _v0 0
43 #define _v1 0x55
44 #define _v2 0xaa
45 #define _v3 0xff
46 #define xmmCol0 xmm2
47 #define xmmCol1 xmm3
48 #define xmmCol2 xmm4
49 #define xmmCol3 xmm5
50 #define xmmRow xmm6
51 #define xmmTemp xmm7
52
53 #ifdef _MSC_VER
54 # pragma pack(1)
55 # pragma warning(disable:4996) // 'function': was declared deprecated
56 #endif
57
58 // nVifBlock - Ordered for Hashing; the 'num' field and the lower 6 bits of upkType are
59 // used as the hash bucket selector.
60 //
61 struct __aligned16 nVifBlock {
62 u8 num; // [00] Num Field
63 u8 upkType; // [01] Unpack Type [usn*1:mask*1:upk*4]
64 u8 mode; // [02] Mode Field
65 u8 scl; // [03] Start Cycle
66 u8 cl; // [04] CL Field
67 u8 wl; // [05] WL Field
68 u32 mask; // [06] Mask Field
69 u8 padding[2];// [10] through [11]
70 uptr startPtr; // [12] Start Ptr of RecGen Code
71 } __packed; // 16 bytes
72
73 #ifdef _MSC_VER
74 # pragma pack()
75 #endif
76
77 #define _hSize 0x4000 // [usn*1:mask*1:upk*4:num*8] hash...
78 #define _cmpS (sizeof(nVifBlock) - (4))
79 #define _tParams nVifBlock, _hSize, _cmpS
80 struct nVifStruct {
81 u32 idx; // VIF0 or VIF1
82 vifStruct* vif; // Vif Struct ptr
83 VIFregisters* vifRegs; // Vif Regs ptr
84 VURegs* VU; // VU Regs ptr
85 u32 vuMemLimit; // Use for fast AND
86 u32 bSize; // Size of 'buffer'
87 u32 bPtr;
88 u8 buffer[_1mb]; // Buffer for partial transfers
89 u8* recPtr; // Cur Pos to recompile to
90 u8* recEnd; // 'Safe' End of Rec Cache
91 BlockBuffer* vifCache; // Block Buffer
92 HashBucket<_tParams>* vifBlocks; // Vif Blocks
93 int numBlocks; // # of Blocks Recompiled
94
95 nVifStruct()
96 {
97 vifCache = NULL;
98 vifBlocks = NULL;
99 numBlocks = 0;
100 recPtr = NULL;
101 recEnd = NULL;
102 }
103 };
104
105 extern __aligned16 nVifStruct nVif[2];
106 extern __aligned16 const u8 nVifT[16];
107 extern __aligned16 nVifCall nVifUpk[(2*2*16)*4]; // ([USN][Masking][Unpack Type]) [curCycle]
108 extern __aligned16 u32 nVifMask[3][4][4]; // [MaskNumber][CycleNumber][Vector]
109
110 static const bool newVifDynaRec = 1; // Use code in newVif_Dynarec.inl

  ViewVC Help
Powered by ViewVC 1.1.22