-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhpc3.h
58 lines (46 loc) · 2.14 KB
/
hpc3.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
#include "memory.h"
#include "eprom.h"
#include "z85c30.h"
#include "seeq_8003_8020.h"
#include "debug_console.h"
typedef enum { S_BYTE, S_SHORT, S_WORD, S_DWORD } ws_t;
class hpc3 : public memory
{
private:
debug_console *pdc;
z85c30 *ser1, *ser2;
eprom *pep;
seeq_8003_8020 *seeq;
uint8_t gio_misc;
void section_8_read_pbus_dma(ws_t ws, uint64_t offset, uint64_t *data);
void section_9_read_hd_enet_channel(ws_t ws, uint64_t offset, uint64_t *data);
void section_a_read_fifo(ws_t ws, uint64_t offset, uint64_t *data);
void section_b_read_general(ws_t ws, uint64_t offset, uint64_t *data);
void section_c_read_hd_dev_regs(ws_t ws, uint64_t offset, uint64_t *data);
void section_d_read_enet_pbus_dev_regs(ws_t ws, uint64_t offset, uint64_t *data);
void section_e_read_sram(ws_t ws, uint64_t offset, uint64_t *data);
void (hpc3::*sections_read[8])(ws_t ws, uint64_t offset, uint64_t *data);
void section_8_write_pbus_dma(ws_t ws, uint64_t offset, uint64_t data);
void section_9_write_hd_enet_channel(ws_t ws, uint64_t offset, uint64_t data);
void section_a_write_fifo(ws_t ws, uint64_t offset, uint64_t data);
void section_b_write_general(ws_t ws, uint64_t offset, uint64_t data);
void section_c_write_hd_dev_regs(ws_t ws, uint64_t offset, uint64_t data);
void section_d_write_enet_pbus_dev_regs(ws_t ws, uint64_t offset, uint64_t data);
void section_e_write_sram(ws_t ws, uint64_t offset, uint64_t data);
void (hpc3::*sections_write[8])(ws_t ws, uint64_t offset, uint64_t data);
void write_fake(ws_t ws, uint64_t offset, uint64_t data);
void read_fake(ws_t ws, uint64_t offset, uint64_t *data);
public:
hpc3(debug_console *pdc_in, std::string sram_file);
~hpc3();
uint64_t get_size() const { return 0x100000; }
uint64_t get_mask() const { return 0xfffff; }
void read_64b(uint64_t offset, uint64_t *data);
void read_32b(uint64_t offset, uint32_t *data);
void read_16b(uint64_t offset, uint16_t *data);
void read_8b(uint64_t offset, uint8_t *data);
void write_64b(uint64_t offset, uint64_t data);
void write_32b(uint64_t offset, uint32_t data);
void write_16b(uint64_t offset, uint16_t data);
void write_8b(uint64_t offset, uint8_t data);
};