diff options
Diffstat (limited to 'src/mame/drivers/apple2.cpp')
-rw-r--r-- | src/mame/drivers/apple2.cpp | 90 |
1 files changed, 31 insertions, 59 deletions
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 4f4e9f3ba35..4c8354f67b1 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -50,7 +50,6 @@ II Plus: RAM options reduced to 16/32/48 KB. #include "machine/kb3600.h" #include "machine/ram.h" #include "machine/timer.h" -#include "machine/apple2common.h" #include "sound/spkrdev.h" @@ -112,7 +111,6 @@ public: m_ram(*this, RAM_TAG), m_ay3600(*this, A2_KBDC_TAG), m_video(*this, A2_VIDEO_TAG), - m_a2common(*this, "a2common"), m_a2bus(*this, "a2bus"), m_joy1x(*this, "joystick_1_x"), m_joy1y(*this, "joystick_1_y"), @@ -135,7 +133,6 @@ public: required_device<ram_device> m_ram; required_device<ay3600_device> m_ay3600; required_device<a2_video_device> m_video; - required_device<apple2_common_device> m_a2common; required_device<a2bus_device> m_a2bus; required_ioport m_joy1x, m_joy1y, m_joy2x, m_joy2y, m_joybuttons; required_ioport m_kbspecial; @@ -231,8 +228,6 @@ private: device_a2bus_card_interface *m_slotdevice[8]; uint8_t read_floatingbus(); - - offs_t dasm_trampoline(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms); }; /*************************************************************************** @@ -243,11 +238,6 @@ private: #define JOYSTICK_SENSITIVITY 50 #define JOYSTICK_AUTOCENTER 80 -offs_t apple2_state::dasm_trampoline(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms) -{ - return m_a2common->dasm_override(stream, pc, opcodes, params); -} - WRITE_LINE_MEMBER(apple2_state::a2bus_irq_w) { m_maincpu->set_input_line(M6502_IRQ_LINE, state); @@ -323,8 +313,8 @@ void apple2_state::machine_start() m_inh_bank = 0; // precalculate joystick time constants - m_x_calibration = attotime::from_nsec(10800).as_double(); - m_y_calibration = attotime::from_nsec(10800).as_double(); + m_x_calibration = attotime::from_usec(12).as_double(); + m_y_calibration = attotime::from_usec(13).as_double(); // cache slot devices for (int i = 0; i <= 7; i++) @@ -332,12 +322,6 @@ void apple2_state::machine_start() m_slotdevice[i] = m_a2bus->get_a2bus_card(i); } - for (int adr = 0; adr < m_ram_size; 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)); @@ -367,7 +351,7 @@ void apple2_state::machine_start() void apple2_state::machine_reset() { - m_inh_slot = 0; + m_inh_slot = -1; m_cnxx_slot = -1; m_page2 = false; m_an0 = m_an1 = m_an2 = m_an3 = false; @@ -642,39 +626,37 @@ 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 (accidentally read at $C068 by ProDOS to attempt IIgs STATE register) - return (m_cassette->input() > 0.0 ? 0x80 : 0) | uFloatingBus7; + case 0: // cassette in + return m_cassette->input() > 0.0 ? 0x80 : 0; case 1: // button 0 - return ((m_joybuttons->read() & 0x10) ? 0x80 : 0) | uFloatingBus7; + return (m_joybuttons->read() & 0x10) ? 0x80 : 0; case 2: // button 1 - return ((m_joybuttons->read() & 0x20) ? 0x80 : 0) | uFloatingBus7; + return (m_joybuttons->read() & 0x20) ? 0x80 : 0; 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) | uFloatingBus7; + return ((m_joybuttons->read() & 0x40) || (m_kbspecial->read() & 0x06)) ? 0x80 : 0; } - return ((m_joybuttons->read() & 0x40) ? 0x80 : 0) | (read_floatingbus() & 0x7f); + return (m_joybuttons->read() & 0x40) ? 0x80 : 0; case 4: // joy 1 X axis - return ((machine().time().as_double() < m_joystick_x1_time) ? 0x80 : 0) | uFloatingBus7; + return (machine().time().as_double() < m_joystick_x1_time) ? 0x80 : 0; case 5: // joy 1 Y axis - return ((machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0) | uFloatingBus7; + return (machine().time().as_double() < m_joystick_y1_time) ? 0x80 : 0; case 6: // joy 2 X axis - return ((machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0) | uFloatingBus7; + return (machine().time().as_double() < m_joystick_x2_time) ? 0x80 : 0; case 7: // joy 2 Y axis - return ((machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0) | uFloatingBus7; + return (machine().time().as_double() < m_joystick_y2_time) ? 0x80 : 0; } // this is never reached @@ -1387,19 +1369,15 @@ static void apple2_cards(device_slot_interface &device) // device.option_add("magicmusician", A2BUS_MAGICMUSICIAN); /* Magic Musician Card */ } -void apple2_state::apple2_common(machine_config &config) -{ +MACHINE_CONFIG_START(apple2_state::apple2_common) /* basic machine hardware */ M6502(config, m_maincpu, 1021800); m_maincpu->set_addrmap(AS_PROGRAM, &apple2_state::apple2_map); - m_maincpu->set_dasm_override(FUNC(apple2_state::dasm_trampoline)); - TIMER(config, m_scantimer, 0); m_scantimer->configure_scanline(FUNC(apple2_state::apple2_interrupt), "screen", 0, 1); config.m_minimum_quantum = attotime::from_hz(60); APPLE2_VIDEO(config, m_video, XTAL(14'318'181)); - APPLE2_COMMON(config, m_a2common, XTAL(14'318'181)); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192); @@ -1446,11 +1424,10 @@ void apple2_state::apple2_common(machine_config &config) /* slot devices */ A2BUS(config, m_a2bus, 0); - m_a2bus->set_space(m_maincpu, AS_PROGRAM); + m_a2bus->set_cputag("maincpu"); m_a2bus->irq_w().set(FUNC(apple2_state::a2bus_irq_w)); m_a2bus->nmi_w().set(FUNC(apple2_state::a2bus_nmi_w)); m_a2bus->inh_w().set(FUNC(apple2_state::a2bus_inh_w)); - m_a2bus->dma_w().set_inputline(m_maincpu, INPUT_LINE_HALT); A2BUS_SLOT(config, "sl0", m_a2bus, apple2_slot0_cards, "lang"); A2BUS_SLOT(config, "sl1", m_a2bus, apple2_cards, nullptr); A2BUS_SLOT(config, "sl2", m_a2bus, apple2_cards, nullptr); @@ -1460,17 +1437,13 @@ void apple2_state::apple2_common(machine_config &config) A2BUS_SLOT(config, "sl6", m_a2bus, apple2_cards, "diskiing"); A2BUS_SLOT(config, "sl7", m_a2bus, apple2_cards, nullptr); - /* Set up the softlists: clean cracks priority, originals second, others last */ - SOFTWARE_LIST(config, "flop525_clean").set_original("apple2_flop_clcracked"); - SOFTWARE_LIST(config, "flop525_orig").set_compatible("apple2_flop_orig").set_filter("A2"); - SOFTWARE_LIST(config, "flop525_misc").set_compatible("apple2_flop_misc"); - SOFTWARE_LIST(config, "cass_list").set_original("apple2_cass"); - //MCFG_SOFTWARE_LIST_ADD("cass_list", "apple2_cass") + MCFG_SOFTWARE_LIST_ADD("flop525_list","apple2") + MCFG_SOFTWARE_LIST_ADD("cass_list", "apple2_cass") - CASSETTE(config, m_cassette); - m_cassette->set_default_state(CASSETTE_STOPPED); - m_cassette->set_interface("apple2_cass"); -} + MCFG_CASSETTE_ADD(A2_CASSETTE_TAG) + MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) + MCFG_CASSETTE_INTERFACE("apple2_cass") +MACHINE_CONFIG_END void apple2_state::apple2(machine_config &config) { @@ -1482,7 +1455,6 @@ void apple2_state::apple2(machine_config &config) void apple2_state::apple2p(machine_config &config) { apple2_common(config); - subdevice<software_list_device>("flop525_orig")->set_filter("A2P"); // Filter list to compatible disks for this machine. /* internal ram */ RAM(config, RAM_TAG).set_default_size("48K").set_extra_options("16K,32K,48K").set_default_value(0x00); } @@ -1492,25 +1464,25 @@ void apple2_state::space84(machine_config &config) apple2p(config); } -void apple2_state::apple2jp(machine_config &config) -{ +MACHINE_CONFIG_START(apple2_state::apple2jp) apple2p(config); - m_screen->set_screen_update(FUNC(apple2_state::screen_update_jp)); -} + MCFG_SCREEN_MODIFY("screen") + MCFG_SCREEN_UPDATE_DRIVER(apple2_state, screen_update_jp) +MACHINE_CONFIG_END #if 0 -void apple2_state::laba2p(machine_config &config) -{ +static MACHINE_CONFIG_START( laba2p ) apple2p(config); MCFG_MACHINE_START_OVERRIDE(apple2_state,laba2p) - config.device_remove("sl0"); - config.device_remove("sl3"); - config.device_remove("sl6"); + MCFG_DEVICE_REMOVE("sl0") + MCFG_DEVICE_REMOVE("sl3") + MCFG_DEVICE_REMOVE("sl6") // A2BUS_LAB_80COL("sl3", A2BUS_LAB_80COL).set_onboard(m_a2bus); A2BUS_IWM_FDC("sl6", A2BUS_IWM_FDC).set_onboard(m_a2bus); -} + +MACHINE_CONFIG_END #endif /*************************************************************************** |