removed implementation of legacy DEVCB_MEMORY_HANDLER and used members instead (nw)

this require clean compile
This commit is contained in:
Miodrag Milanovic 2013-04-24 14:54:54 +00:00
parent f3d0ba23d1
commit ea5d79c9cc
30 changed files with 318 additions and 180 deletions

View File

@ -70,7 +70,6 @@ public:
static ioport_port *resolve_port(const char *tag, device_t &current);
static device_t *resolve_device(int index, const char *tag, device_t &current);
static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current);
static address_space &resolve_space(int index, const char *tag, device_t &current);
};
@ -130,31 +129,6 @@ device_execute_interface *devcb_resolver::resolve_execute_interface(const char *
}
//-------------------------------------------------
// resolve_space - resolve to an address space
// given a device tag and a space index
//-------------------------------------------------
address_space &devcb_resolver::resolve_space(int index, const char *tag, device_t &current)
{
// find our target device
device_t *targetdev = current.siblingdevice(tag);
if (targetdev == NULL)
throw emu_fatalerror("Unable to resolve device '%s' (requested by %s '%s')", tag, current.name(), current.tag());
// make sure the target device has a memory interface
device_memory_interface *memory;
if (!targetdev->interface(memory))
throw emu_fatalerror("Device '%s' (requested by %s '%s') has no memory interface", tag, current.name(), current.tag());
// set the real target and function, then prime a delegate
if (!memory->has_space(index))
throw emu_fatalerror("Unable to find device '%s' space %d (requested by %s '%s')", tag, index, current.name(), current.tag());
return memory->space(index);
}
//**************************************************************************
// DEVCB RESOLVED READ LINE
//**************************************************************************
@ -202,12 +176,6 @@ void devcb_resolved_read_line::resolve(const devcb_read_line &desc, device_t &de
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.read8_space = desc.readspace;
*static_cast<devcb_read_line_delegate *>(this) = devcb_read_line_delegate(&devcb_resolved_read_line::from_read8, desc.name, this);
break;
case DEVCB_TYPE_CONSTANT:
m_object.constant = desc.index;
*static_cast<devcb_read_line_delegate *>(this) = devcb_read_line_delegate(&devcb_resolved_read_line::from_constant, "constant", this);
@ -313,12 +281,6 @@ void devcb_resolved_write_line::resolve(const devcb_write_line &desc, device_t &
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.write8_space = desc.writespace;
*static_cast<devcb_write_line_delegate *>(this) = devcb_write_line_delegate(&devcb_resolved_write_line::to_write8, desc.name, this);
break;
case DEVCB_TYPE_INPUT_LINE:
m_object.execute = devcb_resolver::resolve_execute_interface(desc.tag, device);
m_helper.input_line = desc.index;
@ -437,12 +399,6 @@ void devcb_resolved_read8::resolve(const devcb_read8 &desc, device_t &device)
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.read8_space = desc.readspace;
*static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(&devcb_resolved_read8::from_read8space, desc.name, this);
break;
case DEVCB_TYPE_CONSTANT:
m_object.constant = desc.index;
*static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(&devcb_resolved_read8::from_constant, "constant", this);
@ -572,12 +528,6 @@ void devcb_resolved_write8::resolve(const devcb_write8 &desc, device_t &device)
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.write8_space = desc.writespace;
*static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(&devcb_resolved_write8::to_write8space, desc.name, this);
break;
case DEVCB_TYPE_INPUT_LINE:
m_object.execute = devcb_resolver::resolve_execute_interface(desc.tag, device);
m_helper.input_line = desc.index;
@ -719,11 +669,6 @@ void devcb_resolved_read16::resolve(const devcb_read16 &desc, device_t &device)
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(desc.readspace, desc.name, m_object.space);
break;
case DEVCB_TYPE_CONSTANT:
m_object.constant = desc.index;
*static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(&devcb_resolved_read16::from_constant, "constant", this);
@ -842,11 +787,6 @@ void devcb_resolved_write16::resolve(const devcb_write16 &desc, device_t &device
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(desc.writespace, desc.name, m_object.space);
break;
case DEVCB_TYPE_INPUT_LINE:
m_object.execute = devcb_resolver::resolve_execute_interface(desc.tag, device);
m_helper.input_line = desc.index;
@ -976,11 +916,6 @@ void devcb_resolved_read32::resolve(const devcb_read32 &desc, device_t &device)
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_read32_delegate *>(this) = devcb_read32_delegate(desc.readspace, desc.name, m_object.space);
break;
case DEVCB_TYPE_CONSTANT:
m_object.constant = desc.index;
*static_cast<devcb_read32_delegate *>(this) = devcb_read32_delegate(&devcb_resolved_read32::from_constant, "constant", this);
@ -1099,11 +1034,6 @@ void devcb_resolved_write32::resolve(const devcb_write32 &desc, device_t &device
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_write32_delegate *>(this) = devcb_write32_delegate(desc.writespace, desc.name, m_object.space);
break;
case DEVCB_TYPE_INPUT_LINE:
m_object.execute = devcb_resolver::resolve_execute_interface(desc.tag, device);
m_helper.input_line = desc.index;
@ -1233,11 +1163,6 @@ void devcb_resolved_read64::resolve(const devcb_read64 &desc, device_t &device)
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_read64_delegate *>(this) = devcb_read64_delegate(desc.readspace, desc.name, m_object.space);
break;
case DEVCB_TYPE_CONSTANT:
m_object.constant = desc.index;
*static_cast<devcb_read64_delegate *>(this) = devcb_read64_delegate(&devcb_resolved_read64::from_constant, "constant", this);
@ -1356,11 +1281,6 @@ void devcb_resolved_write64::resolve(const devcb_write64 &desc, device_t &device
}
break;
case DEVCB_TYPE_LEGACY_SPACE:
m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_write64_delegate *>(this) = devcb_write64_delegate(desc.writespace, desc.name, m_object.space);
break;
case DEVCB_TYPE_INPUT_LINE:
m_object.execute = devcb_resolver::resolve_execute_interface(desc.tag, device);
m_helper.input_line = desc.index;

View File

@ -100,7 +100,6 @@ enum
DEVCB_TYPE_NULL = 0, // NULL callback
DEVCB_TYPE_IOPORT, // I/O port read/write
DEVCB_TYPE_DEVICE, // device read/write
DEVCB_TYPE_LEGACY_SPACE, // legacy address space read/write
DEVCB_TYPE_INPUT_LINE, // device input line write
DEVCB_TYPE_CONSTANT, // constant value read
DEVCB_TYPE_UNMAP // unmapped line
@ -229,9 +228,6 @@ void devcb_stub64(device_t *device, address_space &space, offs_t offset, UINT64
#define DEVCB_UNMAPPED { DEVCB_TYPE_UNMAP, 0, NULL, NULL, NULL, NULL }
// read/write handlers for a given CPU's address space
#define DEVCB_MEMORY_HANDLER(cpu,space,func) { DEVCB_TYPE_LEGACY_SPACE, AS_##space, (cpu), #func, NULL, NULL, func }
// read handlers for an I/O port by tag
#define DEVCB_INPUT_PORT(tag) { DEVCB_TYPE_IOPORT, 0, (tag), NULL, NULL, NULL, NULL }

View File

@ -330,16 +330,6 @@ Donkey Kong Junior Notes
#define COMBINE_TYPE_PC(_tyn, _pc) ((_tyn)<<16 | (_pc))
/*************************************
*
* Prototypes
*
*************************************/
/*************************************
*
@ -347,16 +337,25 @@ Donkey Kong Junior Notes
*
*************************************/
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(dkong_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(dkong_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dk3_dma )
{
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_HALT),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(dkong_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(dkong_state, memory_write_byte),
DEVCB_NULL,
DEVCB_NULL
};
@ -366,8 +365,8 @@ static I8257_INTERFACE( dk_dma )
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_HALT),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(dkong_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(dkong_state, memory_write_byte),
{ DEVCB_NULL, DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_r), DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DRIVER_MEMBER(dkong_state,p8257_ctl_w), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
};

View File

@ -101,16 +101,25 @@ write:
*
*************************************/
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(mario_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(mario_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( mario_dma )
{
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_HALT),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(mario_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(mario_state, memory_write_byte),
DEVCB_NULL,
DEVCB_NULL
};

View File

@ -2895,12 +2895,22 @@ static INPUT_PORTS_START( nightlov )
INPUT_PORTS_END
READ8_MEMBER(nbmj8688_state::dipsw1_r)
{
return nb1413m3_dipsw1_r(space,offset);
}
READ8_MEMBER(nbmj8688_state::dipsw2_r)
{
return nb1413m3_dipsw2_r(space,offset);
}
static const ay8910_interface ay8910_config =
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
DEVCB_MEMORY_HANDLER("maincpu", IO, nb1413m3_dipsw1_r), // DIPSW-A read
DEVCB_MEMORY_HANDLER("maincpu", IO, nb1413m3_dipsw2_r), // DIPSW-B read
DEVCB_DRIVER_MEMBER(nbmj8688_state, dipsw1_r), // DIPSW-A read
DEVCB_DRIVER_MEMBER(nbmj8688_state, dipsw2_r), // DIPSW-B read
DEVCB_NULL,
DEVCB_NULL
};

View File

@ -239,6 +239,9 @@ public:
void dkong_init_device_driver_data( );
void braze_decrypt_rom(UINT8 *dest);
void drakton_decrypt_rom(UINT8 mod, int offs, int *bs);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_soundcpu;
optional_device<eeprom_device> m_eeprom;

View File

@ -92,6 +92,8 @@ public:
DECLARE_WRITE8_MEMBER(mario_sh_sound_w);
DECLARE_WRITE8_MEMBER(mario_sh1_w);
DECLARE_WRITE8_MEMBER(mario_sh2_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;

View File

@ -88,6 +88,8 @@ public:
DECLARE_VIDEO_START(mbmj8688_hybrid_16bit);
DECLARE_VIDEO_START(mbmj8688_hybrid_12bit);
DECLARE_VIDEO_START(mbmj8688_pure_16bit);
DECLARE_READ8_MEMBER(dipsw1_r);
DECLARE_READ8_MEMBER(dipsw2_r);
UINT32 screen_update_mbmj8688(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mbmj8688_lcd0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mbmj8688_lcd1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

View File

@ -36,6 +36,8 @@ public:
DECLARE_WRITE8_MEMBER(b16_6845_data_w);
DECLARE_READ8_MEMBER(unk_dev_r);
DECLARE_WRITE8_MEMBER(unk_dev_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -264,15 +266,24 @@ static MC6845_INTERFACE( mc6845_intf )
NULL /* update address callback */
};
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(b16_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(b16_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
static I8237_INTERFACE( b16_dma8237_interface )
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(b16_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(b16_state, memory_write_byte),
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }

View File

@ -147,6 +147,10 @@ public:
DECLARE_DRIVER_INIT(bigbord2);
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
DECLARE_WRITE_LINE_MEMBER(bigbord2_interrupt);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
/* Status port
@ -211,18 +215,40 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
/* Z80 DMA */
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(bigbord2_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(bigbord2_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
READ8_MEMBER(bigbord2_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(bigbord2_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT), // actually BUSRQ
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(bigbord2_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(bigbord2_state, memory_write_byte),
DEVCB_DRIVER_MEMBER(bigbord2_state, io_read_byte),
DEVCB_DRIVER_MEMBER(bigbord2_state, io_write_byte),
};

View File

@ -847,8 +847,18 @@ WRITE8_MEMBER( bullet_state::dma_mreq_w )
}
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(bullet_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(bullet_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
{
@ -857,8 +867,8 @@ static Z80DMA_INTERFACE( dma_intf )
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(bullet_state, dma_mreq_r),
DEVCB_DRIVER_MEMBER(bullet_state, dma_mreq_w),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(bullet_state, io_read_byte),
DEVCB_DRIVER_MEMBER(bullet_state, io_write_byte)
};
@ -899,8 +909,8 @@ static Z80DMA_INTERFACE( bulletf_dma_intf )
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(bulletf_state, dma_mreq_r),
DEVCB_DRIVER_MEMBER(bulletf_state, dma_mreq_w),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(bullet_state, io_read_byte),
DEVCB_DRIVER_MEMBER(bullet_state, io_write_byte)
};

View File

@ -48,6 +48,8 @@ public:
DECLARE_WRITE8_MEMBER(kb_ctrl_mcu_w);
DECLARE_READ8_MEMBER(fdc_dma_r);
DECLARE_WRITE8_MEMBER(fdc_dma_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
void fdc_irq(bool state);
void fdc_drq(bool state);
@ -283,15 +285,24 @@ WRITE_LINE_MEMBER( dmv_state::dma_hrq_changed )
m_dmac->i8237_hlda_w(state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(dmv_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(dmv_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
static I8237_INTERFACE( dmv_dma8237_config )
{
DEVCB_DRIVER_LINE_MEMBER(dmv_state, dma_hrq_changed),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(dmv_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(dmv_state, memory_write_byte),
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(dmv_state, fdc_dma_r) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(dmv_state, fdc_dma_w) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }

View File

@ -107,6 +107,10 @@ public:
DECLARE_WRITE_LINE_MEMBER( p8k_16_daisy_interrupt );
DECLARE_WRITE16_MEMBER( pk8_16_sio_0_serial_transmit );
DECLARE_WRITE16_MEMBER( pk8_16_sio_1_serial_transmit );
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
/***************************************************************************
@ -241,18 +245,39 @@ WRITE_LINE_MEMBER( p8k_state::p8k_dma_irq_w )
p8k_daisy_interrupt(state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(p8k_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(p8k_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
READ8_MEMBER(p8k_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(p8k_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( p8k_dma_intf )
{
DEVCB_DRIVER_LINE_MEMBER(p8k_state, p8k_dma_irq_w),
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_MEMORY_HANDLER("maincpu", IO, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(p8k_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(p8k_state, memory_write_byte),
DEVCB_DRIVER_MEMBER(p8k_state, io_read_byte),
DEVCB_DRIVER_MEMBER(p8k_state, io_write_byte)
};
/* Z80 CTC 0 */

View File

@ -115,6 +115,8 @@ public:
DECLARE_WRITE8_MEMBER( vram_bank_w );
DECLARE_READ8_MEMBER( vram_r );
DECLARE_WRITE8_MEMBER( vram_w );
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
UINT8 *m_char_rom;
@ -392,15 +394,24 @@ WRITE_LINE_MEMBER( qx10_state::tc_w )
Channel 2: GDC
Channel 3: Option slots
*/
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(qx10_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(qx10_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
static I8237_INTERFACE( qx10_dma8237_1_interface )
{
DEVCB_DRIVER_LINE_MEMBER(qx10_state,dma_hrq_changed),
DEVCB_DRIVER_LINE_MEMBER(qx10_state, tc_w),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(qx10_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(qx10_state, memory_write_byte),
{ DEVCB_DRIVER_MEMBER(qx10_state, fdc_dma_r), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_r),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_r)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DRIVER_MEMBER(qx10_state, fdc_dma_w), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_w),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_w)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }

View File

@ -391,18 +391,39 @@ static Z80DART_INTERFACE( dart_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(super6_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(super6_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
READ8_MEMBER(super6_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(super6_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT),
DEVCB_DEVICE_LINE_MEMBER(Z80CTC_TAG, z80ctc_device, trg2),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(super6_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(super6_state, memory_write_byte),
DEVCB_DRIVER_MEMBER(super6_state, io_read_byte),
DEVCB_DRIVER_MEMBER(super6_state, io_write_byte),
};

View File

@ -525,8 +525,17 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(trs80m2_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(trs80m2_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
{
@ -535,8 +544,8 @@ static Z80DMA_INTERFACE( dma_intf )
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(trs80m2_state, read),
DEVCB_DRIVER_MEMBER(trs80m2_state, write),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(trs80m2_state, io_read_byte),
DEVCB_DRIVER_MEMBER(trs80m2_state, io_write_byte),
};

View File

@ -449,14 +449,18 @@ WRITE_LINE_MEMBER( vidbrain_state::hblank_w )
}
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
READ8_MEMBER(vidbrain_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
static UV201_INTERFACE( uv_intf )
{
SCREEN_TAG,
DEVCB_DRIVER_LINE_MEMBER(vidbrain_state, ext_int_w),
DEVCB_DRIVER_LINE_MEMBER(vidbrain_state, hblank_w),
DEVCB_MEMORY_HANDLER(F3850_TAG, PROGRAM, memory_read_byte)
DEVCB_DRIVER_MEMBER(vidbrain_state, memory_read_byte)
};

View File

@ -1895,18 +1895,39 @@ static MC6845_INTERFACE( mc6845_intf )
NULL /* update address callback */
};
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(x1_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(x1_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
READ8_MEMBER(x1_state::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(x1_state::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( x1_dma )
{
DEVCB_CPU_INPUT_LINE("x1_cpu", INPUT_LINE_HALT),
DEVCB_CPU_INPUT_LINE("x1_cpu", INPUT_LINE_IRQ0),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("x1_cpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("x1_cpu", PROGRAM, memory_write_byte),
DEVCB_MEMORY_HANDLER("x1_cpu", IO, memory_read_byte),
DEVCB_MEMORY_HANDLER("x1_cpu", IO, memory_write_byte)
DEVCB_DRIVER_MEMBER(x1_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(x1_state, memory_write_byte),
DEVCB_DRIVER_MEMBER(x1_state, io_read_byte),
DEVCB_DRIVER_MEMBER(x1_state, io_write_byte)
};
/*************************************
@ -1917,7 +1938,7 @@ static Z80DMA_INTERFACE( x1_dma )
INPUT_CHANGED_MEMBER(x1_state::ipl_reset)
{
m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
m_ram_bank = 0x00;
if(m_is_turbo) { m_ex_bank = 0x10; }
@ -1927,7 +1948,7 @@ INPUT_CHANGED_MEMBER(x1_state::ipl_reset)
/* Apparently most games doesn't support this (not even the Konami ones!), one that does is...177 :o */
INPUT_CHANGED_MEMBER(x1_state::nmi_reset)
{
m_x1_cpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
INPUT_PORTS_START( x1 )
@ -2368,7 +2389,7 @@ IRQ_CALLBACK_MEMBER(x1_state::x1_irq_callback)
TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback)
{
address_space &space = m_x1_cpu->space(AS_PROGRAM);
address_space &space = m_maincpu->space(AS_PROGRAM);
UINT32 key1 = ioport("key1")->read();
UINT32 key2 = ioport("key2")->read();
UINT32 key3 = ioport("key3")->read();
@ -2386,7 +2407,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback)
x1_sub_io_w(space,0,0xe6);
m_irq_vector = m_key_irq_vector;
m_key_irq_flag = 1;
m_x1_cpu->set_input_line(0,ASSERT_LINE);
m_maincpu->set_input_line(0,ASSERT_LINE);
m_old_key1 = key1;
m_old_key2 = key2;
m_old_key3 = key3;

View File

@ -111,9 +111,9 @@ static MC6845_INTERFACE( mc6845_intf )
INPUT_CHANGED_MEMBER(x1twin_state::ipl_reset)
{
//address_space &space = m_x1_cpu->space(AS_PROGRAM);
//address_space &space = m_maincpu->space(AS_PROGRAM);
m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
m_ram_bank = 0x00;
if(m_is_turbo) { m_ex_bank = 0x10; }
@ -123,7 +123,7 @@ INPUT_CHANGED_MEMBER(x1twin_state::ipl_reset)
/* Apparently most games doesn't support this (not even the Konami ones!), one that does is...177 :o */
INPUT_CHANGED_MEMBER(x1twin_state::nmi_reset)
{
m_x1_cpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
INPUT_PORTS_START( x1twin )

View File

@ -121,6 +121,8 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
DECLARE_WRITE_LINE_MEMBER(dart_rxtxca_w);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
class bulletf_state : public bullet_state

View File

@ -72,7 +72,8 @@ public:
DECLARE_WRITE8_MEMBER(radio86_romdisk_portb_w);
DECLARE_WRITE8_MEMBER(radio86_romdisk_portc_w);
DECLARE_WRITE8_MEMBER(mikrosha_8255_font_page_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
required_device<cpu_device> m_maincpu;
protected:
required_device<cassette_image_device> m_cassette;

View File

@ -78,6 +78,10 @@ public:
UINT8 m_bank1;
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
DECLARE_WRITE8_MEMBER(dummy_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
#endif

View File

@ -126,6 +126,8 @@ public:
int m_enable_rtc_int;
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
class trs80m16_state : public trs80m2_state

View File

@ -96,6 +96,8 @@ public:
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
DECLARE_WRITE_LINE_MEMBER( ext_int_w );
DECLARE_WRITE_LINE_MEMBER( hblank_w );
DECLARE_READ8_MEMBER(memory_read_byte);
IRQ_CALLBACK_MEMBER(vidbrain_int_ack);

View File

@ -75,14 +75,14 @@ class x1_state : public driver_device
public:
x1_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_x1_cpu(*this,"x1_cpu"),
m_maincpu(*this,"x1_cpu"),
m_cassette(*this, "cassette"),
m_fdc(*this, "fdc"),
m_crtc(*this, "crtc"),
m_ctc(*this, "ctc")
{ }
required_device<cpu_device> m_x1_cpu;
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
required_device<mb8877_device> m_fdc;
required_device<mc6845_device> m_crtc;
@ -223,6 +223,11 @@ public:
int priority_mixer_pri(int color);
void cmt_command( UINT8 cmd );
UINT16 jis_convert(int kanji_addr);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
};
/*----------- defined in machine/x1.c -----------*/

View File

@ -219,18 +219,39 @@ WRITE_LINE_MEMBER( luxor_55_21046_device::dma_int_w )
m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_fdc_irq || m_dma_irq);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(luxor_55_21046_device::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(luxor_55_21046_device::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
READ8_MEMBER(luxor_55_21046_device::io_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(luxor_55_21046_device::io_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_IO);
return prog_space.write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21046_device, dma_int_w),
DEVCB_NULL,
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21046_device, memory_read_byte),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21046_device, memory_write_byte),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21046_device, io_read_byte),
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21046_device, io_write_byte),
};

View File

@ -71,6 +71,11 @@ public:
DECLARE_WRITE_LINE_MEMBER( dma_int_w );
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
DECLARE_READ8_MEMBER(io_read_byte);
DECLARE_WRITE8_MEMBER(io_write_byte);
void fdc_intrq_w(bool state);
void fdc_drq_w(bool state);

View File

@ -363,16 +363,13 @@ WRITE_LINE_MEMBER(partner_state::hrq_w)
machine().device<i8257_device>("dma8257")->i8257_hlda_w(state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
I8257_INTERFACE( partner_dma )
{
DEVCB_DRIVER_LINE_MEMBER(partner_state,hrq_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(radio86_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(radio86_state, memory_write_byte),
{ DEVCB_DEVICE_HANDLER("wd1793", wd17xx_data_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DEVICE_HANDLER("wd1793", wd17xx_data_w), DEVCB_NULL, DEVCB_DEVICE_MEMBER("i8275", i8275_device, dack_w), DEVCB_NULL }
};

View File

@ -134,16 +134,25 @@ WRITE_LINE_MEMBER(radio86_state::hrq_w)
m_dma8257->i8257_hlda_w(state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER(radio86_state::memory_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.read_byte(offset);
}
WRITE8_MEMBER(radio86_state::memory_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
return prog_space.write_byte(offset, data);
}
I8257_INTERFACE( radio86_dma )
{
DEVCB_DRIVER_LINE_MEMBER(radio86_state,hrq_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
DEVCB_DRIVER_MEMBER(radio86_state, memory_read_byte),
DEVCB_DRIVER_MEMBER(radio86_state, memory_write_byte),
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_MEMBER("i8275", i8275_device, dack_w), DEVCB_NULL }
};

View File

@ -53,7 +53,7 @@ int x1_keyboard_device::z80daisy_irq_ack()
{
x1_state *state = machine().driver_data<x1_state>();
state->m_key_irq_flag = 0;
state->m_x1_cpu->set_input_line(INPUT_LINE_IRQ0,CLEAR_LINE);
state->m_maincpu->set_input_line(INPUT_LINE_IRQ0,CLEAR_LINE);
return state->m_key_irq_vector;
}