From f1c33c78e4c389be6f86c44be2c18818191063fd Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 31 Dec 2017 13:15:59 -0500 Subject: [PATCH 1/2] la120: Better ER1400 hookup; reduce logging spam (nw) --- src/devices/machine/er1400.cpp | 2 +- src/mame/drivers/decwritr.cpp | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/devices/machine/er1400.cpp b/src/devices/machine/er1400.cpp index 96cb2d68864..36d3a46c857 100644 --- a/src/devices/machine/er1400.cpp +++ b/src/devices/machine/er1400.cpp @@ -169,7 +169,7 @@ void er1400_device::erase_data() offs_t offset = 10 * (tens - 10) + units; if (m_data_array[offset] != 0x3fff) { - logerror("Erasing data at %d\n", m_data_register, offset); + logerror("Erasing data at %d\n", offset); m_data_array[offset] = 0x3fff; } } diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp index 52b919aee00..848ad58f6ed 100644 --- a/src/mame/drivers/decwritr.cpp +++ b/src/mame/drivers/decwritr.cpp @@ -20,7 +20,8 @@ #define KBD_VERBOSE 1 -#define LED_VERBOSE 1 +#define LED_VERBOSE 0 +#define DC305_VERBOSE 0 //************************************************************************** // DRIVER STATE @@ -78,9 +79,8 @@ READ8_MEMBER( decwriter_state::la120_KBD_r ) uint8_t code = 0; if (offset&0x8) code |= m_col_array[offset&0x7]->read(); if (offset&0x10) code |= m_col_array[(offset&0x7)+8]->read(); -#ifdef KBD_VERBOSE - logerror("Keyboard column %X read, returning %02X\n", offset&0xF, code); -#endif + if (KBD_VERBOSE) + logerror("Keyboard column %X read, returning %02X\n", offset&0xF, code); return code; } @@ -95,9 +95,8 @@ WRITE8_MEMBER( decwriter_state::la120_LED_w ) */ if (!(offset&0x10)) // we're updating an led state { -#ifdef LED_VERBOSE - logerror("Updated LED status array: LED #%d is now %d\n", ((offset&0xe)>>1), (offset&1)); -#endif + if (LED_VERBOSE) + logerror("Updated LED status array: LED #%d is now %d\n", ((offset&0xe)>>1), (offset&1)); m_led_array &= ((1<<((offset&0xe)>>1))^0xFF); // mask out the old bit m_led_array |= ((offset&1)<<((offset&0xe)>>1)); // OR in the new bit m_led_7seg_counter = 0; @@ -106,9 +105,8 @@ WRITE8_MEMBER( decwriter_state::la120_LED_w ) { m_led_7seg_counter++; m_led_7seg_counter &= 0xF; -#ifdef LED_VERBOSE - logerror("Updated 7seg display: displaying a digit of %d in position %d\n", (offset&0xF)^0xF, m_led_7seg_counter-1); -#endif + if (LED_VERBOSE) + logerror("Updated 7seg display: displaying a digit of %d in position %d\n", (offset&0xF)^0xF, m_led_7seg_counter-1); if ((m_led_7seg_counter >= 1) && (m_led_7seg_counter <= 4)) { m_led_7seg[m_led_7seg_counter-1] = (offset&0xF)^0xF; @@ -150,7 +148,7 @@ WRITE8_MEMBER( decwriter_state::la120_NVR_w ) m_nvm->c1_w(BIT(offset, 8)); // C2 is used to disable pullup on data line - m_nvm->data_w(!BIT(offset, 9) ? 0 : BIT(data, 7)); + m_nvm->data_w(!BIT(offset, 9) ? 0 : !BIT(data, 7)); m_nvm->clock_w(BIT(offset, 0)); } @@ -173,7 +171,8 @@ WRITE8_MEMBER( decwriter_state::la120_NVR_w ) READ8_MEMBER( decwriter_state::la120_DC305_r ) { uint8_t data = 0x00; - logerror("DC305 Read from offset %01x, returning %02X\n", offset, data); + if (DC305_VERBOSE) + logerror("DC305 Read from offset %01x, returning %02X\n", offset, data); return data; } /* write registers: @@ -188,7 +187,8 @@ READ8_MEMBER( decwriter_state::la120_DC305_r ) */ WRITE8_MEMBER( decwriter_state::la120_DC305_w ) { - logerror("DC305 Write of %02X to offset %01X\n", data, offset); + if (DC305_VERBOSE) + logerror("DC305 Write of %02X to offset %01X\n", data, offset); } /* From b1bc1d963c732a130e75adbe017ad5b5980af117 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 31 Dec 2017 13:45:09 -0500 Subject: [PATCH 2/2] v100: Add ER1400 (nw) --- src/mame/drivers/v100.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/v100.cpp b/src/mame/drivers/v100.cpp index e61dfeda9d6..8be5c4e9bb3 100644 --- a/src/mame/drivers/v100.cpp +++ b/src/mame/drivers/v100.cpp @@ -9,7 +9,7 @@ Skeleton driver for Visual 100 display terminal. #include "emu.h" #include "cpu/z80/z80.h" #include "machine/com8116.h" -//#include "machine/er1400.h" +#include "machine/er1400.h" #include "machine/i8214.h" #include "machine/i8251.h" #include "machine/i8255.h" @@ -22,14 +22,28 @@ public: v100_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_earom(*this, "earom") , m_p_chargen(*this, "chargen") { } + DECLARE_READ8_MEMBER(earom_r); + DECLARE_WRITE8_MEMBER(ppi_porta_w); + private: required_device m_maincpu; + required_device m_earom; required_region_ptr m_p_chargen; }; +READ8_MEMBER(v100_state::earom_r) +{ + return m_earom->data_r(); +} + +WRITE8_MEMBER(v100_state::ppi_porta_w) +{ + logerror("Writing %02X to PPI port A\n", data); +} static ADDRESS_MAP_START( mem_map, AS_PROGRAM, 8, v100_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("maincpu", 0) @@ -44,7 +58,7 @@ static ADDRESS_MAP_START( io_map, AS_IO, 8, v100_state ) AM_RANGE(0x13, 0x13) AM_DEVREADWRITE("usart", i8251_device, status_r, control_w) // 0x14-0x15 - second 8251 (not populated) // 0x16 - second 8116T (not populated) - // 0x20 - read ??? + AM_RANGE(0x20, 0x20) AM_READ(earom_r) // 0x30 - write ??? AM_RANGE(0x40, 0x40) AM_NOP // read/write ??? // 0x48 - write ??? @@ -73,6 +87,14 @@ static MACHINE_CONFIG_START( v100 ) MCFG_DEVICE_ADD("picu", I8214, XTAL_47_736MHz / 12) MCFG_DEVICE_ADD("ppi", I8255, 0) + MCFG_I8255_OUT_PORTA_CB(WRITE8(v100_state, ppi_porta_w)) + MCFG_I8255_OUT_PORTB_CB(DEVWRITELINE("earom", er1400_device, c3_w)) MCFG_DEVCB_BIT(6) MCFG_DEVCB_INVERT + MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("earom", er1400_device, c2_w)) MCFG_DEVCB_BIT(5) MCFG_DEVCB_INVERT + MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("earom", er1400_device, c1_w)) MCFG_DEVCB_BIT(4) MCFG_DEVCB_INVERT + MCFG_I8255_OUT_PORTC_CB(DEVWRITELINE("earom", er1400_device, data_w)) MCFG_DEVCB_BIT(6) MCFG_DEVCB_INVERT + MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("earom", er1400_device, clock_w)) MCFG_DEVCB_BIT(0) MCFG_DEVCB_INVERT + + MCFG_DEVICE_ADD("earom", ER1400, 0) MACHINE_CONFIG_END