/[pcsx2_0.9.7]/trunk/pcsx2/VU1micro.cpp
ViewVC logotype

Contents of /trunk/pcsx2/VU1micro.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (9 years, 9 months ago) by william
File size: 1763 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
17 // This module contains code shared by both the dynarec and interpreter versions
18 // of the VU0 micro.
19
20 #include "PrecompiledHeader.h"
21 #include "Common.h"
22
23 #include <cmath>
24
25 #include "VUmicro.h"
26
27 #ifdef PCSX2_DEBUG
28 u32 vudump = 0;
29 #endif
30
31 #define VF_VAL(x) ((x==0x80000000)?0:(x))
32
33 // This is called by the COP2 as per the CTC instruction
34 void vu1ResetRegs()
35 {
36 VU0.VI[REG_VPU_STAT].UL &= ~0xff00; // stop vu1
37 VU0.VI[REG_FBRST].UL &= ~0xff00; // stop vu1
38 vif1Regs.stat.VEW = false;
39 }
40
41 void vu1Finish() {
42 while (VU0.VI[REG_VPU_STAT].UL & 0x100) {
43 VUM_LOG("vu1ExecMicro > Stalling until current microprogram finishes");
44 CpuVU1->Execute(vu1RunCycles);
45 }
46 }
47
48 void __fastcall vu1ExecMicro(u32 addr)
49 {
50 static int count = 0;
51 vu1Finish();
52
53 VUM_LOG("vu1ExecMicro %x", addr);
54 VUM_LOG("vu1ExecMicro %x (count=%d)", addr, count++);
55
56 VU0.VI[REG_VPU_STAT].UL &= ~0xFF00;
57 VU0.VI[REG_VPU_STAT].UL |= 0x0100;
58
59 vif1Regs.stat.VEW = true;
60 if ((s32)addr != -1) VU1.VI[REG_TPC].UL = addr;
61 _vuExecMicroDebug(VU1);
62
63 CpuVU1->Execute(vu1RunCycles);
64 }

  ViewVC Help
Powered by ViewVC 1.1.22