diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-08-18 20:11:06 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-08-18 20:11:06 -0400 |
commit | 94ce374f5a29c3c3820030680d601053c8661ce3 (patch) | |
tree | e4f65f2bff6c54d2707bf83b4e37459c6e9ac399 /src/mame | |
parent | d840374aaa6bf32e2038ff473da8ea13d05d5437 (diff) |
i8255: Add handlers for strobed Port A/B reads in Modes 1 & 2; allow some side effects to be disabled (nw)
vdm79322: Z80/8031 communications enabled (nw)
Diffstat (limited to 'src/mame')
-rw-r--r-- | src/mame/drivers/segag80r.cpp | 16 | ||||
-rw-r--r-- | src/mame/drivers/suprloco.cpp | 23 | ||||
-rw-r--r-- | src/mame/drivers/vdm7932x.cpp | 35 | ||||
-rw-r--r-- | src/mame/includes/segag80r.h | 3 | ||||
-rw-r--r-- | src/mame/includes/suprloco.h | 4 |
5 files changed, 45 insertions, 36 deletions
diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp index 12c78f44c01..523cd0929a8 100644 --- a/src/mame/drivers/segag80r.cpp +++ b/src/mame/drivers/segag80r.cpp @@ -111,6 +111,7 @@ #include "machine/segag80.h" #include "cpu/z80/z80.h" +#include "machine/i8255.h" #include "machine/segacrpt_device.h" #include "speaker.h" @@ -296,17 +297,6 @@ WRITE8_MEMBER(segag80r_state::coin_count_w) * *************************************/ -READ8_MEMBER(segag80r_state::sindbadm_sound_data_r) -{ - uint8_t result = m_ppi->read_pa(); - if (!machine().side_effects_disabled()) - { - m_ppi->pc6_w(0); - m_ppi->pc6_w(1); - } - return result; -} - WRITE8_MEMBER(segag80r_state::sindbadm_misc_w) { machine().bookkeeping().coin_counter_w(0, data & 0x02); @@ -401,7 +391,7 @@ void segag80r_state::sindbadm_sound_map(address_map &map) map(0x8000, 0x87ff).mirror(0x1800).ram(); map(0xa000, 0xa003).mirror(0x1ffc).w(FUNC(segag80r_state::sindbadm_sn1_SN76496_w)); map(0xc000, 0xc003).mirror(0x1ffc).w(FUNC(segag80r_state::sindbadm_sn2_SN76496_w)); - map(0xe000, 0xe000).mirror(0x1fff).r(FUNC(segag80r_state::sindbadm_sound_data_r)); + map(0xe000, 0xe000).mirror(0x1fff).r("ppi8255", FUNC(i8255_device::acka_r)); } @@ -915,7 +905,7 @@ MACHINE_CONFIG_START(segag80r_state::monsterb) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_IO_MAP(main_ppi8255_portmap) - MCFG_DEVICE_ADD(m_ppi, I8255A, 0) + MCFG_DEVICE_ADD("ppi8255", I8255A, 0) MCFG_I8255_OUT_PORTA_CB(WRITE8(m_soundbrd, monsterb_sound_device, sound_a_w)) MCFG_I8255_OUT_PORTB_CB(WRITE8(m_soundbrd, monsterb_sound_device, sound_b_w)) MCFG_I8255_IN_PORTC_CB(READ8(m_soundbrd, monsterb_sound_device, n7751_status_r)) diff --git a/src/mame/drivers/suprloco.cpp b/src/mame/drivers/suprloco.cpp index 9c801928411..dbab7bf7e64 100644 --- a/src/mame/drivers/suprloco.cpp +++ b/src/mame/drivers/suprloco.cpp @@ -25,19 +25,12 @@ Sega PCB 834-5137 #include "includes/suprloco.h" #include "cpu/z80/z80.h" +#include "machine/i8255.h" #include "machine/segacrpt_device.h" #include "sound/sn76496.h" #include "screen.h" #include "speaker.h" -READ8_MEMBER(suprloco_state::soundport_r) -{ - m_ppi->pc6_w(0); // ACK signal - uint8_t data = m_ppi->pa_r(space, 0); - m_ppi->pc6_w(1); - return data; -} - void suprloco_state::main_map(address_map &map) { map(0x0000, 0xbfff).rom(); @@ -48,7 +41,7 @@ void suprloco_state::main_map(address_map &map) map(0xd800, 0xd800).portr("P2"); map(0xe000, 0xe000).portr("DSW1"); map(0xe001, 0xe001).portr("DSW2"); - map(0xe800, 0xe803).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xe800, 0xe803).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xf000, 0xf6ff).ram().w(FUNC(suprloco_state::videoram_w)).share("videoram"); map(0xf700, 0xf7df).ram(); /* unused */ map(0xf7e0, 0xf7ff).ram().w(FUNC(suprloco_state::scrollram_w)).share("scrollram"); @@ -67,7 +60,7 @@ void suprloco_state::sound_map(address_map &map) map(0x8000, 0x87ff).ram(); map(0xa000, 0xa003).w("sn1", FUNC(sn76496_device::command_w)); map(0xc000, 0xc003).w("sn2", FUNC(sn76496_device::command_w)); - map(0xe000, 0xe000).r(FUNC(suprloco_state::soundport_r)); + map(0xe000, 0xe000).r("ppi", FUNC(i8255_device::acka_r)); } @@ -183,11 +176,11 @@ MACHINE_CONFIG_START(suprloco_state::suprloco) MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_PERIODIC_INT_DRIVER(suprloco_state, irq0_line_hold, 4*60) /* NMIs are caused by the main CPU */ - I8255A(config, m_ppi, 0); - m_ppi->out_pb_callback().set(FUNC(suprloco_state::control_w)); - m_ppi->tri_pb_callback().set_constant(0); - m_ppi->out_pc_callback().set_output("lamp0").bit(0).invert(); // set by 8255 bit mode when no credits inserted - m_ppi->out_pc_callback().append_inputline(m_audiocpu, INPUT_LINE_NMI).bit(7).invert(); + i8255_device &ppi(I8255A(config, "ppi")); + ppi.out_pb_callback().set(FUNC(suprloco_state::control_w)); + ppi.tri_pb_callback().set_constant(0); + ppi.out_pc_callback().set_output("lamp0").bit(0).invert(); // set by 8255 bit mode when no credits inserted + ppi.out_pc_callback().append_inputline(m_audiocpu, INPUT_LINE_NMI).bit(7).invert(); /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/vdm7932x.cpp b/src/mame/drivers/vdm7932x.cpp index 8ea38ac3cc8..c3e60dd7000 100644 --- a/src/mame/drivers/vdm7932x.cpp +++ b/src/mame/drivers/vdm7932x.cpp @@ -28,6 +28,12 @@ public: void vdm7932x(machine_config &config); private: + virtual void machine_start() override; + + void scan_w(offs_t offset, u8 data); + u8 i8031_p3_r(); + void ppi1_pc_w(u8 data); + void mem_map(address_map &map); void io_map(address_map &map); void sub_map(address_map &map); @@ -35,9 +41,30 @@ private: required_device<z80_device> m_maincpu; required_device<i8031_device> m_subcpu; + bool m_obfa; }; +void vdm7932x_state::machine_start() +{ + m_obfa = false; + save_item(NAME(m_obfa)); +} + +void vdm7932x_state::scan_w(offs_t offset, u8 data) +{ +} + +u8 vdm7932x_state::i8031_p3_r() +{ + return m_obfa ? 0xfd : 0xff; +} + +void vdm7932x_state::ppi1_pc_w(u8 data) +{ + m_obfa = !BIT(data, 7); +} + void vdm7932x_state::mem_map(address_map &map) { map(0x0000, 0xbfff).rom().region("maincpu", 0); @@ -47,6 +74,7 @@ void vdm7932x_state::mem_map(address_map &map) void vdm7932x_state::io_map(address_map &map) { map.global_mask(0xff); + map(0x40, 0x40).nopw(); // ? map(0x44, 0x47).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); map(0x48, 0x4b).w("pit", FUNC(pit8253_device::write)); map(0x54, 0x57).rw("ppi1", FUNC(i8255_device::read), FUNC(i8255_device::write)); @@ -61,6 +89,8 @@ void vdm7932x_state::sub_map(address_map &map) void vdm7932x_state::subx_map(address_map &map) { + map(0x00, 0x00).select(0xff00).w(FUNC(vdm7932x_state::scan_w)); + map(0x49, 0x49).mirror(0xff00).r("ppi1", FUNC(i8255_device::acka_r)); } @@ -83,6 +113,7 @@ void vdm7932x_state::vdm7932x(machine_config &config) // all clocks unverified m_maincpu->set_daisy_config(daisy_chain); I8031(config, m_subcpu, 24.0734_MHz_XTAL / 4); // Intel P8031AH (for keyboard?) + m_subcpu->port_in_cb<3>().set(FUNC(vdm7932x_state::i8031_p3_r)); m_subcpu->set_addrmap(AS_PROGRAM, &vdm7932x_state::sub_map); m_subcpu->set_addrmap(AS_IO, &vdm7932x_state::subx_map); @@ -94,7 +125,9 @@ void vdm7932x_state::vdm7932x(machine_config &config) // all clocks unverified z80sio_device &sio(Z80SIO(config, "sio", 24.0734_MHz_XTAL / 8)); // UA8560D sio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); - I8255A(config, "ppi1"); // КР580ВВ55А (on separate card) + i8255_device &ppi1(I8255A(config, "ppi1")); // КР580ВВ55А (on separate card) + ppi1.out_pc_callback().set(FUNC(vdm7932x_state::ppi1_pc_w)); + I8255A(config, "ppi2"); // КР580ВВ55А (on separate card) } diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h index 550c4b2cc1c..c5aab8b90f0 100644 --- a/src/mame/includes/segag80r.h +++ b/src/mame/includes/segag80r.h @@ -41,7 +41,6 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_ppi(*this, "ppi8255"), m_decrypted_opcodes(*this, "decrypted_opcodes") { } void g80r_base(machine_config &config); @@ -96,7 +95,6 @@ private: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - optional_device<i8255_device> m_ppi; optional_shared_ptr<uint8_t> m_decrypted_opcodes; std::vector<uint8_t> m_paletteram; @@ -151,7 +149,6 @@ private: DECLARE_WRITE8_MEMBER(spaceod_sound_w); DECLARE_WRITE8_MEMBER(usb_ram_w); - DECLARE_READ8_MEMBER(sindbadm_sound_data_r); DECLARE_WRITE8_MEMBER(sindbadm_misc_w); DECLARE_WRITE8_MEMBER(sindbadm_sn1_SN76496_w); DECLARE_WRITE8_MEMBER(sindbadm_sn2_SN76496_w); diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h index e62d46ce2c7..76674f4d4d1 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -5,7 +5,6 @@ #pragma once -#include "machine/i8255.h" #include "emupal.h" class suprloco_state : public driver_device @@ -16,7 +15,6 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_ppi(*this, "ppi"), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_scrollram(*this, "scrollram"), @@ -31,7 +29,6 @@ private: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<gfxdecode_device> m_gfxdecode; - required_device<i8255_device> m_ppi; required_shared_ptr<uint8_t> m_spriteram; required_shared_ptr<uint8_t> m_videoram; @@ -41,7 +38,6 @@ private: tilemap_t *m_bg_tilemap; int m_control; - DECLARE_READ8_MEMBER(soundport_r); DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(scrollram_w); DECLARE_WRITE8_MEMBER(control_w); |