Previous 15994 Revisions Next

r3595 Wednesday 26th November, 2008 at 19:26:03 UTC by Curt Coder
[Z80DMA] Fixes from MAME.
[src/emu/machine]z80dma.c z80dma.h

src/emu/machine/z80dma.c
r3594r3595
1212        - Only memory to memory is tested!
1313
1414    TODO:
15      - refactor according to new memory system
16        - implement interrupt support (not used in dkong3 and mario)
1517        - implement missing features
16        - implement interrupt support (not used in dkong3 and mario)
1718        - implement more asserts
1819        - implement a INPUT_LINE_BUSREQ for Z80. As a workaround,
1920          HALT is used. This implies burst mode.
r3594r3595
2324#include "driver.h"
2425#include "memconv.h"
2526#include "z80dma.h"
27#include "cpu/z80/z80daisy.h"
2628
2729#define VERBOSE 0
2830
r3594r3595
409411
410412   param = (data ? 1 : 0);
411413   LOG(("RDY: %d Active High: %d\n", data, READY_ACTIVE_HIGH(z80dma)));
412   timer_call_after_resynch((void *) device, param, z80dma_rdy_write_callback);
414   timer_call_after_resynch(device->machine, (void *) device, param, z80dma_rdy_write_callback);
413415}
414416
415/* ----------------------------------------------------------------------- */
416417
417/* device interface */
418/***************************************************************************
419    DAISY CHAIN INTERFACE
420***************************************************************************/
418421
422static int z80dma_irq_state(const device_config *device)
423{
424   int state = 0;
425
426   return state;
427}
428
429static int z80dma_irq_ack(const device_config *device)
430{
431   return 0;
432}
433
434static void z80dma_irq_reti(const device_config *device)
435{
436}
437
438/***************************************************************************
439    DEVICE INTERFACE
440***************************************************************************/
441
419442static DEVICE_START( z80dma )
420443{
421444   z80dma_t *z80dma = get_safe_token(device);
r3594r3595
426449
427450   z80dma->intf = device->static_config;
428451
429   z80dma->timer = timer_alloc(z80dma_timerproc, (void *) device);
452   z80dma->timer = timer_alloc(device->machine, z80dma_timerproc, (void *) device);
430453
431454   state_save_register_item_array("z80dma", device->tag, 0, z80dma->regs);
432455   state_save_register_item_array("z80dma", device->tag, 0, z80dma->regs_follow);
r3594r3595
483506      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(z80dma);break;
484507      case DEVINFO_FCT_STOP:                     /* Nothing */                     break;
485508      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(z80dma);break;
509      case DEVINFO_FCT_IRQ_STATE:                  info->f = (genf *)z80dma_irq_state;      break;
510      case DEVINFO_FCT_IRQ_ACK:                  info->f = (genf *)z80dma_irq_ack;      break;
511      case DEVINFO_FCT_IRQ_RETI:                  info->f = (genf *)z80dma_irq_reti;      break;
486512
487513      /* --- the following bits of info are returned as NULL-terminated strings --- */
488514      case DEVINFO_STR_NAME:                     info->s = "Z80DMA";                  break;
src/emu/machine/z80dma.h
r3594r3595
11/**********************************************************************
22
3 8257 DMA interface and emulation
3    Z80 DMA interface and emulation
44
55 **********************************************************************/
66
r3594r3595
2929   write8_device_func   portB_write;
3030
3131   /* interrupt callback - not implemented */
32   /* void (*irqcb)(int state); */
32   void (*irq_cb)(const device_config *device, int state);
3333};
3434
3535/* device interface */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team