mirror of
https://github.com/holub/mame
synced 2025-05-11 08:38:47 +03:00
apple2: Support for Focus Drive IDE interface. [R. Belmont, anonymous]
This commit is contained in:
parent
00dcbb3d7b
commit
ca475f4559
@ -2,16 +2,19 @@
|
|||||||
// copyright-holders:R. Belmont
|
// copyright-holders:R. Belmont
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
||||||
a2zipdrive.c
|
a2zipdrive.cpp
|
||||||
|
|
||||||
ZIP Technologies ZipDrive IDE card
|
ZIP Technologies ZipDrive IDE card
|
||||||
|
Parsons Engineering Focus Drive IDE card
|
||||||
|
|
||||||
NOTE: No known dump exists of the formatter utility and the
|
These cards are very, very similar. Maybe Parsons designed both?
|
||||||
|
|
||||||
|
NOTE: No known dump exists of the Zip formatter utility and the
|
||||||
format of the custom partition record (block 0) that the card
|
format of the custom partition record (block 0) that the card
|
||||||
expects has not yet been determined, so this is largely untested
|
expects has not yet been determined, so this is largely untested
|
||||||
and will work only with a drive dump from real h/w.
|
and will work only with a drive dump from real h/w.
|
||||||
|
|
||||||
PLEASE use it only on a backup copy of said dump and contact MESSdev
|
PLEASE use it only on a backup copy of said dump and contact MAMEdev
|
||||||
if you have one!
|
if you have one!
|
||||||
|
|
||||||
Partition block format:
|
Partition block format:
|
||||||
@ -29,6 +32,7 @@
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
DEFINE_DEVICE_TYPE(A2BUS_ZIPDRIVE, a2bus_zipdrive_device, "a2zipdrv", "Zip Technologies ZipDrive")
|
DEFINE_DEVICE_TYPE(A2BUS_ZIPDRIVE, a2bus_zipdrive_device, "a2zipdrv", "Zip Technologies ZipDrive")
|
||||||
|
DEFINE_DEVICE_TYPE(A2BUS_FOCUSDRIVE, a2bus_focusdrive_device, "a2focdrv", "Parsons Engineering Focus Drive")
|
||||||
|
|
||||||
#define ZIPDRIVE_ROM_REGION "zipdrive_rom"
|
#define ZIPDRIVE_ROM_REGION "zipdrive_rom"
|
||||||
#define ZIPDRIVE_ATA_TAG "zipdrive_ata"
|
#define ZIPDRIVE_ATA_TAG "zipdrive_ata"
|
||||||
@ -38,6 +42,11 @@ ROM_START( zipdrive )
|
|||||||
ROM_LOAD( "zip drive - rom.bin", 0x000000, 0x002000, CRC(fd800a40) SHA1(46636bfed88c864139e3d2826661908a8c07c459) )
|
ROM_LOAD( "zip drive - rom.bin", 0x000000, 0x002000, CRC(fd800a40) SHA1(46636bfed88c864139e3d2826661908a8c07c459) )
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
|
ROM_START( focusdrive )
|
||||||
|
ROM_REGION(0x2000, ZIPDRIVE_ROM_REGION, 0)
|
||||||
|
ROM_LOAD( "focusrom.bin", 0x001000, 0x001000, CRC(0fd0ba25) SHA1(acf414aa145fcfa1c12aca0269f1f7ada82f1c04) )
|
||||||
|
ROM_END
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
FUNCTION PROTOTYPES
|
FUNCTION PROTOTYPES
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
@ -60,6 +69,11 @@ const tiny_rom_entry *a2bus_zipdrivebase_device::device_rom_region() const
|
|||||||
return ROM_NAME( zipdrive );
|
return ROM_NAME( zipdrive );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tiny_rom_entry *a2bus_focusdrive_device::device_rom_region() const
|
||||||
|
{
|
||||||
|
return ROM_NAME( focusdrive );
|
||||||
|
}
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// LIVE DEVICE
|
// LIVE DEVICE
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -76,6 +90,11 @@ a2bus_zipdrive_device::a2bus_zipdrive_device(const machine_config &mconfig, cons
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a2bus_focusdrive_device::a2bus_focusdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||||
|
a2bus_zipdrivebase_device(mconfig, A2BUS_FOCUSDRIVE, tag, owner, clock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_start - device-specific startup
|
// device_start - device-specific startup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -89,9 +108,12 @@ void a2bus_zipdrivebase_device::device_start()
|
|||||||
|
|
||||||
void a2bus_zipdrivebase_device::device_reset()
|
void a2bus_zipdrivebase_device::device_reset()
|
||||||
{
|
{
|
||||||
popmessage("Zip Drive partition format unknown, contact MESSdev if you have the software or a drive dump!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void a2bus_focusdrive_device::device_reset()
|
||||||
|
{
|
||||||
|
m_rom[0x1c6c] = 0x03; // eat 3 IDE words here instead of 1, fixes a bug? in the original ROM
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
read_c0nx - called for reads from this card's c0nx space
|
read_c0nx - called for reads from this card's c0nx space
|
||||||
@ -112,7 +134,7 @@ uint8_t a2bus_zipdrivebase_device::read_c0nx(uint8_t offset)
|
|||||||
return m_ata->read_cs0(offset, 0xff);
|
return m_ata->read_cs0(offset, 0xff);
|
||||||
|
|
||||||
case 8: // data port
|
case 8: // data port
|
||||||
m_lastdata = m_ata->read_cs0(offset);
|
m_lastdata = m_ata->read_cs0(offset, 0xffff);
|
||||||
// printf("%04x @ IDE data\n", m_lastdata);
|
// printf("%04x @ IDE data\n", m_lastdata);
|
||||||
return m_lastdata&0xff;
|
return m_lastdata&0xff;
|
||||||
|
|
||||||
@ -120,13 +142,42 @@ uint8_t a2bus_zipdrivebase_device::read_c0nx(uint8_t offset)
|
|||||||
return (m_lastdata>>8) & 0xff;
|
return (m_lastdata>>8) & 0xff;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("a2zipdrive: unhandled read @ C0n%x\n", offset);
|
logerror("unhandled read @ C0n%x\n", offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0xff;
|
return 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t a2bus_focusdrive_device::read_c0nx(uint8_t offset)
|
||||||
|
{
|
||||||
|
switch (offset)
|
||||||
|
{
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
case 0xa:
|
||||||
|
case 0xb:
|
||||||
|
case 0xc:
|
||||||
|
case 0xd:
|
||||||
|
case 0xe:
|
||||||
|
case 0xf:
|
||||||
|
return m_ata->read_cs0(offset&7, 0xff);
|
||||||
|
|
||||||
|
case 0: // data port
|
||||||
|
m_lastdata = m_ata->read_cs0(offset, 0xffff);
|
||||||
|
//printf("%04x @ IDE data\n", m_lastdata);
|
||||||
|
return m_lastdata&0xff;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
return (m_lastdata>>8) & 0xff;
|
||||||
|
|
||||||
|
default:
|
||||||
|
logerror("unhandled read @ C0n%x\n", offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
write_c0nx - called for writes to this card's c0nx space
|
write_c0nx - called for writes to this card's c0nx space
|
||||||
@ -157,7 +208,7 @@ void a2bus_zipdrivebase_device::write_c0nx(uint8_t offset, uint8_t data)
|
|||||||
// printf("%02x to IDE data hi\n", data);
|
// printf("%02x to IDE data hi\n", data);
|
||||||
m_lastdata &= 0x00ff;
|
m_lastdata &= 0x00ff;
|
||||||
m_lastdata |= (data << 8);
|
m_lastdata |= (data << 8);
|
||||||
m_ata->write_cs0(0, m_lastdata);
|
m_ata->write_cs0(0, m_lastdata, 0xffff);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -166,6 +217,48 @@ void a2bus_zipdrivebase_device::write_c0nx(uint8_t offset, uint8_t data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void a2bus_focusdrive_device::write_c0nx(uint8_t offset, uint8_t data)
|
||||||
|
{
|
||||||
|
switch (offset)
|
||||||
|
{
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
case 0xa:
|
||||||
|
case 0xb:
|
||||||
|
case 0xc:
|
||||||
|
case 0xd:
|
||||||
|
case 0xe:
|
||||||
|
case 0xf:
|
||||||
|
// due to a bug in the 6502 firmware, eat data if DRQ is set
|
||||||
|
#if 0
|
||||||
|
while (m_ata->read_cs0(7, 0xff) & 0x08)
|
||||||
|
{
|
||||||
|
m_ata->read_cs0(0, 0xffff);
|
||||||
|
printf("eating 2 bytes to clear DRQ\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// printf("%02x to IDE controller @ %x\n", data, offset);
|
||||||
|
m_ata->write_cs0(offset & 7, data, 0xff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
// printf("%02x to IDE data lo\n", data);
|
||||||
|
m_lastdata = data;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
// printf("%02x to IDE data hi\n", data);
|
||||||
|
m_lastdata &= 0x00ff;
|
||||||
|
m_lastdata |= (data << 8);
|
||||||
|
m_ata->write_cs0(0, m_lastdata, 0xffff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("focus: write %02x @ unhandled C0n%x\n", data, offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
read_cnxx - called for reads from this card's cnxx space
|
read_cnxx - called for reads from this card's cnxx space
|
||||||
-------------------------------------------------*/
|
-------------------------------------------------*/
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
a2zipdrive.h
|
a2zipdrive.h
|
||||||
|
|
||||||
ZIP Technologies ZipDrive IDE card
|
ZIP Technologies ZipDrive IDE card
|
||||||
|
Parsons Engineering Focus Drive IDE card
|
||||||
|
|
||||||
See important NOTE at the top of a2zipdrive.c!
|
See important NOTE at the top of a2zipdrive.cpp!
|
||||||
|
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
@ -44,8 +45,6 @@ protected:
|
|||||||
required_device<ata_interface_device> m_ata;
|
required_device<ata_interface_device> m_ata;
|
||||||
|
|
||||||
uint8_t *m_rom;
|
uint8_t *m_rom;
|
||||||
|
|
||||||
private:
|
|
||||||
uint16_t m_lastdata;
|
uint16_t m_lastdata;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,7 +54,20 @@ public:
|
|||||||
a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class a2bus_focusdrive_device : public a2bus_zipdrivebase_device
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
a2bus_focusdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void device_reset() override;
|
||||||
|
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||||
|
virtual uint8_t read_c0nx(uint8_t offset) override;
|
||||||
|
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
|
||||||
|
};
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
DECLARE_DEVICE_TYPE(A2BUS_ZIPDRIVE, a2bus_zipdrive_device)
|
DECLARE_DEVICE_TYPE(A2BUS_ZIPDRIVE, a2bus_zipdrive_device)
|
||||||
|
DECLARE_DEVICE_TYPE(A2BUS_FOCUSDRIVE, a2bus_focusdrive_device)
|
||||||
|
|
||||||
#endif // MAME_BUS_A2BUS_ZIPDRIVE_H
|
#endif // MAME_BUS_A2BUS_ZIPDRIVE_H
|
||||||
|
@ -4522,6 +4522,7 @@ static void apple2_cards(device_slot_interface &device)
|
|||||||
device.option_add("arcbd", A2BUS_ARCADEBOARD); /* Third Millenium Engineering Arcade Board */
|
device.option_add("arcbd", A2BUS_ARCADEBOARD); /* Third Millenium Engineering Arcade Board */
|
||||||
device.option_add("midi", A2BUS_MIDI); /* Generic 6840+6850 MIDI board */
|
device.option_add("midi", A2BUS_MIDI); /* Generic 6840+6850 MIDI board */
|
||||||
device.option_add("zipdrive", A2BUS_ZIPDRIVE); /* ZIP Technologies IDE card */
|
device.option_add("zipdrive", A2BUS_ZIPDRIVE); /* ZIP Technologies IDE card */
|
||||||
|
device.option_add("focusdrive", A2BUS_FOCUSDRIVE); /* Focus Drive IDE card */
|
||||||
device.option_add("echoiiplus", A2BUS_ECHOPLUS); /* Street Electronics Echo Plus (Echo II + Mockingboard clone) */
|
device.option_add("echoiiplus", A2BUS_ECHOPLUS); /* Street Electronics Echo Plus (Echo II + Mockingboard clone) */
|
||||||
device.option_add("scsi", A2BUS_SCSI); /* Apple II SCSI Card */
|
device.option_add("scsi", A2BUS_SCSI); /* Apple II SCSI Card */
|
||||||
device.option_add("applicard", A2BUS_APPLICARD); /* PCPI Applicard */
|
device.option_add("applicard", A2BUS_APPLICARD); /* PCPI Applicard */
|
||||||
|
Loading…
Reference in New Issue
Block a user