src/mess/machine/hd63450.c
| r4035 | r4036 | |
| 6 | 6 | |
| 7 | 7 | #include "machine/hd63450.h" |
| 8 | 8 | |
| 9 | typedef struct _hd63450_regs hd63450_regs; |
| 10 | struct _hd63450_regs |
| 11 | { // offsets in bytes |
| 12 | unsigned char csr; // [00] Channel status register (R/W) |
| 13 | unsigned char cer; // [01] Channel error register (R) |
| 14 | unsigned char dcr; // [04] Device control register (R/W) |
| 15 | unsigned char ocr; // [05] Operation control register (R/W) |
| 16 | unsigned char scr; // [06] Sequence control register (R/W) |
| 17 | unsigned char ccr; // [07] Channel control register (R/W) |
| 18 | unsigned short mtc; // [0a,0b] Memory Transfer Counter (R/W) |
| 19 | unsigned long mar; // [0c-0f] Memory Address Register (R/W) |
| 20 | unsigned long dar; // [14-17] Device Address Register (R/W) |
| 21 | unsigned short btc; // [1a,1b] Base Transfer Counter (R/W) |
| 22 | unsigned long bar; // [1c-1f] Base Address Register (R/W) |
| 23 | unsigned char niv; // [25] Normal Interrupt Vector (R/W) |
| 24 | unsigned char eiv; // [27] Error Interrupt Vector (R/W) |
| 25 | unsigned char mfc; // [29] Memory Function Code (R/W) |
| 26 | unsigned char cpr; // [2d] Channel Priority Register (R/W) |
| 27 | unsigned char dfc; // [31] Device Function Code (R/W) |
| 28 | unsigned char bfc; // [39] Base Function Code (R/W) |
| 29 | unsigned char gcr; // [3f] General Control Register (R/W) |
| 30 | }; |
| 9 | 31 | |
| 32 | typedef struct _hd63450_t hd63450_t; |
| 33 | struct _hd63450_t |
| 34 | { |
| 35 | hd63450_regs reg[4]; |
| 36 | emu_timer* timer[4]; // for timing data reading/writing each channel |
| 37 | attotime clock[4]; |
| 38 | attotime burst_clock[4]; |
| 39 | int in_progress[4]; // if a channel is in use |
| 40 | int transfer_size[4]; |
| 41 | int halted[4]; // non-zero if a channel has been halted, and can be continued later. |
| 42 | const hd63450_intf* intf; |
| 43 | }; |
| 44 | |
| 10 | 45 | static TIMER_CALLBACK(dma_transfer_timer); |
| 11 | 46 | static void dma_transfer_abort(const device_config* device, int channel); |
| 12 | 47 | static void dma_transfer_halt(const device_config* device, int channel); |
src/mess/machine/hd63450.h
| r4035 | r4036 | |
| 16 | 16 | void (*dma_write[4])(running_machine *machine,int addr,int data); |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | | typedef struct _hd63450_regs hd63450_regs; |
| 20 | | struct _hd63450_regs |
| 21 | | { // offsets in bytes |
| 22 | | unsigned char csr; // [00] Channel status register (R/W) |
| 23 | | unsigned char cer; // [01] Channel error register (R) |
| 24 | | unsigned char dcr; // [04] Device control register (R/W) |
| 25 | | unsigned char ocr; // [05] Operation control register (R/W) |
| 26 | | unsigned char scr; // [06] Sequence control register (R/W) |
| 27 | | unsigned char ccr; // [07] Channel control register (R/W) |
| 28 | | unsigned short mtc; // [0a,0b] Memory Transfer Counter (R/W) |
| 29 | | unsigned long mar; // [0c-0f] Memory Address Register (R/W) |
| 30 | | unsigned long dar; // [14-17] Device Address Register (R/W) |
| 31 | | unsigned short btc; // [1a,1b] Base Transfer Counter (R/W) |
| 32 | | unsigned long bar; // [1c-1f] Base Address Register (R/W) |
| 33 | | unsigned char niv; // [25] Normal Interrupt Vector (R/W) |
| 34 | | unsigned char eiv; // [27] Error Interrupt Vector (R/W) |
| 35 | | unsigned char mfc; // [29] Memory Function Code (R/W) |
| 36 | | unsigned char cpr; // [2d] Channel Priority Register (R/W) |
| 37 | | unsigned char dfc; // [31] Device Function Code (R/W) |
| 38 | | unsigned char bfc; // [39] Base Function Code (R/W) |
| 39 | | unsigned char gcr; // [3f] General Control Register (R/W) |
| 40 | | }; |
| 41 | | |
| 42 | | typedef struct _hd63450_t hd63450_t; |
| 43 | | struct _hd63450_t |
| 44 | | { |
| 45 | | hd63450_regs reg[4]; |
| 46 | | emu_timer* timer[4]; // for timing data reading/writing each channel |
| 47 | | attotime clock[4]; |
| 48 | | attotime burst_clock[4]; |
| 49 | | int in_progress[4]; // if a channel is in use |
| 50 | | int transfer_size[4]; |
| 51 | | int halted[4]; // non-zero if a channel has been halted, and can be continued later. |
| 52 | | const hd63450_intf* intf; |
| 53 | | }; |
| 54 | | |
| 55 | | DEVICE_START( hd63450 ); |
| 56 | 19 | DEVICE_GET_INFO( hd63450 ); |
| 57 | 20 | |
| 58 | 21 | int hd63450_read(const device_config* device, int offset, UINT16 mem_mask); |