From f3297ec66aea0298adc58a0fce38da0557d3541c Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 10 Oct 2020 19:31:24 -0400 Subject: [PATCH] apple2 updates: [R. Belmont] - Ignore keys that come in immediately on startup (fixes some programs not showing intro screens) - Fix Apple IIc and IIc Plus having Video 7 RGB modes, which isn't possible on hardware --- src/mame/drivers/apple2.cpp | 9 +++++++++ src/mame/drivers/apple2e.cpp | 29 ++++++++++++++++++++--------- src/mame/drivers/apple2gs.cpp | 8 ++++++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 00aa48f9f02..2f33aeece2c 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -1058,6 +1058,15 @@ WRITE_LINE_MEMBER(apple2_state::ay3600_data_ready_w) if (state == ASSERT_LINE) { int mod = 0; + + // if the user presses a valid key to start the driver from the info screen, + // we will see that key. ignore keys in the first 25,000 cycles (in my tests, + // the unwanted key shows up at 17030 cycles) + if (m_maincpu->total_cycles() < 25000) + { + return; + } + m_lastchar = m_ay3600->b_r(); mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00; diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 6831a79c7f7..fc533eeb125 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -1024,6 +1024,8 @@ void apple2e_state::machine_reset() m_slotc3rom = false; m_romswitch = false; m_irqmask = 0; + m_strobe = 0; + m_transchar = 0; m_anykeydown = false; m_repeatdelay = 10; m_xy = false; @@ -1775,7 +1777,7 @@ void apple2e_state::do_io(int offset, bool is_iic) uint8_t apple2e_state::c000_r(offs_t offset) { if(machine().side_effects_disabled()) return read_floatingbus(); - u8 uFloatingBus7 = read_floatingbus() & 0x7f; + const u8 uFloatingBus7 = read_floatingbus() & 0x7f; if ((offset & 0xf0) == 0x00) // keyboard latch, $C000 is really 00-0F { @@ -2168,7 +2170,7 @@ uint8_t apple2e_state::c000_iic_r(offs_t offset) return m_y0edge ? 0x80 : 0x00; case 0x60: // 40/80 column switch (IIc only) - return ((m_sysconfig->read() & 0x04) ? 0x80 : 0) | uFloatingBus7; + return ((m_sysconfig->read() & 0x40) ? 0x80 : 0) | uFloatingBus7; case 0x61: // button 0 or Open Apple or mouse button 1 case 0x69: @@ -3289,6 +3291,14 @@ WRITE_LINE_MEMBER(apple2e_state::ay3600_data_ready_w) uint8_t *decode = m_kbdrom->base(); uint16_t trans; + // if the user presses a valid key to start the driver from the info screen, + // we will see that key. ignore keys in the first 25,000 cycles (in my tests, + // the unwanted key shows up at 17030 cycles) + if (m_maincpu->total_cycles() < 25000) + { + return; + } + m_lastchar = m_ay3600->b_r(); trans = m_lastchar & ~(0x1c0); // clear the 3600's control/shift stuff @@ -3308,7 +3318,7 @@ WRITE_LINE_MEMBER(apple2e_state::ay3600_data_ready_w) if (m_isiic) { - if (m_sysconfig->read() & 0x08) + if (m_sysconfig->read() & 0x80) { trans += 0x400; // go to DVORAK half of the ROM } @@ -3317,7 +3327,7 @@ WRITE_LINE_MEMBER(apple2e_state::ay3600_data_ready_w) m_transchar = decode[trans]; m_strobe = 0x80; - //printf("new char = %04x (%02x)\n", m_lastchar, m_transchar); + printf("new char = %04x (%02x)\n", m_lastchar, m_transchar); } } @@ -3380,17 +3390,18 @@ INPUT_PORTS_END static INPUT_PORTS_START( apple2c_sysconfig ) PORT_START("a2_config") - PORT_CONFNAME(0x03, 0x00, "Composite monitor type") + PORT_CONFNAME(0x07, 0x00, "Composite monitor type") PORT_CONFSETTING(0x00, "Color") PORT_CONFSETTING(0x01, "B&W") PORT_CONFSETTING(0x02, "Green") PORT_CONFSETTING(0x03, "Amber") - PORT_CONFNAME(0x04, 0x04, "40/80 Columns") + + PORT_CONFNAME(0x40, 0x40, "40/80 Columns") PORT_CONFSETTING(0x00, "80 columns") - PORT_CONFSETTING(0x04, "40 columns") - PORT_CONFNAME(0x08, 0x00, "QWERTY/DVORAK") + PORT_CONFSETTING(0x40, "40 columns") + PORT_CONFNAME(0x80, 0x00, "QWERTY/DVORAK") PORT_CONFSETTING(0x00, "QWERTY") - PORT_CONFSETTING(0x08, "DVORAK") + PORT_CONFSETTING(0x80, "DVORAK") PORT_CONFNAME(0x10, 0x00, "CPU type") PORT_CONFSETTING(0x00, "Standard") diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 6fba7c03c29..28f1296e22c 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -784,6 +784,14 @@ WRITE_LINE_MEMBER(apple2gs_state::ay3600_data_ready_w) uint8_t *decode = m_kbdrom->base(); uint16_t trans; + // if the user presses a valid key to start the driver from the info screen, + // we will see that key. ignore keys in the first 25,000 cycles (in my tests, + // the unwanted key shows up at 17030 cycles) + if (m_maincpu->total_cycles() < 25000) + { + return; + } + m_lastchar = m_ay3600->b_r(); trans = m_lastchar & ~(0x1c0); // clear the 3600's control/shift stuff