From b8c237f9b5a65a2d61a5dd4ebcc3a224728bef82 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Mon, 31 May 2021 03:56:22 +1000 Subject: mbee: prepare for new software list. --- src/mame/drivers/mbee.cpp | 124 +++++++++++++++++++++++++----------------- src/mame/includes/mbee.h | 99 ++++++++++++++++++++-------------- src/mame/machine/mbee.cpp | 133 ++++++++++++++++++++++++++++++++-------------- src/mame/video/mbee.cpp | 8 +-- 4 files changed, 227 insertions(+), 137 deletions(-) diff --git a/src/mame/drivers/mbee.cpp b/src/mame/drivers/mbee.cpp index 2033e374b77..7b2153e249b 100644 --- a/src/mame/drivers/mbee.cpp +++ b/src/mame/drivers/mbee.cpp @@ -11,7 +11,7 @@ Previous driver was written by Juergen Buchmueller, Jan 2000 with assistance from Brett Selwood and Andrew Davies. - Keyboard notes are in video/microbee.c + Keyboard notes are in video/microbee.cpp 256tc: The 1.31 rom version which appears to fit the 256TC is actually part of the Z80 emulation in the Matilda model. If you fit this rom into a real @@ -26,6 +26,12 @@ from Brett Selwood and Andrew Davies. The kit itself has an extra custom FPGA CPU board with memory-card slot, but there's no info on it yet. We just emulate the Z80 portion. + ICs on schematics, pcbs, and manuals which never made it into production machines: + - Z80SCC; + - SN76489A; + - 2651A; + - B & C roms on disk-based machines. + Floppy formats: - All disks are the standard CPCEMU 'dsk' format. - Types are 9/13cm 40/80 track (single or double sided) @@ -46,6 +52,8 @@ from Brett Selwood and Andrew Davies. (by reading port 0A) to swap between the two halves. See Telcom notes below. + MEM - same as NET. + EDASM - Jump to C000, usually the Editor/Assembler package. MENU - Do a rombank switch to bank 5 and jump to C000 to start the Shell @@ -123,18 +131,12 @@ from Brett Selwood and Andrew Davies. #include "formats/mbee_cas.h" #include "speaker.h" -/********** NOTE !!! *********************************************************** - The microbee uses lots of bankswitching and the memory maps are still - being determined. Please don't merge memory maps !! -********************************************************************************/ - - void mbee_state::mbee_mem(address_map &map) { map.unmap_value_high(); map(0x0000, 0x7fff).ram(); map(0x8000, 0xbfff).rom().region("maincpu",0); - map(0xc000, 0xdfff).rom().region("pakrom",0); + map(0xc000, 0xdfff).r(FUNC(mbee_state::pakrom_r)); map(0xe000, 0xefff).rom().region("telcomrom",0); map(0xf000, 0xf7ff).rw(FUNC(mbee_state::video_low_r), FUNC(mbee_state::video_low_w)); map(0xf800, 0xffff).rw(FUNC(mbee_state::video_high_r), FUNC(mbee_state::video_high_w)); @@ -144,7 +146,7 @@ void mbee_state::mbeeic_mem(address_map &map) { map(0x0000, 0x7fff).ram(); map(0x8000, 0xbfff).rom().region("maincpu",0); - map(0xc000, 0xdfff).bankr("pak"); + map(0xc000, 0xdfff).r(FUNC(mbee_state::pakrom_r)); map(0xe000, 0xefff).rom().region("telcomrom",0); map(0xf000, 0xf7ff).rw(FUNC(mbee_state::video_low_r), FUNC(mbee_state::video_low_w)); map(0xf800, 0xffff).rw(FUNC(mbee_state::video_high_r), FUNC(mbee_state::video_high_w)); @@ -154,7 +156,7 @@ void mbee_state::mbeepc_mem(address_map &map) { map(0x0000, 0x7fff).ram(); map(0x8000, 0xbfff).rom().region("maincpu",0); - map(0xc000, 0xdfff).bankr("pak"); + map(0xc000, 0xdfff).r(FUNC(mbee_state::pakrom_r)); map(0xe000, 0xefff).bankr("telcom"); map(0xf000, 0xf7ff).rw(FUNC(mbee_state::video_low_r), FUNC(mbee_state::video_low_w)); map(0xf800, 0xffff).rw(FUNC(mbee_state::video_high_r), FUNC(mbee_state::video_high_w)); @@ -165,7 +167,7 @@ void mbee_state::mbeeppc_mem(address_map &map) map(0x0000, 0x7fff).ram(); map(0x8000, 0x9fff).bankr("basic"); map(0xa000, 0xbfff).rom().region("maincpu",0); - map(0xc000, 0xdfff).bankr("pak"); + map(0xc000, 0xdfff).r(FUNC(mbee_state::pakrom_r)); map(0xe000, 0xefff).bankr("telcom"); map(0xf000, 0xf7ff).rw(FUNC(mbee_state::video_low_r), FUNC(mbee_state::video_low_w)); map(0xf800, 0xffff).rw(FUNC(mbee_state::video_high_r), FUNC(mbee_state::video_high_w)); @@ -204,7 +206,7 @@ void mbee_state::mbeett_mem(address_map &map) map(0x0000, 0x7fff).ram(); map(0x8000, 0x9fff).rom().region("maincpu",0); map(0xa000, 0xbfff).ram(); - map(0xc000, 0xdfff).bankr("pak"); + map(0xc000, 0xdfff).r(FUNC(mbee_state::pakrom_r)); map(0xe000, 0xefff).bankr("telcom"); map(0xf000, 0xf7ff).rw(FUNC(mbee_state::video_low_r), FUNC(mbee_state::video_low_w)); map(0xf800, 0xffff).rw(FUNC(mbee_state::video_high_r), FUNC(mbee_state::video_high_w)); @@ -226,7 +228,7 @@ void mbee_state::mbeeic_io(address_map &map) map.unmap_value_high(); map(0x00, 0x03).mirror(0x10).rw(m_pio, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); map(0x08, 0x08).mirror(0x10).rw(FUNC(mbee_state::port08_r), FUNC(mbee_state::port08_w)); - map(0x09, 0x09).nopw(); /* Listed as "Colour Wait Off" or "USART 2651" but doesn't appear in the schematics */ + map(0x09, 0x09).nopw(); /* Listed as "Colour Wait Off" or "USART 2651" but never used */ map(0x0a, 0x0a).mirror(0x10).w(FUNC(mbee_state::port0a_w)); map(0x0b, 0x0b).mirror(0x10).w(FUNC(mbee_state::port0b_w)); map(0x0c, 0x0c).mirror(0x10).r(m_crtc, FUNC(mc6845_device::status_r)).w(FUNC(mbee_state::m6545_index_w)); @@ -327,7 +329,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 + // map(0x0010, 0x0013).mirror(0xff00); Optional SN76489AN audio chip (never used) 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)); @@ -335,7 +337,7 @@ void mbee_state::mbee256_io(address_map &map) map(0x0050, 0x0057).mirror(0xff00).w(FUNC(mbee_state::port50_w)); // map(0x0058, 0x005f).mirror(0xff00); External options: floppy drive, hard drive and keyboard // map(0x0060, 0x0067).mirror(0xff00); Reserved for file server selection (unused) - // map(0x0068, 0x006f).mirror(0xff00); Reserved for 8530 SCC (unused) + // map(0x0068, 0x006f).mirror(0xff00); Reserved for 8530 SCC (never used) } static INPUT_PORTS_START( oldkb ) @@ -640,6 +642,19 @@ static void mbee_floppies(device_slot_interface &device) } +void mbee_state::remove_carts(machine_config &config) +{ + config.device_remove("cart_list"); + config.device_remove("pak0"); + config.device_remove("pak1"); + config.device_remove("pak2"); + config.device_remove("pak3"); + config.device_remove("pak4"); + config.device_remove("pak5"); + config.device_remove("pak6"); + config.device_remove("pak7"); +} + void mbee_state::mbee(machine_config &config) { /* basic machine hardware */ @@ -695,8 +710,11 @@ void mbee_state::mbee(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("mbee_cass"); + GENERIC_SOCKET(config, "pak0", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak0_load)); + SOFTWARE_LIST(config, "cass_list").set_original("mbee_cass").set_filter("1"); SOFTWARE_LIST(config, "quik_list").set_original("mbee_quik").set_filter("1"); + SOFTWARE_LIST(config, "cart_list").set_original("mbee_cart").set_filter("1"); } @@ -755,8 +773,18 @@ void mbee_state::mbeeic(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("mbee_cass"); + GENERIC_SOCKET(config, "pak0", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak0_load)); + GENERIC_SOCKET(config, "pak1", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak1_load)); + GENERIC_SOCKET(config, "pak2", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak2_load)); + GENERIC_SOCKET(config, "pak3", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak3_load)); + GENERIC_SOCKET(config, "pak4", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak4_load)); + GENERIC_SOCKET(config, "pak5", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak5_load)); + GENERIC_SOCKET(config, "pak6", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak6_load)); + GENERIC_SOCKET(config, "pak7", generic_plain_slot, "mbee_cart", "mbp,rom").set_device_load(FUNC(mbee_state::pak7_load)); + SOFTWARE_LIST(config, "cass_list").set_original("mbee_cass").set_filter("2"); SOFTWARE_LIST(config, "quik_list").set_original("mbee_quik").set_filter("2"); + SOFTWARE_LIST(config, "cart_list").set_original("mbee_cart").set_filter("2"); } void mbee_state::mbeepc(machine_config &config) @@ -766,6 +794,12 @@ void mbee_state::mbeepc(machine_config &config) m_maincpu->set_addrmap(AS_IO, &mbee_state::mbeepc_io); } +void mbee_state::mbeepc2(machine_config &config) +{ + mbeepc(config); + remove_carts(config); +} + void mbee_state::mbeeppc(machine_config &config) { mbeeic(config); @@ -780,6 +814,7 @@ void mbee_state::mbeeppc(machine_config &config) config.device_remove("quickload"); config.device_remove("quik_list"); + remove_carts(config); } void mbee_state::mbee56(machine_config &config) @@ -798,6 +833,8 @@ void mbee_state::mbee56(machine_config &config) SOFTWARE_LIST(config, "flop_list").set_original("mbee_flop").set_filter("1"); config.device_remove("quickload"); config.device_remove("quik_list"); + config.device_remove("cass_list"); + remove_carts(config); } void mbee_state::mbee128(machine_config &config) @@ -875,11 +912,6 @@ ROM_START( mbee ) ROM_REGION( 0x1000, "telcomrom", 0 ) ROM_LOAD_OPTIONAL("telcom10.rom", 0x0000, 0x1000, CRC(cc9ac94d) SHA1(6804b5ff54d16f8e06180751d8681c44f351e0bb) ) - // there's no actual PAK board or command in this machine - ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD_OPTIONAL("edasma.ic31", 0x0000, 0x1000, CRC(120c3dea) SHA1(32c9bb6e54dd50d5218bb43cc921885a0307161d) ) - ROM_LOAD_OPTIONAL("edasmb.ic33", 0x1000, 0x1000, CRC(a23bf3c8) SHA1(73a57c2800a1c744b527d0440b170b8b03351753) ) - // first 0x800 for normal chars, 2nd 0x800 for small chars. Some roms don't have small chars so normal ones loaded twice. ROM_REGION( 0x1000, "chargen", 0 ) ROM_LOAD("charrom.ic13", 0x0000, 0x0800, CRC(b149737b) SHA1(a3cd4f5d0d3c71137cd1f0f650db83333a2e3597) ) @@ -891,17 +923,16 @@ ROM_END ROM_START( mbeeic ) ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("bas522a.rom", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) - ROM_LOAD("bas522b.rom", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) + ROM_LOAD("bas522a.ic5", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) + ROM_LOAD("bas522b.ic10", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) ROM_REGION( 0x1000, "telcomrom", 0 ) ROM_LOAD_OPTIONAL("telcom12.rom", 0x0000, 0x1000, CRC(0231bda3) SHA1(be7b32499034f985cc8f7865f2bc2b78c485585c) ) /* PAK option roms */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD_OPTIONAL("edasm.rom", 0x0000, 0x2000, CRC(1af1b3a9) SHA1(d035a997c2dbbb3918b3395a3a5a1076aa203ee5) ) // 0 - ROM_LOAD_OPTIONAL("wbee12.rom", 0x2000, 0x2000, CRC(0fc21cb5) SHA1(33b3995988fc51ddef1568e160dfe699867adbd5) ) // 1 - ROM_LOAD_OPTIONAL("forth11.rom", 0x4000, 0x2000, CRC(f0fc2358) SHA1(b7303b94abe647d5a6ffb2fba5d205412f970c16) ) // 2 + ROM_LOAD("wbee12.mbp", 0x0000, 0x2000, CRC(0fc21cb5) SHA1(33b3995988fc51ddef1568e160dfe699867adbd5) ) // 1 + ROM_LOAD("help1.mbp", 0x2000, 0x2000, CRC(d34fae54) SHA1(5ed30636f48e9d208ce2da367ba4425782a5bce3) ) // 2 ROM_REGION( 0x1000, "chargen", 0 ) ROM_LOAD("charrom.bin", 0x0000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0) ) @@ -913,17 +944,16 @@ ROM_END ROM_START( mbeepc ) ROM_REGION( 0x4000, "maincpu", 0 ) - ROM_LOAD("bas522a.rom", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) - ROM_LOAD("bas522b.rom", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) + ROM_LOAD("bas522a.ic5", 0x0000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477) ) + ROM_LOAD("bas522b.ic10", 0x2000, 0x2000, CRC(b21d9679) SHA1(332844433763331e9483409cd7da3f90ac58259d) ) ROM_REGION( 0x2000, "telcomrom", 0 ) ROM_LOAD_OPTIONAL("telcom31.rom", 0x0000, 0x2000, CRC(5a904a29) SHA1(3120fb65ccefeb180ab80d8d35440c70dc8452c8) ) /* PAK option roms */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD_OPTIONAL("edasm.rom", 0x0000, 0x2000, CRC(1af1b3a9) SHA1(d035a997c2dbbb3918b3395a3a5a1076aa203ee5) ) // 0 - ROM_LOAD_OPTIONAL("wbee12.rom", 0x2000, 0x2000, CRC(0fc21cb5) SHA1(33b3995988fc51ddef1568e160dfe699867adbd5) ) // 1 - ROM_LOAD_OPTIONAL("mwbhelp.rom", 0x4000, 0x2000, CRC(d34fae54) SHA1(5ed30636f48e9d208ce2da367ba4425782a5bce3) ) // 2 + ROM_LOAD("wbee12.mbp", 0x0000, 0x2000, CRC(0fc21cb5) SHA1(33b3995988fc51ddef1568e160dfe699867adbd5) ) // 1 + ROM_LOAD("help1.mbp", 0x2000, 0x2000, CRC(d34fae54) SHA1(5ed30636f48e9d208ce2da367ba4425782a5bce3) ) // 2 ROM_REGION( 0x1000, "chargen", 0 ) ROM_LOAD("charrom.bin", 0x0000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0) ) @@ -943,13 +973,9 @@ ROM_START( mbeepc85 ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD("wbee13.rom", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 - ROM_LOAD_OPTIONAL("cmdhelp.rom", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 - ROM_LOAD_OPTIONAL("edasm.rom", 0x4000, 0x2000, CRC(1af1b3a9) SHA1(d035a997c2dbbb3918b3395a3a5a1076aa203ee5) ) // 2 - ROM_LOAD_OPTIONAL("forth.rom", 0x6000, 0x2000, CRC(c0795c2b) SHA1(8faa0a46fbbdb8a1019d706a40cd4431a5063f8c) ) // 3 + ROM_LOAD("wbee13r3.mbp", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 + ROM_LOAD("help2.mbp", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 ROM_LOAD("shell.rom", 0xa000, 0x2000, CRC(5a2c7cd6) SHA1(8edc086710cb558f2146d660eddc8a18ba6a141c) ) // 5 - ROM_LOAD_OPTIONAL("ozlogo.rom", 0xc000, 0x2000, CRC(47c3ef69) SHA1(8274d27c323ca4a6cc9e7d24946ae9c0531c3112) ) // 6 - ROM_LOAD_OPTIONAL("chess.rom", 0xe000, 0x2000, CRC(fe9ee9d0) SHA1(a316559414e68c0101af5f00755db551e7c5788e) ) // 7 ROM_REGION( 0x1000, "chargen", 0 ) ROM_LOAD("charrom.bin", 0x0000, 0x1000, CRC(1f9fcee4) SHA1(e57ac94e03638075dde68a0a8c834a4f84ba47b0) ) @@ -969,13 +995,13 @@ ROM_START( mbeepc85b ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD("wbee13.rom", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 - ROM_LOAD_OPTIONAL("cmdhelp.rom", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 - ROM_LOAD_OPTIONAL("busy.rom", 0x4000, 0x2000, CRC(56255f60) SHA1(fd2e37209fd49290be6875bc460cfc05392938ba) ) // 2 + ROM_LOAD("wbee13r3.mbp", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 + ROM_LOAD("help2.mbp", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 + ROM_LOAD("busy.rom", 0x4000, 0x2000, CRC(56255f60) SHA1(fd2e37209fd49290be6875bc460cfc05392938ba) ) // 2 ROM_CONTINUE( 0x14000, 0x2000 ) - ROM_LOAD_OPTIONAL("graphics.rom", 0x6000, 0x2000, CRC(9e9d327c) SHA1(aebf60ed153004380b9f271f2212376910a6cef9) ) // 3 + ROM_LOAD("graphics.rom", 0x6000, 0x2000, CRC(9e9d327c) SHA1(aebf60ed153004380b9f271f2212376910a6cef9) ) // 3 ROM_CONTINUE( 0x16000, 0x2000 ) - ROM_LOAD_OPTIONAL("viatel.rom", 0x8000, 0x2000, CRC(2da2411f) SHA1(d3cfa978165feef0a96e28197f6a762aa6604799) ) // 4 + ROM_LOAD("viatel.rom", 0x8000, 0x2000, CRC(2da2411f) SHA1(d3cfa978165feef0a96e28197f6a762aa6604799) ) // 4 ROM_LOAD("shell-b.rom", 0xa000, 0x2000, CRC(17bf2d58) SHA1(ae22a5fc5783f37066ba5555497e40945272ca3d) ) // 5 ROM_REGION( 0x1000, "chargen", 0 ) @@ -996,7 +1022,7 @@ ROM_START( mbeepc85s ) /* PAK roms - These are not optional and will only work in the correct slots. */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD("wbee20-s.rom", 0x0000, 0x2000, CRC(6a0fe57f) SHA1(a101b588b1872e19382b9e9ea50fabb0fd060aa6) ) // 0 + ROM_LOAD("wbee20s.mbp", 0x0000, 0x2000, CRC(6a0fe57f) SHA1(a101b588b1872e19382b9e9ea50fabb0fd060aa6) ) // 0 ROM_LOAD("db-s.rom", 0x2000, 0x2000, CRC(e2094771) SHA1(62d7fb66c91d2bd24523bc84e4f005cf2c4480bb) ) // 1 ROM_LOAD("kalk-s.rom", 0x4000, 0x2000, CRC(08dd71ee) SHA1(c9d506d8bb56f602c3481b253d4cac226f545d98) ) // 2 ROM_LOAD("bg-s.rom", 0x6000, 0x2000, CRC(5aa4813e) SHA1(a8638e9046bfb9d5a98c878322295ce408bd879d) ) // 3 @@ -1043,13 +1069,13 @@ ROM_START( mbeeppc ) /* PAK option roms - Wordbee must be in slot 0 and Shell must be in slot 5. */ ROM_REGION( 0x20000, "pakrom", ROMREGION_ERASEFF ) - ROM_LOAD("wbee13.rom", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 - ROM_LOAD_OPTIONAL("cmdhelp.rom", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 - ROM_LOAD_OPTIONAL("busy-p.rom", 0x4000, 0x2000, CRC(f2897427) SHA1(b4c351bdac72d89589980be6d654f9b931bcba6b) ) // 2 + ROM_LOAD("wbee13r3.mbp", 0x0000, 0x2000, CRC(d7c58b7b) SHA1(5af1b8d21a0f21534ed1833ae919dbbc6ca973e2) ) // 0 + ROM_LOAD("help2.mbp", 0x2000, 0x2000, CRC(a4f1fa90) SHA1(1456abc6ed0501a3b15a99b4302750843293ae5f) ) // 1 + ROM_LOAD("busy-p.rom", 0x4000, 0x2000, CRC(f2897427) SHA1(b4c351bdac72d89589980be6d654f9b931bcba6b) ) // 2 ROM_CONTINUE( 0x14000, 0x2000 ) - ROM_LOAD_OPTIONAL("graphics.rom", 0x6000, 0x2000, CRC(9e9d327c) SHA1(aebf60ed153004380b9f271f2212376910a6cef9) ) // 3 + ROM_LOAD("graphics.rom", 0x6000, 0x2000, CRC(9e9d327c) SHA1(aebf60ed153004380b9f271f2212376910a6cef9) ) // 3 ROM_CONTINUE( 0x16000, 0x2000 ) - ROM_LOAD_OPTIONAL("vtex235.rom", 0x8000, 0x2000, CRC(8c30ecb2) SHA1(cf068462d7def885bdb5d3a265851b88c727c0d7) ) // 4 + ROM_LOAD("vtex235.rom", 0x8000, 0x2000, CRC(8c30ecb2) SHA1(cf068462d7def885bdb5d3a265851b88c727c0d7) ) // 4 ROM_LOAD("ppcshell.rom", 0xa000, 0x2000, CRC(1e793555) SHA1(ddeaa081ec4408e80e3fb192865d87daa035c701) ) // 5 ROM_REGION( 0x1000, "chargen", 0 ) @@ -1142,8 +1168,8 @@ COMP( 1982, mbee, 0, 0, mbee, mbee, mbee_state, init_mbee, COMP( 1982, mbeeic, mbee, 0, mbeeic, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee 32 IC", MACHINE_SUPPORTS_SAVE ) COMP( 1982, mbeepc, mbee, 0, mbeepc, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee Personal Communicator", MACHINE_SUPPORTS_SAVE ) COMP( 1985, mbeepc85, mbee, 0, mbeepc, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee PC85", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, mbeepc85b, mbee, 0, mbeepc, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee PC85 (New version)", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, mbeepc85s, mbee, 0, mbeepc, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee PC85 (Swedish)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, mbeepc85b, mbee, 0, mbeepc2, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee PC85 (New version)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, mbeepc85s, mbee, 0, mbeepc2, mbee, mbee_state, init_mbeeic, "Applied Technology", "Microbee PC85 (Swedish)", MACHINE_SUPPORTS_SAVE ) COMP( 1986, mbeeppc, mbee, 0, mbeeppc, mbee, mbee_state, init_mbeeppc, "Applied Technology", "Microbee Premium PC85", MACHINE_SUPPORTS_SAVE ) COMP( 1986, mbeett, mbee, 0, mbeett, mbee256, mbee_state, init_mbeett, "Applied Technology", "Microbee Teleterm", MACHINE_SUPPORTS_SAVE ) COMP( 1986, mbee56, mbee, 0, mbee56, mbee, mbee_state, init_mbee56, "Applied Technology", "Microbee 56k", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index 9b9382c9abd..91f11882d41 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -11,6 +11,8 @@ #pragma once #include "bus/centronics/ctronics.h" +#include "bus/generic/carts.h" +#include "bus/generic/slot.h" #include "cpu/z80/z80.h" #include "machine/z80daisy.h" @@ -50,7 +52,8 @@ public: , m_floppy0(*this, "fdc:0") , m_floppy1(*this, "fdc:1") , m_rtc(*this, "rtc") - , m_pak(*this, "pak") + , m_p_pak(*this, "pakrom") + , m_pak(*this, "pakrom") , m_telcom(*this, "telcom") , m_basic(*this, "basic") , m_io_x7(*this, "X.7") @@ -60,6 +63,7 @@ public: , m_screen(*this, "screen") , m_bankr(*this, "bankr%d", 0) , m_bankw(*this, "bankw%d", 0) + , m_pakrom(*this, "pak%u", 0U) { } void mbee56(machine_config &config); @@ -70,7 +74,9 @@ public: void mbeett(machine_config &config); void mbeeic(machine_config &config); void mbeepc(machine_config &config); + void mbeepc2(machine_config &config); void mbee128p(machine_config &config); + void remove_carts(machine_config &config); void init_mbee() { m_features = 0x00; }; void init_mbeett() { m_features = 0x0d; }; @@ -83,38 +89,48 @@ public: void init_mbee256() { m_features = 0x2d; }; private: - void port04_w(uint8_t data); - void port06_w(uint8_t data); - uint8_t port07_r(); - uint8_t port08_r(); - void port08_w(uint8_t data); - void port0a_w(uint8_t data); - void port0b_w(uint8_t data); - uint8_t port18_r(); - uint8_t port1c_r(); - void port1c_w(uint8_t data); - void port50_w(uint8_t data); - uint8_t telcom_low_r(); - uint8_t telcom_high_r(); - uint8_t speed_low_r(); - uint8_t speed_high_r(); - void m6545_index_w(uint8_t data); - void m6545_data_w(uint8_t data); - uint8_t video_low_r(offs_t offset); - uint8_t video_high_r(offs_t offset); - void video_low_w(offs_t offset, uint8_t data); - void video_high_w(offs_t offset, uint8_t data); - void pio_port_b_w(uint8_t data); - uint8_t pio_port_b_r(); + void port04_w(u8 data); + void port06_w(u8 data); + u8 port07_r(); + u8 port08_r(); + void port08_w(u8 data); + void port0a_w(u8 data); + void port0b_w(u8 data); + u8 port18_r(); + 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(); + void m6545_index_w(u8 data); + void m6545_data_w(u8 data); + u8 video_low_r(offs_t offset); + u8 video_high_r(offs_t offset); + void video_low_w(offs_t offset, u8 data); + void video_high_w(offs_t offset, u8 data); + void pio_port_b_w(u8 data); + u8 pio_port_b_r(); DECLARE_WRITE_LINE_MEMBER(pio_ardy); DECLARE_WRITE_LINE_MEMBER(crtc_vs); - uint8_t fdc_status_r(); - void fdc_motor_w(uint8_t data); + u8 fdc_status_r(); + u8 pakrom_r(offs_t); + void fdc_motor_w(u8 data); void standard_palette(palette_device &palette) const; void premium_palette(palette_device &palette) const; uint32_t screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(newkb_timer); + image_init_result load_cart(device_image_interface &image, generic_slot_device *slot, u8); DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak0_load) { return load_cart(image, m_pakrom[0], 0); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak1_load) { return load_cart(image, m_pakrom[1], 1); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak2_load) { return load_cart(image, m_pakrom[2], 2); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak3_load) { return load_cart(image, m_pakrom[3], 3); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak4_load) { return load_cart(image, m_pakrom[4], 4); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak5_load) { return load_cart(image, m_pakrom[5], 5); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak6_load) { return load_cart(image, m_pakrom[6], 6); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pak7_load) { return load_cart(image, m_pakrom[7], 7); } WRITE_LINE_MEMBER(rtc_irq_w); WRITE_LINE_MEMBER(fdc_intrq_w); WRITE_LINE_MEMBER(fdc_drq_w); @@ -146,25 +162,26 @@ private: bool m_b7_rtc = 0; bool m_b7_vs = 0; bool m_b2 = 0; - uint8_t m_framecnt = 0; - uint8_t m_08 = 0; - uint8_t m_0a = 0; - uint8_t m_0b = 0; - uint8_t m_1c = 0; - uint8_t m_newkb_was_pressed[15] = { 0, }; - uint8_t m_newkb_q[20] = { 0, }; - uint8_t m_newkb_q_pos = 0; - uint8_t m_sy6545_reg[32] = { 0, }; - uint8_t m_sy6545_ind = 0; - uint8_t m_fdc_rq = 0; - uint8_t m_bank_array[33] = { 0, }; + u8 m_framecnt = 0; + u8 m_08 = 0; + u8 m_0a = 0; + u8 m_0b = 0; + u8 m_1c = 0; + u8 m_newkb_was_pressed[15] = { 0, }; + u8 m_newkb_q[20] = { 0, }; + u8 m_newkb_q_pos = 0; + u8 m_sy6545_reg[32] = { 0, }; + u8 m_sy6545_ind = 0; + u8 m_fdc_rq = 0; + u8 m_bank_array[33] = { 0, }; + bool m_pakrom_extended[8] = { 0, }; std::unique_ptr m_dummy; // black hole for writes to rom std::unique_ptr m_ram; // main banked-switch ram, 128/256/pp std::unique_ptr m_vram; // video ram, all models std::unique_ptr m_pram; // pcg ram, all models std::unique_ptr m_cram; // colour ram, all except mbee std::unique_ptr m_aram; // attribute ram, ppc/128/256/pp/tt - void setup_banks(uint8_t data, bool first_time, uint8_t b_mask); + void setup_banks(u8 data, bool first_time, u8 b_mask); void oldkb_scan(uint16_t param); void oldkb_matrix_r(uint16_t offs); required_device m_maincpu; @@ -178,7 +195,8 @@ private: optional_device m_floppy0; optional_device m_floppy1; optional_device m_rtc; - optional_memory_bank m_pak; + optional_region_ptr m_p_pak; + optional_memory_region m_pak; optional_memory_bank m_telcom; optional_memory_bank m_basic; optional_ioport m_io_x7; @@ -188,6 +206,7 @@ private: required_device m_screen; optional_memory_bank_array<16> m_bankr; optional_memory_bank_array<16> m_bankw; + optional_device_array m_pakrom; }; #endif // MAME_INCLUDES_MBEE_H diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp index aac736ed3d1..6daefa6fbb9 100644 --- a/src/mame/machine/mbee.cpp +++ b/src/mame/machine/mbee.cpp @@ -27,7 +27,7 @@ WRITE_LINE_MEMBER( mbee_state::pio_ardy ) m_centronics->write_strobe((state) ? 0 : 1); } -void mbee_state::pio_port_b_w(uint8_t data) +void mbee_state::pio_port_b_w(u8 data) { /* PIO port B - d5..d2 not emulated d7 interrupt from network or rtc or vsync or not used (see config switch) @@ -43,9 +43,9 @@ void mbee_state::pio_port_b_w(uint8_t data) m_speaker->level_w(BIT(data, 6)); } -uint8_t mbee_state::pio_port_b_r() +u8 mbee_state::pio_port_b_r() { - uint8_t data = 0; + u8 data = 0; if (m_cassette->input() > 0.03) data |= 1; @@ -55,16 +55,16 @@ uint8_t mbee_state::pio_port_b_r() switch (m_io_config->read() & 0xc0) { case 0x00: - data |= (uint8_t)m_b7_vs << 7; + data |= (u8)m_b7_vs << 7; break; case 0x40: - data |= (uint8_t)m_b7_rtc << 7; + data |= (u8)m_b7_rtc << 7; break; case 0x80: data |= 0x80; break; } - data |= (uint8_t)m_b2 << 1; // key pressed on new keyboard + data |= (u8)m_b2 << 1; // key pressed on new keyboard return data; } @@ -88,7 +88,7 @@ WRITE_LINE_MEMBER( mbee_state::fdc_drq_w ) m_fdc_rq = (m_fdc_rq & 1) | (state << 1); } -uint8_t mbee_state::fdc_status_r() +u8 mbee_state::fdc_status_r() { /* d7 indicate if IRQ or DRQ is occurring (1=happening) d6..d0 not used */ @@ -96,7 +96,7 @@ uint8_t mbee_state::fdc_status_r() return m_fdc_rq ? 0xff : 0x7f; } -void mbee_state::fdc_motor_w(uint8_t data) +void mbee_state::fdc_motor_w(u8 data) { /* d7..d4 not used d3 density (1=MFM) @@ -147,7 +147,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( mbee_state::newkb_timer ) if (!BIT(m_features, 2)) return; - uint8_t i, j, pressed; + u8 i, j, pressed; // find what has changed for (i = 0; i < 15; i++) @@ -161,7 +161,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( mbee_state::newkb_timer ) if (BIT(pressed^m_newkb_was_pressed[i], j)) { // put it in the queue - uint8_t code = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0); + u8 code = (i << 3) | j | (BIT(pressed, j) ? 0x80 : 0); m_newkb_q[m_newkb_q_pos] = code; if (m_newkb_q_pos < (std::size(m_newkb_q)-1)) m_newkb_q_pos++; @@ -179,9 +179,9 @@ TIMER_DEVICE_CALLBACK_MEMBER( mbee_state::newkb_timer ) m_pio->port_b_write(pio_port_b_r()); } -uint8_t mbee_state::port18_r() +u8 mbee_state::port18_r() { - uint8_t i, data = m_newkb_q[0]; // get oldest key + u8 i, data = m_newkb_q[0]; // get oldest key if (m_newkb_q_pos) { @@ -202,13 +202,13 @@ uint8_t mbee_state::port18_r() ************************************************************/ -uint8_t mbee_state::speed_low_r() +u8 mbee_state::speed_low_r() { m_maincpu->set_unscaled_clock(3375000); return 0xff; } -uint8_t mbee_state::speed_high_r() +u8 mbee_state::speed_high_r() { m_maincpu->set_unscaled_clock(6750000); return 0xff; @@ -222,17 +222,17 @@ uint8_t mbee_state::speed_high_r() ************************************************************/ -void mbee_state::port04_w(uint8_t data) // address +void mbee_state::port04_w(u8 data) // address { m_rtc->write(0, data); } -void mbee_state::port06_w(uint8_t data) // write +void mbee_state::port06_w(u8 data) // write { m_rtc->write(1, data); } -uint8_t mbee_state::port07_r() // read +u8 mbee_state::port07_r() // read { return m_rtc->read(1); } @@ -265,16 +265,16 @@ WRITE_LINE_MEMBER( mbee_state::rtc_irq_w ) ************************************************************/ -void mbee_state::setup_banks(uint8_t data, bool first_time, uint8_t b_mask) +void mbee_state::setup_banks(u8 data, bool first_time, u8 b_mask) { b_mask &= 7; u32 dbank = m_ramsize / 0x1000; u8 extra_bits = data & 0xc0; data &= 0x3f; // (bits 0-5 are referred to as S0-S5) address_space &mem = m_maincpu->space(AS_PROGRAM); - uint8_t *prom = memregion("pals")->base(); - uint8_t b_data = bitswap<8>(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3 - uint8_t b_bank, b_byte, b_byte_t, b_addr, p_bank = 1; + u8 *prom = memregion("pals")->base(); + u8 b_data = bitswap<8>(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3 + u8 b_bank, b_byte, b_byte_t, b_addr, p_bank = 1; uint16_t b_vid; if (first_time || (b_data != m_bank_array[0])) // if same data as last time, leave now @@ -377,21 +377,18 @@ void mbee_state::port50_w(u8 data) Output the PAK number to choose an optional PAK ROM. The bios will support 256 PAKs, although normally only - 8 are available in hardware. Each PAK is normally a 4K - ROM. If 8K ROMs are used, the 2nd half becomes PAK+8, + 8 are available in hardware. Each PAK is normally a 8K + ROM. If 16K ROMs are used, the 2nd half becomes PAK+8, thus 16 PAKs in total. This is used in the PC85 models. ************************************************************/ -void mbee_state::port0a_w(uint8_t data) +void mbee_state::port0a_w(u8 data) { - m_0a = data; - - if (m_pak) - m_pak->set_entry(data & 15); + m_0a = data & 15; } -uint8_t mbee_state::telcom_low_r() +u8 mbee_state::telcom_low_r() { /* Read of port 0A - set Telcom rom to first half */ if (m_telcom) @@ -400,7 +397,7 @@ uint8_t mbee_state::telcom_low_r() return m_0a; } -uint8_t mbee_state::telcom_high_r() +u8 mbee_state::telcom_high_r() { /* Read of port 10A - set Telcom rom to 2nd half */ if (m_telcom) @@ -409,6 +406,31 @@ uint8_t mbee_state::telcom_high_r() return m_0a; } +u8 mbee_state::pakrom_r(offs_t offset) +{ + u8 data = m_0a & 7; + + if (m_pakrom[data] && m_pakrom[data]->exists()) + { + if (BIT(m_0a, 3)) + { + if (m_pakrom_extended[data]) + return m_pakrom[data]->read_rom(0x2000 | offset); + else + return 0xff; + } + else + return m_pakrom[data]->read_rom(offset); + } + else + { + m_pakrom_extended[data] = false; + if (m_pak) + return m_p_pak[(m_0a<<13)|offset]; + else + return 0xff; + } +} /*********************************************************** @@ -458,13 +480,6 @@ void mbee_state::machine_start() m_telcom->configure_entries(0, 2, t, 0x1000); } - // PAKs fitted - if (m_pak) - { - u8 *p = memregion("pakrom")->base(); - m_pak->configure_entries(0, 16, p, 0x2000); - } - // videoram m_vram = make_unique_clear(0x0800); save_pointer(NAME(m_vram), 0x0800); @@ -525,6 +540,14 @@ void mbee_state::machine_start() m_bankw[b_bank]->configure_entry(banks, d); // dummy rom } } + + // set pak index to true for 16k roms + if (m_pak) + for (u8 i = 8; i < 16; i++) + m_pakrom_extended[i & 7] = (m_p_pak[(i<<13)] == 0xff) ? false : true; + else + for (u8 i = 0; i < 8; i++) + m_pakrom_extended[i] = false; } void mbee_state::machine_reset() @@ -544,9 +567,6 @@ void mbee_state::machine_reset() if (m_telcom) m_telcom->set_entry(0); - if (m_pak) - m_pak->set_entry(5); - m_maincpu->set_pc(m_size); // init new kbd @@ -614,7 +634,7 @@ QUICKLOAD_LOAD_MEMBER(mbee_state::quickload_cb) } uint16_t i, j; - uint8_t data; + u8 data; size_t quickload_size = image.length(); if (image.is_filetype("mwb")) @@ -703,3 +723,34 @@ QUICKLOAD_LOAD_MEMBER(mbee_state::quickload_cb) return image_init_result::PASS; } +image_init_result mbee_state::load_cart(device_image_interface &image, generic_slot_device *slot, u8 pak_index) +{ + u32 size = slot->common_get_size("rom"); + + if (size > 0x4000) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); + return image_init_result::FAIL; + } + + m_pakrom_extended[pak_index] = (size > 0x2000) ? true : false; + + slot->rom_alloc(m_pakrom_extended ? 0x4000 : 0x2000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); // we alloc the amount for a real rom + slot->common_load_rom(slot->get_rom_base(), size, "rom"); + + // Validate the rom + u8 bytes[3] = { slot->read_rom(0), slot->read_rom(1), slot->read_rom(2) }; + logerror ("Rom header = %02X %02X %02X\n", bytes[0], bytes[1], bytes[2]); + if ((bytes[0] != 0xc3) || ((bytes[2] & 0xe0) != 0xc0)) + { + image.seterror(IMAGE_ERROR_UNSPECIFIED, "Not a PAK rom"); + slot->call_unload(); + if (m_pak) + m_pakrom_extended[pak_index] = (m_p_pak[((pak_index+8)<<13)] == 0xff) ? false : true; + else + m_pakrom_extended[pak_index] = false; + return image_init_result::FAIL; + } + + return image_init_result::PASS; +} diff --git a/src/mame/video/mbee.cpp b/src/mame/video/mbee.cpp index 558ab982240..1a9ba1bdbc7 100644 --- a/src/mame/video/mbee.cpp +++ b/src/mame/video/mbee.cpp @@ -32,13 +32,7 @@ 3. At the Basic prompt, type in EDASM press enter. At the memory size prompt press enter. Now, make sure the keyboard works properly. - Old keyboard ToDo: - - Occasional characters dropped while typing - - Lots of characters dropped when pasting - - On mbee128p, Simply Write doesn't accept any input - - New keyboard ToDo: - - On mbeett, various problems caused by phantom characters. + See drivers\mbee.cpp for any issues. ****************************************************************************/ -- cgit v1.2.3