| 1 |
#include "chip/chip.hpp" |
| 2 |
#include "board/board.hpp" |
| 3 |
|
| 4 |
struct Cartridge : Thread, property<Cartridge> { |
| 5 |
static void Main(); |
| 6 |
void main(); |
| 7 |
|
| 8 |
void load(); |
| 9 |
void unload(); |
| 10 |
|
| 11 |
void power(); |
| 12 |
void reset(); |
| 13 |
|
| 14 |
readonly<bool> loaded; |
| 15 |
readonly<string> sha256; |
| 16 |
|
| 17 |
struct Information { |
| 18 |
string markup; |
| 19 |
string title; |
| 20 |
} information; |
| 21 |
|
| 22 |
string title(); |
| 23 |
|
| 24 |
struct Memory { |
| 25 |
unsigned id; |
| 26 |
string name; |
| 27 |
}; |
| 28 |
vector<Memory> memory; |
| 29 |
|
| 30 |
void serialize(serializer&); |
| 31 |
Cartridge(); |
| 32 |
|
| 33 |
//privileged: |
| 34 |
Board *board; |
| 35 |
|
| 36 |
uint8 prg_read(unsigned addr); |
| 37 |
void prg_write(unsigned addr, uint8 data); |
| 38 |
|
| 39 |
uint8 chr_read(unsigned addr); |
| 40 |
void chr_write(unsigned addr, uint8 data); |
| 41 |
|
| 42 |
//scanline() is for debugging purposes only: |
| 43 |
//boards must detect scanline edges on their own |
| 44 |
void scanline(unsigned y); |
| 45 |
}; |
| 46 |
|
| 47 |
extern Cartridge cartridge; |