forked from amhndu/SimpleNES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapperSxROM.h
45 lines (35 loc) · 1.14 KB
/
MapperSxROM.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
43
44
45
#ifndef MAPPERSXROM_H
#define MAPPERSXROM_H
#include "Mapper.h"
namespace sn
{
class MapperSxROM : public Mapper
{
public:
MapperSxROM(Cartridge& cart, std::function<void(void)> mirroring_cb);
void writePRG (Address addr, Byte value);
Byte readPRG (Address addr);
const Byte* getPagePtr(Address addr);
Byte readCHR (Address addr);
void writeCHR (Address addr, Byte value);
NameTableMirroring getNameTableMirroring();
private:
void calculatePRGPointers();
std::function<void(void)> m_mirroringCallback;
NameTableMirroring m_mirroing;
bool m_usesCharacterRAM;
int m_modeCHR;
int m_modePRG;
Byte m_tempRegister;
int m_writeCounter;
Byte m_regPRG;
Byte m_regCHR0;
Byte m_regCHR1;
const Byte* m_firstBankPRG;
const Byte* m_secondBankPRG;
const Byte* m_firstBankCHR;
const Byte* m_secondBankCHR;
std::vector<Byte> m_characterRAM;
};
}
#endif // MAPPERSXROM_H