lisa.cpp: preliminary switch to modern IWM/floppy devices. [R. Belmont]

This commit is contained in:
arbee 2022-09-22 22:09:51 -04:00
parent e1c5d065c1
commit 36f2cac9a7
3 changed files with 20 additions and 60 deletions

View File

@ -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 )

View File

@ -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<m68000_base_device> m_maincpu;
required_device<via6522_device> m_via0;
required_device<via6522_device> m_via1;
optional_device<applefdc_base_device> m_fdc;
required_device<applefdintf_device> m_fdc;
required_device_array<floppy_connector, 2> m_floppy;
required_device<scc8530_legacy_device> m_scc;
required_device<speaker_sound_device> m_speaker;
required_device<nvram_device> m_nvram;

View File

@ -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 */