drc: rm unneeded writebacks in stubs, as suggested by Ari64
[pcsx_rearmed.git] / libpcsxcore / ppc / pGte.h
CommitLineData
ef79bbde
P
1/* Pcsx - Pc Psx Emulator
2 * Copyright (C) 1999-2003 Pcsx Team
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA
17 */
18
19#ifndef PGET_H
20#define PGET_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26int psxCP2time[64] = {
27 2, 16 , 1 , 1, 1, 1 , 8, 1, // 00
28 1 , 1 , 1 , 1, 6 , 1 , 1 , 1, // 08
29 8 , 8, 8, 19, 13 , 1 , 44 , 1, // 10
30 1 , 1 , 1 , 17, 11 , 1 , 14 , 1, // 18
31 30 , 1 , 1 , 1, 1, 1 , 1 , 1, // 20
32 5 , 8 , 17 , 1, 1, 5, 6, 1, // 28
33 23 , 1 , 1 , 1, 1, 1 , 1 , 1, // 30
34 1 , 1 , 1 , 1, 1, 6 , 5 , 39 // 38
35};
36
37#define CP2_FUNC(f) \
38void gte##f(); \
39static void rec##f() { \
40 if (pc < cop2readypc) idlecyclecount += (cop2readypc - pc)>>2; \
41 iFlushRegs(0); \
42 LIW(0, (u32)psxRegs.code); \
43 STW(0, OFFSET(&psxRegs, &psxRegs.code), GetHWRegSpecial(PSXREGS)); \
44 FlushAllHWReg(); \
45 CALLFunc ((u32)gte##f); \
46 cop2readypc = pc + psxCP2time[_fFunct_(psxRegs.code)]<<2; \
47}
48
49#define CP2_FUNCNC(f) \
50void gte##f(); \
51static void rec##f() { \
52 if (pc < cop2readypc) idlecyclecount += (cop2readypc - pc)>>2; \
53 iFlushRegs(0); \
54 CALLFunc ((u32)gte##f); \
55/* branch = 2; */\
56 cop2readypc = pc + psxCP2time[_fFunct_(psxRegs.code)]; \
57}
58
59CP2_FUNC(MFC2);
60CP2_FUNC(MTC2);
61CP2_FUNC(CFC2);
62CP2_FUNC(CTC2);
63CP2_FUNC(LWC2);
64CP2_FUNC(SWC2);
65CP2_FUNCNC(RTPS);
66CP2_FUNC(OP);
67CP2_FUNCNC(NCLIP);
68CP2_FUNC(DPCS);
69CP2_FUNC(INTPL);
70CP2_FUNC(MVMVA);
71CP2_FUNCNC(NCDS);
72CP2_FUNCNC(NCDT);
73CP2_FUNCNC(CDP);
74CP2_FUNCNC(NCCS);
75CP2_FUNCNC(CC);
76CP2_FUNCNC(NCS);
77CP2_FUNCNC(NCT);
78CP2_FUNC(SQR);
79CP2_FUNC(DCPL);
80CP2_FUNCNC(DPCT);
81CP2_FUNCNC(AVSZ3);
82CP2_FUNCNC(AVSZ4);
83CP2_FUNCNC(RTPT);
84CP2_FUNC(GPF);
85CP2_FUNC(GPL);
86CP2_FUNCNC(NCCT);
87
88#ifdef __cplusplus
89}
90#endif
91#endif