|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2017 [email protected]
4: //
5:
6: #pragma once
7:
8: #include "device.h"
9:
10: struct DMAC
11: {
12: static const int CSR = 0x00; // .B
13: static const int CER = 0x01; // .B
14: static const int DCR = 0x04; // .B
15: static const int OCR = 0x05; // .B
16: static const int SCR = 0x06; // .B
17: static const int CCR = 0x07; // .B
18: static const int MTC = 0x0a; // .W
19: static const int MAR = 0x0c; // .L
20: static const int DAR = 0x14; // .L
21: static const int BTC = 0x1a; // .W
22: static const int BAR = 0x1c; // .L
23: static const int NIV = 0x25; // .B
24: static const int EIV = 0x27; // .B
25: static const int MFC = 0x29; // .B
26: static const int CPR = 0x2d; // .B
27: static const int DFC = 0x31; // .B
28: static const int BFC = 0x39; // .B
29: static const int GCR = 0x3f; // .B (ch#3のみ)
30:
31: // 各チャンネル
32: struct channel {
33: uint8 csr;
34: uint8 cer;
35: uint8 dcr;
36: uint8 ocr;
37: uint8 scr;
38: uint8 ccr;
39: uint16 mtc;
40: uint32 mar;
41: uint32 dar;
42: uint16 btc;
43: uint32 bar;
44: uint8 niv;
45: uint8 eiv;
46: uint8 mfc;
47: uint8 cpr;
48: uint8 dfc;
49: uint8 bfc;
50: } chan[4];
51:
52: // 全体
53: uint8 gcr;
54: };
55:
56: class DMACDevice
57: : public IODevice
58: {
59: typedef IODevice inherited;
60:
61: static const int baseaddr = 0xe84000;
62:
63: public:
64: DMACDevice();
65: virtual ~DMACDevice();
66:
67: virtual uint64 Read8(uint32 addr);
68: virtual uint64 Write8(uint32 addr, uint32 data);
69: virtual uint64 Peek8(uint32 addr);
70:
71: private:
72: void write_csr(int ch, uint32 data);
73: void write_ccr(int ch, uint32 data);
74:
75: struct DMAC dmac {};
76: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.