summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2019-02-16 20:11:35 -0500
committer arbee <rb6502@users.noreply.github.com>2019-02-16 20:11:35 -0500
commitb24ab57233e681e6f4130ab65bbe45cca049d23f (patch)
tree462980f27c7814cf18399aeba0c50b75f37fd519
parent330727ee639f9e18f410757d85468528ae6a5d10 (diff)
apple2: AppleWin-like memory fill; fixes hang in Joust [R. Belmont]
-rw-r--r--src/mame/drivers/apple2.cpp33
-rw-r--r--src/mame/drivers/apple2e.cpp8
2 files changed, 27 insertions, 14 deletions
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp
index f01df1d4176..0da7e729343 100644
--- a/src/mame/drivers/apple2.cpp
+++ b/src/mame/drivers/apple2.cpp
@@ -322,6 +322,12 @@ void apple2_state::machine_start()
m_slotdevice[i] = m_a2bus->get_a2bus_card(i);
}
+ for (int adr = 0; adr < 0x10000; adr += 2)
+ {
+ m_ram_ptr[adr] = 0;
+ m_ram_ptr[adr+1] = 0xff;
+ }
+
// setup save states
save_item(NAME(m_speaker_state));
save_item(NAME(m_cassette_state));
@@ -626,42 +632,41 @@ READ8_MEMBER(apple2_state::switches_r)
READ8_MEMBER(apple2_state::flags_r)
{
- uint8_t busdata = 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) | busdata;
+ return (m_cassette->input() > 0.0 ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 1: // button 0
- return (BIT(m_joybuttons->read(), 4) ? 0x80 : 0) | busdata;
+ return ((m_joybuttons->read() & 0x10) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 2: // button 1
- return (BIT(m_joybuttons->read(), 5) ? 0x80 : 0) | busdata;
+ return ((m_joybuttons->read() & 0x20) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 3: // button 2
// check if SHIFT key mod configured
- if (BIT(m_sysconfig->read(), 2))
- return ((BIT(m_joybuttons->read(), 6) || (m_kbspecial->read() & 0x06) != 0) ? 0x80 : 0) | busdata;
- else
- return (BIT(m_joybuttons->read(), 6) ? 0x80 : 0) | busdata;
+ if (m_sysconfig->read() & 0x04)
+ {
+ return (((m_joybuttons->read() & 0x40) || (m_kbspecial->read() & 0x06)) ? 0x80 : 0) | (read_floatingbus() & 0x3f);
+ }
+ 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) | busdata;
+ return ((machine().time().as_double() < m_joystick_x1_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 5: // joy 1 Y axis
- return ((machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0) | busdata;
+ return ((machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 6: // joy 2 X axis
- return ((machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0) | busdata;
+ return ((machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
case 7: // joy 2 Y axis
- return ((machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0) | busdata;
+ return ((machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0) | (read_floatingbus() & 0x7f);
}
// this is never reached
- return busdata;
+ return 0;
}
READ8_MEMBER(apple2_state::controller_strobe_r)
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp
index b560a9b8917..f4a6acc566b 100644
--- a/src/mame/drivers/apple2e.cpp
+++ b/src/mame/drivers/apple2e.cpp
@@ -818,6 +818,14 @@ 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)
+ {
+ m_ram_ptr[adr] = 0;
+ m_ram_ptr[adr+1] = 0xff;
+ m_aux_ptr[adr] = 0;
+ m_aux_ptr[adr+1] = 0xff;
+ }
+
m_inh_slot = -1;
m_cnxx_slot = CNXX_UNCLAIMED;
m_mockingboard4c = false;