-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapper_000.cpp
More file actions
45 lines (37 loc) · 870 Bytes
/
Mapper_000.cpp
File metadata and controls
45 lines (37 loc) · 870 Bytes
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
43
44
45
#include "Mapper_000.h"
bool Mapper_000::cpuMapRead(uint16_t addr, uint32_t &mapped_addr)
{
if(addr >= 0x8000 && addr <= 0xFFFF)
{
mapped_addr = addr & (nPRGBanks > 1 ? 0x7FFF : 0x3FFF);
return true;
}
return false;
}
bool Mapper_000::cpuMapWrite(uint16_t addr, uint32_t &mapped_addr)
{
if(addr >= 0x8000 && addr <= 0xFFFF)
{
mapped_addr = addr & (nPRGBanks > 1 ? 0x7FFF : 0x3FFF);
return true;
}
return false;
}
bool Mapper_000::ppuMapRead(uint16_t addr, uint32_t &mapped_addr)
{
if(addr >= 0x0000 && addr <= 0x1FFF)
{
mapped_addr = addr;
return true;
}
return false;
}
bool Mapper_000::ppuMapWrite(uint16_t addr, uint32_t &mapped_addr)
{
/*if(addr >= 0x0000 && addr <= 0x1FFF)
{
mapped_addr = addr;
return true;
}*/
return false;
}