-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMemory.bt
38 lines (35 loc) · 909 Bytes
/
Memory.bt
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
// -*- mode: c;-*-
#define PRAM_START 0x80000000
#define PRAM_LOW 0x803FFFFF
#define PRAM_HIGH 0x807FFFFF
#define VRAM_START 0x80800000
#define VRAM_END 0x80FFFFFF
typedef struct {
uint memoryAddress;
} Ram<read=ReadRam>;
string ReadRam( Ram &f ){
local string s;
local string wasBigSize;
if(
f.memoryAddress >= PRAM_START &&
f.memoryAddress < VRAM_START
){
if( f.memoryAddress <= PRAM_LOW ){
wasBigSize = "Physical, Low";
} else if(
f.memoryAddress > PRAM_LOW &&
f.memoryAddress <= PRAM_HIGH
){
wasBigSize = "Physical, High";
}
} else if(
f.memoryAddress >= VRAM_START &&
f.memoryAddress < VRAM_END
){
wasBigSize = "Virtual";
} else {
return "Invalid";
}
SPrintf(s, "0x%08LX (%s)", f.memoryAddress, wasBigSize);
return s;
}