From 49d25dac0661a8446af61c9be801fa9bac9ddb1c Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Tue, 17 Apr 2018 21:42:59 +0200 Subject: [PATCH] Fixes to make basic boot on HP9000/300 (#3466) * hp9k_3xx: add dummy gpib handler BASIC expects that there is an internal gpib card present. It crashes without, so let's add some dummy handlers for now. Signed-off-by: Sven Schnelle * hp9k_3xx: add fallback buserror handler HP BASIC and the bootrom rely on buserror to figure out hardware configuration. Adding a global buserror handler makes BASIC boot on models >= 340. 310 doesn't show a picture with that handler, so let's leave them out for now. Signed-off-by: Sven Schnelle * hp9k_3xx: remove unneeded buserror handlers Now that we have the fallback buserror handler in place, we don't need the other buserror handlers anymore. Signed-off-by: Sven Schnelle * hp9k_3xx: log accesses to gpib registers Signed-off-by: Sven Schnelle --- src/mame/drivers/hp9k_3xx.cpp | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/hp9k_3xx.cpp b/src/mame/drivers/hp9k_3xx.cpp index ac1265e3a44..7b8deade4d6 100644 --- a/src/mame/drivers/hp9k_3xx.cpp +++ b/src/mame/drivers/hp9k_3xx.cpp @@ -55,6 +55,7 @@ ****************************************************************************/ #include "emu.h" +#include "logmacro.h" #include "cpu/m68000/m68000.h" #include "cpu/mcs48/mcs48.h" #include "machine/6840ptm.h" @@ -113,6 +114,9 @@ public: DECLARE_READ8_MEMBER(iocpu_port1_r); DECLARE_READ8_MEMBER(iocpu_test0_r); + DECLARE_READ8_MEMBER(gpib_r); + DECLARE_WRITE8_MEMBER(gpib_w); + DECLARE_WRITE32_MEMBER(led_w) { if (mem_mask != 0x000000ff) @@ -187,18 +191,17 @@ uint32_t hp9k3xx_state::hp_medres_update(screen_device &screen, bitmap_rgb32 &bi // shared mappings for all 9000/3xx systems void hp9k3xx_state::hp9k3xx_common(address_map &map) { + map(0x00000000, 0xffffffff).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); map(0x00000000, 0x0001ffff).rom().region("maincpu", 0).w(this, FUNC(hp9k3xx_state::led_w)); // writes to 1fffc are the LED map(0x00428000, 0x00428003).rw(m_iocpu, FUNC(upi41_cpu_device::upi41_master_r), FUNC(upi41_cpu_device::upi41_master_w)).umask32(0x00ff00ff); - - map(0x00510000, 0x00510003).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); // no "Alpha display" - map(0x00538000, 0x00538003).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); // no "Graphics" - map(0x005c0000, 0x005c0003).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); // no add-on FP coprocessor - - map(0x00600000, 0x007fffff).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); // prevent reading invalid DIO slots - map(0x01000000, 0x1fffffff).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); // prevent reading invalid DIO-II slots + map(0x00478000, 0x0047ffff).rw(this, FUNC(hp9k3xx_state::gpib_r), FUNC(hp9k3xx_state::gpib_w)).umask16(0x00ff); map(0x005f8000, 0x005f800f).rw(PTM6840_TAG, FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)).umask32(0x00ff00ff); + + map(0x005f4000, 0x005f400f).ram(); // somehow coprocessor related - bootrom crashes if not present + map(0x00474000, 0x00474fff).ram(); // unknown + } // 9000/310 - has onboard video that the graphics card used in other 3xxes conflicts with @@ -222,7 +225,12 @@ void hp9k3xx_state::hp9k320_map(address_map &map) { hp9k3xx_common(map); - map(0xffe00000, 0xffefffff).rw(this, FUNC(hp9k3xx_state::buserror_r), FUNC(hp9k3xx_state::buserror_w)); + // unknown, but bootrom crashes without + map(0x00510000, 0x00510fff).ram(); + map(0x00516000, 0x00516fff).ram(); + map(0x00440000, 0x0044ffff).ram(); + + // main memory map(0xfff00000, 0xffffffff).ram(); } @@ -296,6 +304,17 @@ void hp9k3xx_state::machine_reset() { } +WRITE8_MEMBER(hp9k3xx_state::gpib_w) +{ + LOG("%s: 0x%02x = 0x%02x\n", __FUNCTION__, offset ,data); +} + +READ8_MEMBER(hp9k3xx_state::gpib_r) +{ + LOG("%s: 0x%02x\n", __FUNCTION__, offset); + return 0xff; +} + READ16_MEMBER(hp9k3xx_state::buserror16_r) { m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);