forked from pspdev/prxtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VirtualMem.h
42 lines (36 loc) · 873 Bytes
/
VirtualMem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/***************************************************************
* PRXTool : Utility for PSP executables.
* (c) TyRaNiD 2k5
*
* VirtualMem.h - Definition of a class to create a virtual
* memory space.
***************************************************************/
#ifndef __VIRTUALMEM_H__
#define __VIRTUALMEM_H__
#include "types.h"
enum MemEndian
{
MEM_LITTLE_ENDIAN = 0,
MEM_BIG_ENDIAN = 1
};
class CVirtualMem
{
u8 *m_pData;
u32 m_iSize;
s32 m_iBaseAddr;
MemEndian m_endian;
public:
CVirtualMem();
CVirtualMem(u8* pData, u32 iSize, u32 iBaseAddr, MemEndian endian);
~CVirtualMem();
u8 GetU8(u32 iAddr);
u16 GetU16(u32 iAddr);
u32 GetU32(u32 iAddr);
s8 GetS8(u32 iAddr);
s16 GetS16(u32 iAddr);
s32 GetS32(u32 iAddr);
void *GetPtr(u32 iAddr);
u32 GetSize(u32 iAddr);
u32 Copy(void *pDest, u32 iAddr, u32 iSize);
};
#endif