From 39ce71dda0bb7fb053e5343441c64c1dfc60cd12 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 11 Jun 2021 05:26:50 +1000 Subject: [PATCH] mbee: added optional SN76489A, works with '128pepsgmod' sw-item. --- hash/mbee_flop.xml | 2 +- src/mame/drivers/mbee.cpp | 15 +++++++++++++-- src/mame/includes/mbee.h | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/hash/mbee_flop.xml b/hash/mbee_flop.xml index 82e889fc279..559a945527e 100644 --- a/hash/mbee_flop.xml +++ b/hash/mbee_flop.xml @@ -5629,7 +5629,7 @@ At the time of writing (2021-06-04) any floppy image will work in any emulated d - + EPSGmod Files 19?? <unknown> diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index 06c41e6bc2c..ce5bea06fd8 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -129,6 +129,7 @@ from Brett Selwood and Andrew Davies. #include "emu.h" #include "includes/mbee.h" #include "formats/mbee_cas.h" +#include "sound/sn76496.h" #include "speaker.h" void mbee_state::mbee_mem(address_map &map) @@ -288,6 +289,14 @@ void mbee_state::mbee128_io(address_map &map) map(0x50, 0x57).w(FUNC(mbee_state::port50_w)); } +void mbee_state::mbee128p_io(address_map &map) +{ + map.global_mask(0xff); + map.unmap_value_high(); + mbee128_io(map); + map(0x10, 0x13).w("sn1", FUNC(sn76489a_device::write)); +} + void mbee_state::mbee256_io(address_map &map) { map.unmap_value_high(); @@ -301,7 +310,7 @@ void mbee_state::mbee256_io(address_map &map) map(0x000b, 0x000b).mirror(0xff00).w(FUNC(mbee_state::port0b_w)); map(0x000c, 0x000c).mirror(0xff00).r(m_crtc, FUNC(mc6845_device::status_r)).w(FUNC(mbee_state::m6545_index_w)); map(0x000d, 0x000d).mirror(0xff00).r(m_crtc, FUNC(mc6845_device::register_r)).w(FUNC(mbee_state::m6545_data_w)); - // map(0x0010, 0x0013).mirror(0xff00); Optional SN76489AN audio chip (never used) + map(0x0010, 0x0013).mirror(0xff00).w("sn1", FUNC(sn76489a_device::write)); map(0x0018, 0x001b).mirror(0xff00).r(FUNC(mbee_state::port18_r)); map(0x001c, 0x001f).mirror(0xff00).rw(FUNC(mbee_state::port1c_r), FUNC(mbee_state::port1c_w)); map(0x0044, 0x0047).mirror(0xff00).rw(m_fdc, FUNC(wd2793_device::read), FUNC(wd2793_device::write)); @@ -836,7 +845,7 @@ void mbee_state::mbee128p(machine_config &config) { mbeeppc(config); m_maincpu->set_addrmap(AS_PROGRAM, &mbee_state::mbee256_mem); - m_maincpu->set_addrmap(AS_IO, &mbee_state::mbee128_io); + m_maincpu->set_addrmap(AS_IO, &mbee_state::mbee128p_io); WD2793(config, m_fdc, 4_MHz_XTAL / 2); m_fdc->intrq_wr_callback().set(FUNC(mbee_state::fdc_intrq_w)); @@ -845,6 +854,8 @@ void mbee_state::mbee128p(machine_config &config) FLOPPY_CONNECTOR(config, m_floppy0, mbee_floppies, "35dd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, m_floppy1, mbee_floppies, "35dd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true); + SN76489A(config, "sn1", 13.5_MHz_XTAL / 4).add_route(ALL_OUTPUTS, "mono", 0.50); + SOFTWARE_LIST(config, "flop_list").set_original("mbee_flop").set_filter("3"); remove_carts(config); remove_quick(config); diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index 8958ae2bb52..404601064ab 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -140,6 +140,7 @@ private: required_device m_palette; void mbee128_io(address_map &map); + void mbee128p_io(address_map &map); void mbee256_io(address_map &map); void mbee256_mem(address_map &map); void mbee56_io(address_map &map);