2016-01-30 06:40:35 +00:00
|
|
|
struct Cartridge : IO {
|
2016-01-27 11:31:39 +00:00
|
|
|
auto load() -> void;
|
|
|
|
auto unload() -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
|
|
|
|
auto romRead(uint addr) -> uint8;
|
|
|
|
auto romWrite(uint addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto ramRead(uint addr) -> uint8;
|
|
|
|
auto ramWrite(uint addr, uint8 data) -> void;
|
|
|
|
|
2016-01-30 06:40:35 +00:00
|
|
|
auto portRead(uint16 addr) -> uint8 override;
|
|
|
|
auto portWrite(uint16 addr, uint8 data) -> void override;
|
|
|
|
|
2016-01-27 11:31:39 +00:00
|
|
|
struct Registers {
|
|
|
|
uint8 bank_rom0;
|
|
|
|
uint8 bank_rom1;
|
|
|
|
uint8 bank_rom2;
|
|
|
|
uint8 bank_sram;
|
|
|
|
} r;
|
|
|
|
|
|
|
|
struct Memory {
|
|
|
|
uint8* data = nullptr;
|
|
|
|
uint size = 0;
|
2016-01-28 11:39:49 +00:00
|
|
|
uint mask = 0;
|
2016-01-27 11:31:39 +00:00
|
|
|
string name;
|
|
|
|
} rom, ram;
|
|
|
|
|
2016-02-18 10:32:22 +00:00
|
|
|
EEPROM eeprom;
|
|
|
|
|
2016-01-27 11:31:39 +00:00
|
|
|
struct Information {
|
|
|
|
string manifest;
|
|
|
|
string title;
|
|
|
|
string sha256;
|
|
|
|
} information;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Cartridge cartridge;
|