diff options
author | arbee <rb6502@users.noreply.github.com> | 2019-02-18 12:10:09 -0500 |
---|---|---|
committer | arbee <rb6502@users.noreply.github.com> | 2019-02-18 12:10:09 -0500 |
commit | b3fd940df90edfab980f698869be5d823815dc73 (patch) | |
tree | 178dfb525fc0218c64b97fdbed119027f343a147 | |
parent | 9801aecb372a0ec4d17068ad4b3504fa566ca3a4 (diff) |
(nw)
-rw-r--r-- | src/mame/drivers/apple2.cpp | 22 | ||||
-rw-r--r-- | src/mame/drivers/apple2e.cpp | 16 |
2 files changed, 25 insertions, 13 deletions
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 0da7e729343..e28ff9abba1 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -322,7 +322,7 @@ void apple2_state::machine_start() m_slotdevice[i] = m_a2bus->get_a2bus_card(i); } - for (int adr = 0; adr < 0x10000; adr += 2) + for (int adr = 0; adr < m_ram_size; adr += 2) { m_ram_ptr[adr] = 0; m_ram_ptr[adr+1] = 0xff; @@ -632,37 +632,39 @@ READ8_MEMBER(apple2_state::switches_r) READ8_MEMBER(apple2_state::flags_r) { + u8 uFloatingBus7 = read_floatingbus() & 0x7f; + // Y output of 74LS251 at H14 read as D7 switch (offset) { - case 0: // cassette in - return (m_cassette->input() > 0.0 ? 0x80 : 0) | (read_floatingbus() & 0x7f); + case 0: // cassette in (accidentally read at $C068 by ProDOS to attempt IIgs STATE register) + return (m_cassette->input() > 0.0 ? 0x80 : 0) | uFloatingBus7; case 1: // button 0 - return ((m_joybuttons->read() & 0x10) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((m_joybuttons->read() & 0x10) ? 0x80 : 0) | uFloatingBus7; case 2: // button 1 - return ((m_joybuttons->read() & 0x20) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((m_joybuttons->read() & 0x20) ? 0x80 : 0) | uFloatingBus7; case 3: // button 2 // check if SHIFT key mod configured if (m_sysconfig->read() & 0x04) { - return (((m_joybuttons->read() & 0x40) || (m_kbspecial->read() & 0x06)) ? 0x80 : 0) | (read_floatingbus() & 0x3f); + return (((m_joybuttons->read() & 0x40) || (m_kbspecial->read() & 0x06)) ? 0x80 : 0) | uFloatingBus7; } return ((m_joybuttons->read() & 0x40) ? 0x80 : 0) | (read_floatingbus() & 0x7f); case 4: // joy 1 X axis - return ((machine().time().as_double() < m_joystick_x1_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((machine().time().as_double() < m_joystick_x1_time) ? 0x80 : 0) | uFloatingBus7; case 5: // joy 1 Y axis - return ((machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0) | uFloatingBus7; case 6: // joy 2 X axis - return ((machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0) | uFloatingBus7; case 7: // joy 2 Y axis - return ((machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return ((machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0) | uFloatingBus7; } // this is never reached diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index f4a6acc566b..e86dc6c9d2c 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -818,12 +818,22 @@ void apple2e_state::machine_start() m_video->m_char_ptr = memregion("gfx1")->base(); m_video->m_char_size = memregion("gfx1")->bytes(); - for (int adr = 0; adr < 0x10000; adr += 2) + int ram_size = 0x10000; + if (m_ram_size < 0x10000) + { + ram_size = m_ram_size; + } + + for (int adr = 0; adr < ram_size; adr += 2) { m_ram_ptr[adr] = 0; m_ram_ptr[adr+1] = 0xff; - m_aux_ptr[adr] = 0; - m_aux_ptr[adr+1] = 0xff; + + if (m_ram_size >= (128*1024)) + { + m_aux_ptr[adr] = 0; + m_aux_ptr[adr+1] = 0xff; + } } m_inh_slot = -1; |