diff options
-rw-r--r-- | src/mame/drivers/hp2620.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/src/mame/drivers/hp2620.cpp b/src/mame/drivers/hp2620.cpp index 10f31895c17..85d676cf901 100644 --- a/src/mame/drivers/hp2620.cpp +++ b/src/mame/drivers/hp2620.cpp @@ -12,8 +12,11 @@ Skeleton driver for HP-2620 series display terminals. #include "machine/input_merger.h" #include "machine/mos6551.h" #include "machine/nvram.h" +#include "machine/ripple_counter.h" +#include "sound/spkrdev.h" #include "video/dp8350.h" #include "screen.h" +#include "speaker.h" class hp2620_state : public driver_device { @@ -24,6 +27,8 @@ public: , m_nmigate(*this, "nmigate") , m_crtc(*this, "crtc") , m_datacomm(*this, "datacomm") + , m_bell(*this, "bell") + , m_bellctr(*this, "bellctr") , m_p_chargen(*this, "chargen") , m_nvram(*this, "nvram") { } @@ -45,6 +50,8 @@ private: u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(bell_w); + void io_map(address_map &map); void mem_map(address_map &map); @@ -52,6 +59,8 @@ private: required_device<input_merger_device> m_nmigate; required_device<dp8367_device> m_crtc; required_device<rs232_port_device> m_datacomm; + required_device<speaker_sound_device> m_bell; + required_device<ripple_counter_device> m_bellctr; required_region_ptr<u8> m_p_chargen; required_shared_ptr<u8> m_nvram; }; @@ -76,11 +85,18 @@ void hp2620_state::nvram_w(offs_t offset, u8 data) u8 hp2620_state::keystat_r() { - return 0xff; + // LS299 at U25 + return 0; } void hp2620_state::keydisp_w(u8 data) { + // LS374 at U26 + + // TODO: D0-D3 = KEY3-KEY6 + m_bellctr->reset_w(BIT(data, 5)); + // TODO: D6 = BLINK RATE + // TODO: D7 = ENHOFF } u8 hp2620_state::sysstat_r() @@ -89,7 +105,7 @@ u8 hp2620_state::sysstat_r() u8 status = 0xe0; status |= m_crtc->vblank_r() << 0; - // TODO: D1 = PINT; + // TODO: D1 = PINT status |= m_datacomm->dsr_r() << 2; // DM (J6-12) status |= m_datacomm->cts_r() << 3; // CS (J6-11) status |= m_datacomm->ri_r() << 4; // OCR1 (J6-18) @@ -114,6 +130,11 @@ void hp2620_state::ennmi_w(offs_t offset, u8 data) m_nmigate->in_w<0>(BIT(offset, 0)); } +WRITE_LINE_MEMBER(hp2620_state::bell_w) +{ + m_bell->level_w(state); +} + void hp2620_state::mem_map(address_map &map) { map(0x0000, 0xbfff).rom().region("maincpu", 0); @@ -138,6 +159,7 @@ void hp2620_state::io_map(address_map &map) void hp2620_state::machine_reset() { m_nmigate->in_w<1>(0); + m_bellctr->reset_w(1); // FIXME: this behavior isn't accurate } static INPUT_PORTS_START( hp2622 ) @@ -158,6 +180,7 @@ void hp2620_state::hp2622(machine_config &config) DP8367(config, m_crtc, 25.7715_MHz_XTAL).set_screen("screen"); m_crtc->set_half_shift(true); + m_crtc->hsync_callback().set(m_bellctr, FUNC(ripple_counter_device::clock_w)).invert(); mos6551_device &acia(MOS6551(config, "acia", 0)); // SY6551 acia.set_xtal(25.7715_MHz_XTAL / 14); // 1.84 MHz @@ -168,6 +191,13 @@ void hp2620_state::hp2622(machine_config &config) RS232_PORT(config, m_datacomm, default_rs232_devices, nullptr); m_datacomm->rxd_handler().set("acia", FUNC(mos6551_device::write_rxd)); // RD (J6-9) + + RIPPLE_COUNTER(config, m_bellctr); // LS393 at U114 + m_bellctr->set_stages(8); + m_bellctr->count_out_cb().set(FUNC(hp2620_state::bell_w)).bit(4); + + SPEAKER(config, "mono").front_center(); // on keyboard + SPEAKER_SOUND(config, m_bell).add_route(ALL_OUTPUTS, "mono", 0.50); } /************************************************************************************************************** @@ -183,10 +213,10 @@ ROM_START( hp2622a ) ROM_LOAD( "1818-1685.xu63", 0x0000, 0x2000, CRC(a57ffe5e) SHA1(4d7844320deba916d9ec289927af987fea025b02) ) ROM_LOAD( "1818-1686.xu64", 0x2000, 0x2000, CRC(bee9274c) SHA1(20796c559031a91cb2666776fcf7ffdb52a0a318) ) ROM_LOAD( "1818-1687.xu65", 0x4000, 0x2000, CRC(e9ecd489) SHA1(9b249b8d066d256069ccdb8809bb808c414f106a) ) - // XU66-XU68 are empty + // XU66-XU68 are empty sockets ROM_REGION(0x2000, "chargen", 0) ROM_LOAD( "1818-1489.xu311", 0x0000, 0x2000, CRC(9879b153) SHA1(fc1705d6de38eb6d3a67f1ae439e359e5124d028) ) ROM_END -COMP( 1982, hp2622a, 0, 0, hp2622, hp2622, hp2620_state, empty_init, "HP", "HP-2622A", MACHINE_IS_SKELETON ) +COMP(1982, hp2622a, 0, 0, hp2622, hp2622, hp2620_state, empty_init, "HP", "HP-2622A", MACHINE_NOT_WORKING) |