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

Diff of /trunk/pcsx2/vtlb.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/pcsx2/vtlb.h	2010/09/07 03:24:11	31
+++ trunk/pcsx2/vtlb.h	2010/09/07 11:08:22	62
@@ -1,6 +1,22 @@
+/*  PCSX2 - PS2 Emulator for PCs
+ *  Copyright (C) 2002-2010  PCSX2 Dev Team
+ *
+ *  PCSX2 is free software: you can redistribute it and/or modify it under the terms
+ *  of the GNU Lesser General Public License as published by the Free Software Found-
+ *  ation, either version 3 of the License, or (at your option) any later version.
+ *
+ *  PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ *  PURPOSE.  See the GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along with PCSX2.
+ *  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 #pragma once
 
+#include "MemoryTypes.h"
+
 // Specialized function pointers for each read type
 typedef  mem8_t __fastcall vtlbMemR8FP(u32 addr);
 typedef  mem16_t __fastcall vtlbMemR16FP(u32 addr);
@@ -51,16 +67,15 @@
 
 //Memory functions
 
-extern mem8_t __fastcall vtlb_memRead8(u32 mem);
-extern mem16_t __fastcall vtlb_memRead16(u32 mem);
-extern u32 __fastcall vtlb_memRead32(u32 mem);
-extern void __fastcall vtlb_memRead64(u32 mem, u64 *out);
-extern void __fastcall vtlb_memRead128(u32 mem, u64 *out);
-extern void __fastcall vtlb_memWrite8 (u32 mem, mem8_t  value);
-extern void __fastcall vtlb_memWrite16(u32 mem, mem16_t value);
-extern void __fastcall vtlb_memWrite32(u32 mem, u32 value);
-extern void __fastcall vtlb_memWrite64(u32 mem, const u64* value);
-extern void __fastcall vtlb_memWrite128(u32 mem, const u64* value);
+template< typename DataType >
+extern DataType __fastcall vtlb_memRead(u32 mem);
+extern void __fastcall vtlb_memRead64(u32 mem, mem64_t *out);
+extern void __fastcall vtlb_memRead128(u32 mem, mem128_t *out);
+
+template< typename DataType >
+extern void __fastcall vtlb_memWrite(u32 mem, DataType value);
+extern void __fastcall vtlb_memWrite64(u32 mem, const mem64_t* value);
+extern void __fastcall vtlb_memWrite128(u32 mem, const mem128_t* value);
 
 extern void vtlb_DynGenWrite(u32 sz);
 extern void vtlb_DynGenRead32(u32 bits, bool sign);
@@ -72,7 +87,9 @@
 
 namespace vtlb_private
 {
-	static const uint VTLB_ALLOC_SIZE = 0x2900000;	//this is a bit more than required
+	// Allocate enough memory for both EE and IOP memory space (IOP is roughly 2.5mb,
+	// so we alloc 4mb for now -- a little more than is needed).
+	static const uint VTLB_ALLOC_SIZE = sizeof(*eeMem) + (_1mb*4);
 
 	static const uint VTLB_PAGE_BITS = 12;
 	static const uint VTLB_PAGE_MASK = 4095;

 

  ViewVC Help
Powered by ViewVC 1.1.22