diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index 7b2153e249b..baaf4d4a4cb 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -241,11 +241,10 @@ void mbee_state::mbeepc_io(address_map &map) map(0x0000, 0x0003).mirror(0xff10).rw(m_pio, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); map(0x0008, 0x0008).mirror(0xff10).rw(FUNC(mbee_state::port08_r), FUNC(mbee_state::port08_w)); map(0x0009, 0x0009).mirror(0xff00).nopw(); + map(0x000a, 0x000a).select(0xff10).rw(FUNC(mbee_state::telcom_r), FUNC(mbee_state::port0a_w)); map(0x000b, 0x000b).mirror(0xff10).w(FUNC(mbee_state::port0b_w)); map(0x000c, 0x000c).mirror(0xff10).r(m_crtc, FUNC(mc6845_device::status_r)).w(FUNC(mbee_state::m6545_index_w)); map(0x000d, 0x000d).mirror(0xff10).r(m_crtc, FUNC(mc6845_device::register_r)).w(FUNC(mbee_state::m6545_data_w)); - map(0x000a, 0x000a).mirror(0xfe10).rw(FUNC(mbee_state::telcom_low_r), FUNC(mbee_state::port0a_w)); - map(0x010a, 0x010a).mirror(0xfe10).rw(FUNC(mbee_state::telcom_high_r), FUNC(mbee_state::port0a_w)); } void mbee_state::mbeeppc_io(address_map &map) @@ -254,12 +253,11 @@ void mbee_state::mbeeppc_io(address_map &map) map(0x0000, 0x0003).mirror(0xff10).rw(m_pio, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); map(0x0008, 0x0008).mirror(0xff10).rw(FUNC(mbee_state::port08_r), FUNC(mbee_state::port08_w)); map(0x0009, 0x0009).mirror(0xff00).nopw(); + map(0x000a, 0x000a).select(0xff10).rw(FUNC(mbee_state::telcom_r), FUNC(mbee_state::port0a_w)); map(0x000b, 0x000b).mirror(0xff10).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(0xff10).r(m_crtc, FUNC(mc6845_device::register_r)).w(FUNC(mbee_state::m6545_data_w)); map(0x001c, 0x001c).mirror(0xff00).rw(FUNC(mbee_state::port1c_r), FUNC(mbee_state::port1c_w)); - map(0x000a, 0x000a).mirror(0xfe10).rw(FUNC(mbee_state::telcom_low_r), FUNC(mbee_state::port0a_w)); - map(0x010a, 0x010a).mirror(0xfe10).rw(FUNC(mbee_state::telcom_high_r), FUNC(mbee_state::port0a_w)); } void mbee_state::mbeett_io(address_map &map) @@ -270,15 +268,13 @@ void mbee_state::mbeett_io(address_map &map) map(0x0006, 0x0006).mirror(0xff00).w(FUNC(mbee_state::port06_w)); map(0x0007, 0x0007).mirror(0xff00).r(FUNC(mbee_state::port07_r)); map(0x0008, 0x0008).mirror(0xff00).rw(FUNC(mbee_state::port08_r), FUNC(mbee_state::port08_w)); + map(0x000a, 0x000a).select(0xff10).rw(FUNC(mbee_state::telcom_r), FUNC(mbee_state::port0a_w)); 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(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(0x0009, 0x0009).mirror(0xfe00).r(FUNC(mbee_state::speed_low_r)); - map(0x0109, 0x0109).mirror(0xfe00).r(FUNC(mbee_state::speed_high_r)); - map(0x000a, 0x000a).mirror(0xfe00).rw(FUNC(mbee_state::telcom_low_r), FUNC(mbee_state::port0a_w)); - map(0x010a, 0x010a).mirror(0xfe00).rw(FUNC(mbee_state::telcom_high_r), FUNC(mbee_state::port0a_w)); + map(0x0009, 0x0009).select(0xff00).r(FUNC(mbee_state::speed_r)); map(0x0068, 0x006f).mirror(0xff00).noprw(); // swallow i/o to SCC which was never fitted to production machines } @@ -323,8 +319,7 @@ void mbee_state::mbee256_io(address_map &map) map(0x0006, 0x0006).mirror(0xff00).w(FUNC(mbee_state::port06_w)); map(0x0007, 0x0007).mirror(0xff00).r(FUNC(mbee_state::port07_r)); map(0x0008, 0x0008).mirror(0xff00).rw(FUNC(mbee_state::port08_r), FUNC(mbee_state::port08_w)); - map(0x0009, 0x0009).mirror(0xfd00).r(FUNC(mbee_state::speed_low_r)); - map(0x0209, 0x0209).mirror(0xfd00).r(FUNC(mbee_state::speed_high_r)); + map(0x0009, 0x0009).select(0xff00).r(FUNC(mbee_state::speed_r)); map(0x0009, 0x0009).mirror(0xff00).nopw(); 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)); diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index 91f11882d41..3c6de28bf36 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -100,10 +100,8 @@ private: u8 port1c_r(); void port1c_w(u8 data); void port50_w(u8 data); - u8 telcom_low_r(); - u8 telcom_high_r(); - u8 speed_low_r(); - u8 speed_high_r(); + u8 telcom_r(offs_t); + u8 speed_r(offs_t); void m6545_index_w(u8 data); void m6545_data_w(u8 data); u8 video_low_r(offs_t offset); diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp index 6daefa6fbb9..5e541956e68 100644 --- a/src/mame/machine/mbee.cpp +++ b/src/mame/machine/mbee.cpp @@ -202,19 +202,12 @@ u8 mbee_state::port18_r() ************************************************************/ -u8 mbee_state::speed_low_r() +u8 mbee_state::speed_r(offs_t offset) { - m_maincpu->set_unscaled_clock(3375000); + m_maincpu->set_unscaled_clock(BIT(offset, 8, 2) ? 6750000 : 3375000); return 0xff; } -u8 mbee_state::speed_high_r() -{ - m_maincpu->set_unscaled_clock(6750000); - return 0xff; -} - - /*********************************************************** @@ -388,20 +381,12 @@ void mbee_state::port0a_w(u8 data) m_0a = data & 15; } -u8 mbee_state::telcom_low_r() +// Banking of Telcom rom +// Todo: implement 4 banks, however no roms use it. +u8 mbee_state::telcom_r(offs_t offset) { -/* Read of port 0A - set Telcom rom to first half */ if (m_telcom) - m_telcom->set_entry(0); - - return m_0a; -} - -u8 mbee_state::telcom_high_r() -{ -/* Read of port 10A - set Telcom rom to 2nd half */ - if (m_telcom) - m_telcom->set_entry(1); + m_telcom->set_entry(BIT(offset, 8)); return m_0a; }