32 #define lowByte(x) (x & 0x00FF)
33 #define highByte(x) ((x & 0xFF00) >> 8)
35 static uInt8 maskReg[8] = { 0x0A, 0x0A, 0x0A, 0x0A, 0xD4, 0xD4, 0xD4, 0xD4 };
36 static uInt8 clearReg[8] = { 0x0C, 0x0C, 0x0C, 0x0C, 0xD8, 0xD8, 0xD8, 0xD8 };
37 static uInt8 modeReg[8] = { 0x0B, 0x0B, 0x0B, 0x0B, 0xD6, 0xD6, 0xD6, 0xD6 };
38 static uInt8 addrPort[8] = { 0x00, 0x02, 0x04, 0x06, 0xC0, 0xC4, 0xC8, 0xCC };
39 static uInt8 pagePort[8] = { 0x87, 0x83, 0x81, 0x82, 0x8F, 0x8B, 0x89, 0x8A };
40 static uInt8 countPort[8] = { 0x01, 0x03, 0x05, 0x07, 0xC2, 0xC6, 0xCA, 0xCE };
43 unsigned char page = 0, mode = 0;
44 unsigned int offset = 0;
46 mode = 0x48 + channel;
49 mode = 0x44 + channel;
52 offset = address & 0xFFFF;
54 _dmaXfer(channel, page, offset, length, mode);
59 outportByte(maskReg[dmaChannel], 0x04 | dmaChannel);