/[pcsx2_0.9.7]/trunk/pcsx2/Vif_Unpack.h
ViewVC logotype

Contents of /trunk/pcsx2/Vif_Unpack.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (9 years, 11 months ago) by william
File MIME type: text/plain
File size: 2452 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug 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 typedef void (__fastcall *UNPACKFUNCTYPE)(u32 *dest, const u32 *data);
19 typedef void (__fastcall *UNPACKFUNCTYPE_ODD)(u32 *dest, const u32 *data, int size);
20 typedef int (*UNPACKPARTFUNCTYPESSE)(u32 *dest, const u32 *data, int size);
21
22 #define create_unpack_u_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_U##bits)(u32 *dest, const u##bits *data);
23 #define create_unpack_odd_u_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_ODD_U##bits)(u32 *dest, const u##bits *data, int size);
24 #define create_unpack_s_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_S##bits)(u32 *dest, const s##bits *data);
25 #define create_unpack_odd_s_type(bits) typedef void (__fastcall *UNPACKFUNCTYPE_ODD_S##bits)(u32 *dest, const s##bits *data, int size);
26
27 #define create_some_unpacks(bits) \
28 create_unpack_u_type(bits); \
29 create_unpack_odd_u_type(bits); \
30 create_unpack_s_type(bits); \
31 create_unpack_odd_s_type(bits);
32
33 create_some_unpacks(32);
34 create_some_unpacks(16);
35 create_some_unpacks(8);
36
37 struct VIFUnpackFuncTable
38 {
39 UNPACKFUNCTYPE funcU;
40 UNPACKFUNCTYPE funcS;
41
42 UNPACKFUNCTYPE_ODD oddU; // needed for old-style vif only, remove when old vif is removed.
43 UNPACKFUNCTYPE_ODD oddS; // needed for old-style vif only, remove when old vif is removed.
44
45 u8 bsize; // currently unused
46 u8 dsize; // byte size of one channel
47 u8 gsize; // size of data in bytes used for each write cycle
48 u8 qsize; // used for unpack parts, num of vectors that
49 // will be decompressed from data for 1 cycle
50 };
51
52 extern const __aligned16 VIFUnpackFuncTable VIFfuncTable[32];
53
54 extern int nVifUnpack (int idx, const u8 *data);
55 extern void resetNewVif(int idx);
56
57 template< int idx >
58 extern void vifUnpackSetup(const u32 *data);

  ViewVC Help
Powered by ViewVC 1.1.22