-
Notifications
You must be signed in to change notification settings - Fork 8
/
emuc128.h
82 lines (68 loc) · 1.51 KB
/
emuc128.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once
#include "emucbm.h"
class C128Memory;
class EmuC128 : public EmuCBM
{
public:
EmuC128();
virtual ~EmuC128();
protected:
bool ExecutePatch();
private:
C128Memory* c128memory;
byte GetMemory(ushort addr);
void SetMemory(ushort addr, byte value);
void CheckBypassSETNAM();
void CheckBypassSETLFS();
private:
EmuC128(const EmuC128& other); // disabled
bool operator==(const EmuC128& other) const; // disabled
};
class VDC8563
{
private:
byte* registers;
byte* vdc_ram;
byte register_addr;
byte data;
bool ready = false;
public:
VDC8563();
~VDC8563();
byte GetAddressRegister();
void SetAddressRegister(byte value);
byte GetDataRegister();
void SetDataRegister(byte value);
};
class C128Memory : public Emu6502::Memory
{
public:
C128Memory();
virtual ~C128Memory();
virtual byte read(ushort addr);
virtual void write(ushort addr, byte value);
bool IsChargen(ushort addr);
bool IsKernal(ushort addr);
bool IsBasicHigh(ushort addr);
bool IsBasicLow(ushort addr);
bool IsColor(ushort addr);
bool IsIO(ushort addr);
bool IsRam(int& addr, bool isWrite);
public:
byte* basic_lo_rom;
byte* basic_hi_rom;
byte* char_rom;
byte* kernal_rom;
static const int basic_lo_size = 0x4000;
static const int basic_hi_size = 0x4000;
static const int chargen_size = 0x1000;
static const int kernal_size = 0x4000;
private:
byte* ram;
byte* io;
byte* color_nybles;
VDC8563* vdc;
private:
C128Memory(const C128Memory& other); // disabled
bool operator==(const C128Memory& other) const; // disabled
};