-
Notifications
You must be signed in to change notification settings - Fork 0
/
EEPromCartridge.h
64 lines (49 loc) · 1.03 KB
/
EEPromCartridge.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* EEPromCartridge.h
*
* Created on: Feb 15, 2018
* Author: jock
*/
#ifndef EEPROMCARTRIDGE_H_
#define EEPROMCARTRIDGE_H_
#include <Cartridge.h>
class EEPromCartridge: public Cartridge {
public:
EEPromCartridge(I2CEEProm *ee)
{
this->eeprom = ee;
this->mem = NULL;
this->size = 0;
this->version = 0;
this->iVersion = 0;
this->gameCount = 0;
}
virtual ~EEPromCartridge()
{
// Nothing
}
void setMem(uint8_t *m, uint16_t siz)
{
this->mem = m;
this->size = siz;
}
virtual uint16_t getVersion() const {
return version;
}
virtual bool isCartridgePresent();
virtual uint8_t getGameCount()
{
return this->gameCount;
}
virtual const GameData *getGameAt(uint8_t pos);
virtual void loadGameData(uint8_t *memoryPool, uint16_t memSize);
virtual void loadGame(uint8_t gameIdx, uint8_t *mem, uint16_t loadOffset, uint16_t memSize);
private:
I2CEEProm *eeprom;
uint8_t *mem;
uint16_t size;
uint16_t version;
uint16_t iVersion;
uint8_t gameCount;
};
#endif /* EEPROMCARTRIDGE_H_ */