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

Contents of /trunk/pcsx2/VUmicroMem.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 283 - (show annotations) (download)
Thu Dec 23 12:39:52 2010 UTC (9 years, 2 months ago) by william
File size: 2188 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4132 local: v0.9.7.282-latest) 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 #include "PrecompiledHeader.h"
18 #include "Common.h"
19 #include "VUmicro.h"
20
21
22 __aligned16 VURegs vuRegs[2];
23
24
25 vuMemoryReserve::vuMemoryReserve()
26 : _parent( L"VU0/1 on-chip memory", VU1_PROGSIZE + VU1_MEMSIZE + VU0_PROGSIZE + VU0_MEMSIZE )
27 {
28 }
29
30 void vuMemoryReserve::Reserve()
31 {
32 _parent::Reserve(HostMemoryMap::VUmem);
33 //_parent::Reserve(EmuConfig.HostMemMap.VUmem);
34
35 u8* curpos = m_reserve.GetPtr();
36 VU0.Micro = curpos; curpos += VU0_PROGSIZE;
37 VU0.Mem = curpos; curpos += VU0_MEMSIZE;
38 VU1.Micro = curpos; curpos += VU1_PROGSIZE;
39 VU1.Mem = curpos; curpos += VU1_MEMSIZE;
40 }
41
42 void vuMemoryReserve::Release()
43 {
44 _parent::Release();
45
46 VU0.Micro = VU0.Mem = NULL;
47 VU1.Micro = VU1.Mem = NULL;
48 }
49
50 void vuMemoryReserve::Reset()
51 {
52 _parent::Reset();
53
54 pxAssume( VU0.Mem );
55 pxAssume( VU1.Mem );
56
57 memMapVUmicro();
58
59 // === VU0 Initialization ===
60 memzero(VU0.ACC);
61 memzero(VU0.VF);
62 memzero(VU0.VI);
63 VU0.VF[0].f.x = 0.0f;
64 VU0.VF[0].f.y = 0.0f;
65 VU0.VF[0].f.z = 0.0f;
66 VU0.VF[0].f.w = 1.0f;
67 VU0.VI[0].UL = 0;
68
69 // === VU1 Initialization ===
70 memzero(VU1.ACC);
71 memzero(VU1.VF);
72 memzero(VU1.VI);
73 VU1.VF[0].f.x = 0.0f;
74 VU1.VF[0].f.y = 0.0f;
75 VU1.VF[0].f.z = 0.0f;
76 VU1.VF[0].f.w = 1.0f;
77 VU1.VI[0].UL = 0;
78 }
79
80 void SaveStateBase::vuMicroFreeze()
81 {
82 FreezeTag( "vuMicroRegs" );
83
84 Freeze(VU0.ACC);
85 Freeze(VU0.code);
86
87 Freeze(VU0.VF);
88 Freeze(VU0.VI);
89
90 Freeze(VU1.ACC);
91
92 u32& temp_vu1_code = VU1.code;
93 Freeze(temp_vu1_code);
94
95 Freeze(VU1.VF);
96 Freeze(VU1.VI);
97 }

  ViewVC Help
Powered by ViewVC 1.1.22