-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathdmac.h
110 lines (92 loc) · 1.58 KB
/
dmac.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef DMACCALL
#define DMACCALL
#endif
enum {
DMAEXT_START = 0,
DMAEXT_END = 1,
DMAEXT_BREAK = 2,
DMA_INITSIGNALONLY = 1,
DMADEV_NONE = 0,
DMADEV_2HD = 1,
DMADEV_2DD = 2,
DMADEV_SASI = 3,
DMADEV_SCSI = 4,
DMADEV_CS4231 = 5
};
#if defined(BYTESEX_LITTLE)
enum {
DMA16_LOW = 0,
DMA16_HIGH = 1,
DMA32_LOW = 0,
DMA32_HIGH = 2
};
#elif defined(BYTESEX_BIG)
enum {
DMA16_LOW = 1,
DMA16_HIGH = 0,
DMA32_LOW = 2,
DMA32_HIGH = 0
};
#endif
typedef struct {
void (DMACCALL * outproc)(REG8 data);
REG8 (DMACCALL * inproc)(void);
REG8 (DMACCALL * extproc)(REG8 action);
} DMAPROC;
typedef struct {
union {
UINT8 b[4];
UINT16 w[2];
UINT32 d;
} adrs;
union {
UINT8 b[2];
UINT16 w;
} leng;
union {
UINT8 b[2];
UINT16 w;
} adrsorg;
union {
UINT8 b[2];
UINT16 w;
} lengorg;
UINT8 bound;
UINT8 action;
DMAPROC proc;
UINT8 mode;
UINT8 sreq;
UINT8 ready;
UINT8 mask;
} _DMACH, *DMACH;
typedef struct {
UINT8 device;
UINT8 channel;
} DMADEV;
typedef struct {
_DMACH dmach[4];
int lh;
UINT8 work;
UINT8 working;
UINT8 mask;
UINT8 stat;
UINT devices;
DMADEV device[8];
} _DMAC, *DMAC;
#ifdef __cplusplus
extern "C" {
#endif
void DMACCALL dma_dummyout(REG8 data);
REG8 DMACCALL dma_dummyin(void);
REG8 DMACCALL dma_dummyproc(REG8 func);
void dmac_reset(const NP2CFG *pConfig);
void dmac_bind(void);
void dmac_extbind(void);
void dmac_check(void);
UINT dmac_getdatas(DMACH dmach, UINT8 *buf, UINT size);
void dmac_procset(void);
void dmac_attach(REG8 device, REG8 channel);
void dmac_detach(REG8 device);
#ifdef __cplusplus
}
#endif