Debian Codegraph @

gba/cartridge/memory.hpp

raw
1 struct Memory {
2 uint8* data;
3 unsigned size;
4 unsigned mask;
5 } rom, ram;
6
7 struct EEPROM {
8 uint8* data;
9 unsigned size;
10 unsigned mask;
11 unsigned test;
12 unsigned bits;
13
14 enum class Mode : unsigned { Wait, Command, ReadAddress, ReadValidate, ReadData, WriteAddress, WriteData, WriteValidate } mode;
15 unsigned offset;
16 unsigned address;
17 unsigned addressbits;
18
19 bool read(unsigned addr);
20 void write(unsigned addr, bool bit);
21
22 bool read();
23 void write(bool bit);
24 void power();
25 void serialize(serializer&);
26 } eeprom;
27
28 struct FlashROM {
29 uint8* data;
30 unsigned size;
31 uint16 id;
32
33 bool unlockhi;
34 bool unlocklo;
35 bool idmode;
36 bool erasemode;
37 bool bankselect;
38 bool writeselect;
39 bool bank;
40
41 uint8 read(uint16 addr);
42 void write(uint16 addr, uint8 byte);
43 void power();
44 void serialize(serializer&);
45 } flashrom;