diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c index 67df6e93d6b..db663453d93 100644 --- a/src/emu/machine/z80dma.c +++ b/src/emu/machine/z80dma.c @@ -12,8 +12,9 @@ - Only memory to memory is tested! TODO: - - implement missing features + - refactor according to new memory system - implement interrupt support (not used in dkong3 and mario) + - implement missing features - implement more asserts - implement a INPUT_LINE_BUSREQ for Z80. As a workaround, HALT is used. This implies burst mode. @@ -23,6 +24,7 @@ #include "driver.h" #include "memconv.h" #include "z80dma.h" +#include "cpu/z80/z80daisy.h" #define VERBOSE 0 @@ -412,9 +414,30 @@ WRITE8_DEVICE_HANDLER( z80dma_rdy_w) timer_call_after_resynch((void *) device, param, z80dma_rdy_write_callback); } -/* ----------------------------------------------------------------------- */ -/* device interface */ +/*************************************************************************** + DAISY CHAIN INTERFACE +***************************************************************************/ + +static int z80dma_irq_state(const device_config *device) +{ + int state = 0; + + return state; +} + +static int z80dma_irq_ack(const device_config *device) +{ + return 0; +} + +static void z80dma_irq_reti(const device_config *device) +{ +} + +/*************************************************************************** + DEVICE INTERFACE +***************************************************************************/ static DEVICE_START( z80dma ) { @@ -483,6 +506,9 @@ DEVICE_GET_INFO( z80dma ) case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(z80dma);break; case DEVINFO_FCT_STOP: /* Nothing */ break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(z80dma);break; + case DEVINFO_FCT_IRQ_STATE: info->f = (genf *)z80dma_irq_state; break; + case DEVINFO_FCT_IRQ_ACK: info->f = (genf *)z80dma_irq_ack; break; + case DEVINFO_FCT_IRQ_RETI: info->f = (genf *)z80dma_irq_reti; break; /* --- the following bits of info are returned as NULL-terminated strings --- */ case DEVINFO_STR_NAME: info->s = "Z80DMA"; break; diff --git a/src/emu/machine/z80dma.h b/src/emu/machine/z80dma.h index b8b5cad89ec..17ede2503a5 100644 --- a/src/emu/machine/z80dma.h +++ b/src/emu/machine/z80dma.h @@ -1,6 +1,6 @@ /********************************************************************** - 8257 DMA interface and emulation + Z80 DMA interface and emulation **********************************************************************/ @@ -29,7 +29,7 @@ struct _z80dma_interface write8_device_func portB_write; /* interrupt callback - not implemented */ - /* void (*irqcb)(int state); */ + void (*irq_cb)(const device_config *device, int state); }; /* device interface */ diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index 52bb295e995..ece0859c6de 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -343,7 +343,8 @@ static const z80dma_interface dk3_dma = dk_dma_read_byte, dk_dma_write_byte, - 0, 0, 0, 0 + 0, 0, 0, 0, + NULL }; static const dma8257_interface dk_dma = diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c index d2a3db68101..9d7494f2b30 100644 --- a/src/mame/drivers/mario.c +++ b/src/mame/drivers/mario.c @@ -110,7 +110,8 @@ static const z80dma_interface mario_dma = mario_dma_read_byte, mario_dma_write_byte, - 0, 0, 0, 0 + 0, 0, 0, 0, + NULL }; /*************************************