1#pragma once
2#include "mapper.hpp"
3
4
5class Mapper4 : public Mapper
6{
7 u8 reg8000;
8 u8 regs[8];
9 bool horizMirroring;
10
11 u8 irqPeriod;
12 u8 irqCounter;
13 bool irqEnabled;
14
15 void apply();
16
17 public:
18 Mapper4(u8* rom) : Mapper(rom)
19 {
20 for (int i = 0; i < 8; i++)
21 regs[i] = 0;
22
23 horizMirroring = true;
24 irqEnabled = false;
25 irqPeriod = irqCounter = 0;
26
27 map_prg<8>(3, -1);
28 apply();
29 }
30
31 u8 write(u16 addr, u8 v);
32 u8 chr_write(u16 addr, u8 v);
33
34 void signal_scanline();
35};
36