From ea5d79c9cc941a0298cfd4bcd5fe88146fc9c2da Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 24 Apr 2013 14:54:54 +0000 Subject: [PATCH] removed implementation of legacy DEVCB_MEMORY_HANDLER and used members instead (nw) this require clean compile --- src/emu/devcb.c | 80 ------------------------------------ src/emu/devcb.h | 4 -- src/mame/drivers/dkong.c | 31 +++++++------- src/mame/drivers/mario.c | 17 ++++++-- src/mame/drivers/nbmj8688.c | 14 ++++++- src/mame/includes/dkong.h | 3 ++ src/mame/includes/mario.h | 2 + src/mame/includes/nbmj8688.h | 2 + src/mess/drivers/b16.c | 19 +++++++-- src/mess/drivers/bigbord2.c | 38 ++++++++++++++--- src/mess/drivers/bullet.c | 22 +++++++--- src/mess/drivers/dmv.c | 19 +++++++-- src/mess/drivers/p8k.c | 37 ++++++++++++++--- src/mess/drivers/qx10.c | 19 +++++++-- src/mess/drivers/super6.c | 33 ++++++++++++--- src/mess/drivers/trs80m2.c | 17 ++++++-- src/mess/drivers/vidbrain.c | 8 +++- src/mess/drivers/x1.c | 41 +++++++++++++----- src/mess/drivers/x1twin.c | 6 +-- src/mess/includes/bullet.h | 2 + src/mess/includes/radio86.h | 3 +- src/mess/includes/super6.h | 4 ++ src/mess/includes/trs80m2.h | 2 + src/mess/includes/vidbrain.h | 2 + src/mess/includes/x1.h | 9 +++- src/mess/machine/lux21046.c | 33 ++++++++++++--- src/mess/machine/lux21046.h | 5 +++ src/mess/machine/partner.c | 7 +--- src/mess/machine/radio86.c | 17 ++++++-- src/mess/machine/x1.c | 2 +- 30 files changed, 318 insertions(+), 180 deletions(-) diff --git a/src/emu/devcb.c b/src/emu/devcb.c index 6faa1d10db1..d44195e558a 100644 --- a/src/emu/devcb.c +++ b/src/emu/devcb.c @@ -70,7 +70,6 @@ public: static ioport_port *resolve_port(const char *tag, device_t ¤t); static device_t *resolve_device(int index, const char *tag, device_t ¤t); static device_execute_interface *resolve_execute_interface(const char *tag, device_t ¤t); - static address_space &resolve_space(int index, const char *tag, device_t ¤t); }; @@ -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 ¤t) -{ - // 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(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(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(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(this) = devcb_read8_delegate(&devcb_resolved_read8::from_read8space, desc.name, this); - break; - case DEVCB_TYPE_CONSTANT: m_object.constant = desc.index; *static_cast(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(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(this) = devcb_read16_delegate(desc.readspace, desc.name, m_object.space); - break; - case DEVCB_TYPE_CONSTANT: m_object.constant = desc.index; *static_cast(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(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(this) = devcb_read32_delegate(desc.readspace, desc.name, m_object.space); - break; - case DEVCB_TYPE_CONSTANT: m_object.constant = desc.index; *static_cast(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(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(this) = devcb_read64_delegate(desc.readspace, desc.name, m_object.space); - break; - case DEVCB_TYPE_CONSTANT: m_object.constant = desc.index; *static_cast(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(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; diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 0afbc113f3f..2fec0504540 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -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 } diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index 8db942ac8ac..e75637b6e54 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -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 } }; diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c index 28f061faa59..e4dd20a5e9e 100644 --- a/src/mame/drivers/mario.c +++ b/src/mame/drivers/mario.c @@ -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 }; diff --git a/src/mame/drivers/nbmj8688.c b/src/mame/drivers/nbmj8688.c index 840f5a167c8..39d67d0bb00 100644 --- a/src/mame/drivers/nbmj8688.c +++ b/src/mame/drivers/nbmj8688.c @@ -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 }; diff --git a/src/mame/includes/dkong.h b/src/mame/includes/dkong.h index 9ab6ed1abbf..fd8a413505a 100644 --- a/src/mame/includes/dkong.h +++ b/src/mame/includes/dkong.h @@ -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 m_maincpu; optional_device m_soundcpu; optional_device m_eeprom; diff --git a/src/mame/includes/mario.h b/src/mame/includes/mario.h index 72f9b235317..669ce1ef15d 100644 --- a/src/mame/includes/mario.h +++ b/src/mame/includes/mario.h @@ -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 m_maincpu; required_device m_audiocpu; diff --git a/src/mame/includes/nbmj8688.h b/src/mame/includes/nbmj8688.h index ce26c05e3ca..57f513a13e6 100644 --- a/src/mame/includes/nbmj8688.h +++ b/src/mame/includes/nbmj8688.h @@ -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); diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c index dcae69fd6e5..188427cc4bc 100644 --- a/src/mess/drivers/b16.c +++ b/src/mess/drivers/b16.c @@ -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 } diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c index ca1b466ea8a..b8fc75aabb9 100644 --- a/src/mess/drivers/bigbord2.c +++ b/src/mess/drivers/bigbord2.c @@ -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), + }; diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c index baf5a82b540..00fbab47383 100644 --- a/src/mess/drivers/bullet.c +++ b/src/mess/drivers/bullet.c @@ -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) }; diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c index d4765f5d1c9..1ed626ae089 100644 --- a/src/mess/drivers/dmv.c +++ b/src/mess/drivers/dmv.c @@ -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 } diff --git a/src/mess/drivers/p8k.c b/src/mess/drivers/p8k.c index 8845596cea0..65184af235b 100644 --- a/src/mess/drivers/p8k.c +++ b/src/mess/drivers/p8k.c @@ -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 */ diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c index be42699606a..00eb001df04 100644 --- a/src/mess/drivers/qx10.c +++ b/src/mess/drivers/qx10.c @@ -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 } diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c index 52906cf4993..b992ffd5f0f 100644 --- a/src/mess/drivers/super6.c +++ b/src/mess/drivers/super6.c @@ -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), }; diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c index f726116d2fa..aa528c2bad7 100644 --- a/src/mess/drivers/trs80m2.c +++ b/src/mess/drivers/trs80m2.c @@ -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), }; diff --git a/src/mess/drivers/vidbrain.c b/src/mess/drivers/vidbrain.c index 2aa75260a65..baf4dfe75eb 100644 --- a/src/mess/drivers/vidbrain.c +++ b/src/mess/drivers/vidbrain.c @@ -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) }; diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index fb17b0bdabe..0f16e6dc228 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -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; diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index aeafe8e7626..4de80432447 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -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 ) diff --git a/src/mess/includes/bullet.h b/src/mess/includes/bullet.h index fffc846d61a..1f4b8feef66 100644 --- a/src/mess/includes/bullet.h +++ b/src/mess/includes/bullet.h @@ -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 diff --git a/src/mess/includes/radio86.h b/src/mess/includes/radio86.h index fcbaf802ce3..baa7f0f44ba 100644 --- a/src/mess/includes/radio86.h +++ b/src/mess/includes/radio86.h @@ -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 m_maincpu; protected: required_device m_cassette; diff --git a/src/mess/includes/super6.h b/src/mess/includes/super6.h index 7520eef3edd..f22692fdfcd 100644 --- a/src/mess/includes/super6.h +++ b/src/mess/includes/super6.h @@ -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 diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h index 77b41a28409..615274c8d12 100644 --- a/src/mess/includes/trs80m2.h +++ b/src/mess/includes/trs80m2.h @@ -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 diff --git a/src/mess/includes/vidbrain.h b/src/mess/includes/vidbrain.h index bd99b1f4730..3c5ee381e9e 100644 --- a/src/mess/includes/vidbrain.h +++ b/src/mess/includes/vidbrain.h @@ -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); diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h index eae13315e75..b1cdd0663bc 100644 --- a/src/mess/includes/x1.h +++ b/src/mess/includes/x1.h @@ -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 m_x1_cpu; + required_device m_maincpu; required_device m_cassette; required_device m_fdc; required_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 -----------*/ diff --git a/src/mess/machine/lux21046.c b/src/mess/machine/lux21046.c index d8ac6aa8319..343ca959c25 100644 --- a/src/mess/machine/lux21046.c +++ b/src/mess/machine/lux21046.c @@ -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), }; diff --git a/src/mess/machine/lux21046.h b/src/mess/machine/lux21046.h index c313406199a..3fdb66f7ba5 100644 --- a/src/mess/machine/lux21046.h +++ b/src/mess/machine/lux21046.h @@ -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); diff --git a/src/mess/machine/partner.c b/src/mess/machine/partner.c index 53b05e726dd..302d55fe9db 100644 --- a/src/mess/machine/partner.c +++ b/src/mess/machine/partner.c @@ -363,16 +363,13 @@ WRITE_LINE_MEMBER(partner_state::hrq_w) machine().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 } }; diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c index 291f2c2b906..a8546c67064 100644 --- a/src/mess/machine/radio86.c +++ b/src/mess/machine/radio86.c @@ -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 } }; diff --git a/src/mess/machine/x1.c b/src/mess/machine/x1.c index 06959415aa9..edecd6bbb5d 100644 --- a/src/mess/machine/x1.c +++ b/src/mess/machine/x1.c @@ -53,7 +53,7 @@ int x1_keyboard_device::z80daisy_irq_ack() { x1_state *state = machine().driver_data(); 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; }