From 36f2cac9a7c8cfc12da0e5b1d4dfc5152c1710a3 Mon Sep 17 00:00:00 2001 From: arbee Date: Thu, 22 Sep 2022 22:09:51 -0400 Subject: [PATCH] lisa.cpp: preliminary switch to modern IWM/floppy devices. [R. Belmont] --- src/mame/apple/lisa.cpp | 61 ++++----------------------------------- src/mame/apple/lisa.h | 10 +++++-- src/mame/apple/lisa_m.cpp | 9 ++++-- 3 files changed, 20 insertions(+), 60 deletions(-) diff --git a/src/mame/apple/lisa.cpp b/src/mame/apple/lisa.cpp index f67f2d2136a..75badfdebef 100644 --- a/src/mame/apple/lisa.cpp +++ b/src/mame/apple/lisa.cpp @@ -46,52 +46,6 @@ void lisa_state::lisa210_fdc_map(address_map &map) map(0x1000, 0x1fff).rom().region("fdccpu", 0x1000); /* ROM */ } - - -/*************************************************************************** - DEVICE CONFIG -***************************************************************************/ - -static void lisa2_set_iwm_enable_lines(device_t *device,int enable_mask) -{ - /* E1 & E2 is connected to the Sony SEL line (?) */ - /*logerror("new sel line state %d\n", (enable_mask) ? 0 : 1);*/ - sony_set_sel_line(device,(enable_mask) ? 0 : 1); -} - -static void lisa210_set_iwm_enable_lines(device_t *device,int enable_mask) -{ - /* E2 is connected to the Sony enable line (?) */ - sony_set_enable_lines(device,enable_mask >> 1); -} - -static const applefdc_interface lisa2_fdc_interface = -{ - sony_set_lines, - lisa2_set_iwm_enable_lines, - - sony_read_data, - sony_write_data, - sony_read_status -}; - -static const applefdc_interface lisa210_fdc_interface = -{ - sony_set_lines, - lisa210_set_iwm_enable_lines, - - sony_read_data, - sony_write_data, - sony_read_status -}; - -static const floppy_interface lisa_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(apple35_mac), - "floppy_5_25" -}; - /*************************************************************************** MACHINE DRIVER ***************************************************************************/ @@ -147,8 +101,12 @@ void lisa_state::lisa(machine_config &config) m_nvram->set_custom_handler(FUNC(lisa_state::nvram_init)); /* devices */ - LEGACY_IWM(config, m_fdc, &lisa2_fdc_interface); - sonydriv_floppy_image_device::legacy_2_drives_add(config, &lisa_floppy_interface); + IWM(config, m_fdc, 8_MHz_XTAL); +// m_iwm->phases_cb().set(FUNC(mac128_state::phases_w)); +// m_iwm->devsel_cb().set(FUNC(mac128_state::devsel_w)); + + applefdintf_device::add_35(config, m_floppy[0]); + applefdintf_device::add_35(config, m_floppy[1]); /* software lists */ SOFTWARE_LIST(config, "disk_list").set_original("lisa"); @@ -171,9 +129,6 @@ void lisa_state::lisa210(machine_config &config) lisa(config); m_fdc_cpu->set_addrmap(AS_PROGRAM, &lisa_state::lisa210_fdc_map); - /* Lisa 2/10 and MacXL had a slightly different FDC interface */ - m_fdc->set_config(&lisa210_fdc_interface); - /* via */ m_via0->set_clock(1250000); m_via1->set_clock(1250000); @@ -486,10 +441,6 @@ ROM_START( macxl ) ROM_LOAD("vidstatem.rom", 0x00, 0x100, BAD_DUMP CRC(75904783) SHA1(3b0023bd90f2ca1be0b099160a566b044856885d)) ROM_END -/* - Lisa drivers boot MacWorks, but do not boot the Lisa OS, which is why we set - the MACHINE_NOT_WORKING flag... -*/ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ COMP( 1983, lisa, 0, 0, lisa, lisa, lisa_state, init_lisa2, "Apple Computer", "Lisa", MACHINE_NOT_WORKING ) COMP( 1984, lisa2, 0, 0, lisa, lisa, lisa_state, init_lisa2, "Apple Computer", "Lisa2", MACHINE_NOT_WORKING ) diff --git a/src/mame/apple/lisa.h b/src/mame/apple/lisa.h index b55b3a6cb94..4e86b0f383c 100644 --- a/src/mame/apple/lisa.h +++ b/src/mame/apple/lisa.h @@ -17,13 +17,15 @@ #include "machine/6522via.h" #include "machine/6522via.h" #include "machine/8530scc.h" -#include "machine/applefdc.h" +#include "machine/applefdintf.h" +#include "machine/iwm.h" #include "machine/nvram.h" -#include "machine/sonydriv.h" #include "sound/spkrdev.h" #include "emupal.h" #include "screen.h" +#include "formats/ap_dsk35.h" + /* lisa MMU segment regs */ struct real_mmu_entry { @@ -107,6 +109,7 @@ public: m_via0(*this, "via6522_0"), m_via1(*this, "via6522_1"), m_fdc(*this, "fdc"), + m_floppy(*this, "fdc:%d", 0U), m_scc(*this, "scc"), m_speaker(*this, "speaker"), m_nvram(*this, "nvram"), @@ -139,7 +142,8 @@ private: required_device m_maincpu; required_device m_via0; required_device m_via1; - optional_device m_fdc; + required_device m_fdc; + required_device_array m_floppy; required_device m_scc; required_device m_speaker; required_device m_nvram; diff --git a/src/mame/apple/lisa_m.cpp b/src/mame/apple/lisa_m.cpp index b255d5c912c..f9e7d73af51 100644 --- a/src/mame/apple/lisa_m.cpp +++ b/src/mame/apple/lisa_m.cpp @@ -959,10 +959,12 @@ void lisa_state::machine_reset() COPS_via_out_ca2(0); /* VIA core forgets to do so */ /* initialize floppy */ + #if 0 if (m_features.floppy_hardware == sony_lisa2) { sony_set_enable_lines(m_fdc, 1); /* on lisa2, drive unit 1 is always selected (?) */ } + #endif } INTERRUPT_GEN_MEMBER(lisa_state::lisa_interrupt) @@ -1083,6 +1085,7 @@ void lisa_state::lisa_fdc_ttl_glue_access(offs_t offset) /* enable/disable the motor on Lisa 1 */ /* can disable the motor on Lisa 2/10, too (although it is not useful) */ /* On lisa 2, commands the loading of the speed register on lisalite board */ + #if 0 if (m_features.floppy_hardware == sony_lisa2) { int oldMT1 = m_MT1; @@ -1095,6 +1098,7 @@ void lisa_state::lisa_fdc_ttl_glue_access(offs_t offset) sony_set_speed(((256-m_PWM_floppy_motor_speed) * 1.3) + 237); } } + #endif /*else m_MT1 = offset & 1;*/ break; @@ -1107,9 +1111,10 @@ void lisa_state::lisa_fdc_ttl_glue_access(offs_t offset) if (m_features.floppy_hardware == twiggy) twiggy_set_head_line(offset & 1); else -#endif + if (m_features.floppy_hardware == sony_lisa210) sony_set_sel_line(m_fdc, offset & 1); +#endif break; case 6: m_DISK_DIAG = offset & 1; @@ -1168,9 +1173,9 @@ void lisa_state::lisa_fdc_io_w(offs_t offset, uint8_t data) if (m_features.floppy_hardware == twiggy) twiggy_set_speed((256-data) * 1.3 /* ??? */ + 237 /* ??? */); else -#endif if (m_features.floppy_hardware == sony_lisa210) sony_set_speed(((256-data) * 1.3) + 237); +#endif break; case 3: /* not used */