mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
macprtb: convert to new SWIM [R. Belmont]
This commit is contained in:
parent
fb58ad9d8e
commit
a3903f6e88
@ -92,10 +92,9 @@
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m6502/m5074x.h"
|
||||
#include "machine/6522via.h"
|
||||
#include "machine/applefdc.h"
|
||||
#include "machine/ram.h"
|
||||
#include "machine/sonydriv.h"
|
||||
#include "machine/swim.h"
|
||||
#include "machine/applefdintf.h"
|
||||
#include "machine/swim1.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/z80scc.h"
|
||||
#include "machine/macadb.h"
|
||||
@ -125,11 +124,14 @@ public:
|
||||
m_macadb(*this, "macadb"),
|
||||
m_ncr5380(*this, "ncr5380"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_iwm(*this, "fdc"),
|
||||
m_swim(*this, "fdc"),
|
||||
m_floppy(*this, "fdc:%d", 0U),
|
||||
m_screen(*this, "screen"),
|
||||
m_asc(*this, "asc"),
|
||||
m_scc(*this, "scc"),
|
||||
m_vram(*this, "vram")
|
||||
m_vram(*this, "vram"),
|
||||
m_cur_floppy(nullptr),
|
||||
m_hdsel(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -145,12 +147,16 @@ private:
|
||||
required_device<macadb_device> m_macadb;
|
||||
required_device<ncr5380_device> m_ncr5380;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<applefdc_base_device> m_iwm;
|
||||
required_device<applefdintf_device> m_swim;
|
||||
required_device_array<floppy_connector, 2> m_floppy;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<asc_device> m_asc;
|
||||
required_device<z80scc_device> m_scc;
|
||||
required_shared_ptr<uint16_t> m_vram;
|
||||
|
||||
floppy_image_device *m_cur_floppy;
|
||||
int m_hdsel;
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
@ -173,6 +179,9 @@ private:
|
||||
int m_via_cycles, m_via_interrupt, m_scc_interrupt, m_asc_interrupt, m_last_taken_interrupt;
|
||||
int m_irq_count, m_ca1_data, m_ca2_data;
|
||||
|
||||
void phases_w(uint8_t phases);
|
||||
void devsel_w(uint8_t devsel);
|
||||
|
||||
uint16_t rom_switch_r(offs_t offset);
|
||||
bool m_overlay;
|
||||
|
||||
@ -188,15 +197,15 @@ private:
|
||||
|
||||
uint16_t mac_iwm_r(offs_t offset, uint16_t mem_mask)
|
||||
{
|
||||
uint16_t result = m_iwm->read(offset >> 8);
|
||||
uint16_t result = m_swim->read((offset >> 8) & 0xf);
|
||||
return (result << 8) | result;
|
||||
}
|
||||
void mac_iwm_w(offs_t offset, uint16_t data, uint16_t mem_mask)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
m_iwm->write((offset >> 8), data & 0xff);
|
||||
m_swim->write((offset >> 8) & 0xf, data & 0xff);
|
||||
else
|
||||
m_iwm->write((offset >> 8), data>>8);
|
||||
m_swim->write((offset >> 8) & 0xf, data>>8);
|
||||
}
|
||||
|
||||
uint16_t mac_autovector_r(offs_t offset) { return 0; }
|
||||
@ -452,30 +461,39 @@ void macportable_state::mac_via_out_a(uint8_t data)
|
||||
void macportable_state::mac_via_out_b(uint8_t data)
|
||||
{
|
||||
//printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data);
|
||||
sony_set_sel_line(m_iwm.target(), (data & 0x20) >> 5);
|
||||
int hdsel = BIT(data, 5);
|
||||
if (hdsel != m_hdsel)
|
||||
{
|
||||
if (m_cur_floppy)
|
||||
{
|
||||
m_cur_floppy->ss_w(hdsel);
|
||||
}
|
||||
m_hdsel = hdsel;
|
||||
}
|
||||
m_pmu_req = (data & 1);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIG
|
||||
***************************************************************************/
|
||||
|
||||
static const applefdc_interface mac_iwm_interface =
|
||||
void macportable_state::phases_w(uint8_t phases)
|
||||
{
|
||||
sony_set_lines,
|
||||
sony_set_enable_lines,
|
||||
if (m_cur_floppy)
|
||||
{
|
||||
m_cur_floppy->seek_phase_w(phases);
|
||||
}
|
||||
}
|
||||
|
||||
sony_read_data,
|
||||
sony_write_data,
|
||||
sony_read_status
|
||||
};
|
||||
|
||||
static const floppy_interface mac_floppy_interface =
|
||||
void macportable_state::devsel_w(uint8_t devsel)
|
||||
{
|
||||
FLOPPY_STANDARD_3_5_DSHD,
|
||||
LEGACY_FLOPPY_OPTIONS_NAME(apple35_mac),
|
||||
"floppy_3_5"
|
||||
};
|
||||
if (devsel == 1)
|
||||
m_cur_floppy = m_floppy[0]->get_device();
|
||||
else if (devsel == 2)
|
||||
m_cur_floppy = m_floppy[1]->get_device();
|
||||
else
|
||||
m_cur_floppy = nullptr;
|
||||
|
||||
m_swim->set_floppy(m_cur_floppy);
|
||||
if (m_cur_floppy)
|
||||
m_cur_floppy->ss_w(m_hdsel);
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( macadb )
|
||||
INPUT_PORTS_END
|
||||
@ -515,8 +533,12 @@ void macportable_state::macprtb(machine_config &config)
|
||||
m_macadb->set_mcu_mode(true);
|
||||
m_macadb->adb_data_callback().set(FUNC(macportable_state::set_adb_line));
|
||||
|
||||
LEGACY_IWM(config, m_iwm, &mac_iwm_interface);
|
||||
sonydriv_floppy_image_device::legacy_2_drives_add(config, &mac_floppy_interface);
|
||||
SWIM1(config, m_swim, C15M);
|
||||
m_swim->phases_cb().set(FUNC(macportable_state::phases_w));
|
||||
m_swim->devsel_cb().set(FUNC(macportable_state::devsel_w));
|
||||
|
||||
applefdintf_device::add_35_hd(config, m_floppy[0]);
|
||||
applefdintf_device::add_35_nc(config, m_floppy[1]);
|
||||
|
||||
scsi_port_device &scsibus(SCSI_PORT(config, "scsi"));
|
||||
scsibus.set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6));
|
||||
|
Loading…
Reference in New Issue
Block a user