mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
abc1600: Hard disk WIP. (nw)
This commit is contained in:
parent
121aa2fe37
commit
a38cc7e767
@ -37,6 +37,66 @@ Notes:
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
TODO
|
||||
|
||||
- command execution gets stuck in message in phase
|
||||
|
||||
08A88 move.l D7,D0 D0=00000025
|
||||
08A8A lsl.l #5, D0 D0=000004A0
|
||||
08A8C ori.l #$7e000, D0 D0=0007E4A0
|
||||
08A92 movea.l D0, A0 A0=0007E4A0
|
||||
08A94 move.b ($2,A0), D0 D0=0007E4AF
|
||||
08A98 btst #$2, D0
|
||||
08A9C beq $8aa4
|
||||
08AA0 bra $8a88
|
||||
|
||||
[:bus2:4105:sasi:0:s1410] state=3.1 change
|
||||
[:bus2:4105:sasi:0:s1410] state=3.0 change
|
||||
[:bus2:4105:sasi] ctrl .....B.CI stat 0005
|
||||
[:bus2:4105:sasi] 0=ICB
|
||||
[:bus2:4105:sasi] ctrl .....B.CI stat 0005
|
||||
[:bus2:4105:sasi] 0=ICB
|
||||
[:bus2:4105:sasi] ctrl .....B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=ICB
|
||||
[:bus2:4105:sasi] ctrl ...Q.B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=QICB
|
||||
[:bus2:4105:sasi] ctrl ...Q.B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=QICB
|
||||
[:bus2:4105:sasi:0:s1410] state=3.4 change
|
||||
[:bus2:4105:sasi] ctrl ...Q.B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=QICB
|
||||
[:] ':3f' (089A8) STAT 25: 45
|
||||
[:bus2:4105:sasi] ctrl ..KQ.B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=QICB
|
||||
[:bus2:4105:sasi] 1=K
|
||||
[:bus2:4105:sasi:0:s1410] state=3.4 change
|
||||
[:bus2:4105:sasi] ctrl ..K..B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=ICB
|
||||
[:bus2:4105:sasi] 1=K
|
||||
[:bus2:4105:sasi] ctrl .....B.CI stat 0000
|
||||
[:bus2:4105:sasi] 0=ICB
|
||||
[:bus2:4105:sasi:0:s1410] state=3.3 change
|
||||
[:bus2:4105:sasi:0:s1410] state=3.0 change
|
||||
[:bus2:4105:sasi] ctrl .....BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=MICB
|
||||
[:bus2:4105:sasi] ctrl .....BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=MICB
|
||||
[:bus2:4105:sasi] ctrl .....BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=MICB
|
||||
[:bus2:4105:sasi] ctrl ...Q.BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=QMICB
|
||||
[:bus2:4105:sasi] ctrl ...Q.BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=QMICB
|
||||
[:bus2:4105:sasi:0:s1410] state=3.4 change
|
||||
[:bus2:4105:sasi] ctrl ...Q.BMCI min 0000
|
||||
[:bus2:4105:sasi] 0=QMICB
|
||||
[:] ':3f' (089D4) INP 25: 00
|
||||
[:] ':3f' (089E8) STAT 25: 05
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "lux4105.h"
|
||||
#include "bus/scsi/scsihd.h"
|
||||
@ -59,64 +119,22 @@ Notes:
|
||||
DEFINE_DEVICE_TYPE(LUXOR_4105, luxor_4105_device, "lux4105", "Luxor 4105")
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_bsy )
|
||||
{
|
||||
m_sasi_bsy = state;
|
||||
|
||||
if (m_sasi_bsy)
|
||||
{
|
||||
m_sasibus->write_sel(0);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_io )
|
||||
{
|
||||
m_sasi_io = state;
|
||||
|
||||
if (!m_sasi_io)
|
||||
{
|
||||
m_sasi_data_out->write(m_data);
|
||||
}
|
||||
|
||||
update_trrq_int();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req )
|
||||
{
|
||||
m_sasi_req = state;
|
||||
|
||||
if (m_sasi_req)
|
||||
{
|
||||
m_sasibus->write_ack(0);
|
||||
}
|
||||
|
||||
update_trrq_int();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_cd )
|
||||
{
|
||||
m_sasi_cd = state;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void luxor_4105_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SCSI_PORT(config, m_sasibus);
|
||||
m_sasibus->set_data_input_buffer(m_sasi_data_in);
|
||||
m_sasibus->bsy_handler().set(FUNC(luxor_4105_device::write_sasi_bsy));
|
||||
m_sasibus->req_handler().set(FUNC(luxor_4105_device::write_sasi_req));
|
||||
m_sasibus->cd_handler().set(FUNC(luxor_4105_device::write_sasi_cd));
|
||||
m_sasibus->io_handler().set(FUNC(luxor_4105_device::write_sasi_io));
|
||||
m_sasibus->set_slot_device(1, "harddisk", S1410, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0));
|
||||
|
||||
OUTPUT_LATCH(config, m_sasi_data_out);
|
||||
m_sasibus->set_output_latch(*m_sasi_data_out);
|
||||
|
||||
INPUT_BUFFER(config, m_sasi_data_in);
|
||||
NSCSI_BUS(config, "sasi");
|
||||
NSCSI_CONNECTOR(config, "sasi:0", default_scsi_devices, "s1410");
|
||||
NSCSI_CONNECTOR(config, "sasi:7", default_scsi_devices, "scsicb", true)
|
||||
.option_add_internal("scsicb", NSCSI_CB)
|
||||
.machine_config([this](device_t* device) {
|
||||
downcast<nscsi_callback_device&>(*device).cd_callback().set(*this, FUNC(luxor_4105_device::write_sasi_cd));
|
||||
downcast<nscsi_callback_device&>(*device).bsy_callback().set(*this, FUNC(luxor_4105_device::write_sasi_bsy));
|
||||
downcast<nscsi_callback_device&>(*device).req_callback().set(*this, FUNC(luxor_4105_device::write_sasi_req));
|
||||
downcast<nscsi_callback_device&>(*device).io_callback().set(*this, FUNC(luxor_4105_device::write_sasi_io));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -131,7 +149,7 @@ INPUT_PORTS_START( luxor_4105 )
|
||||
PORT_DIPSETTING( 0x01, "Half (Seagate/Texas)" )
|
||||
PORT_DIPSETTING( 0x02, "Half (Tandon)" )
|
||||
PORT_DIPSETTING( 0x03, "Buffered" )
|
||||
PORT_DIPNAME( 0x0c, 0x04, "Heads" ) PORT_DIPLOCATION("1E:3,4")
|
||||
PORT_DIPNAME( 0x0c, 0x0c, "Heads" ) PORT_DIPLOCATION("1E:3,4")
|
||||
PORT_DIPSETTING( 0x00, "2" )
|
||||
PORT_DIPSETTING( 0x04, "4" )
|
||||
PORT_DIPSETTING( 0x08, "6" )
|
||||
@ -159,14 +177,59 @@ ioport_constructor luxor_4105_device::device_input_ports() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INLINE HELPERS
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
inline void luxor_4105_device::update_trrq_int()
|
||||
//-------------------------------------------------
|
||||
// luxor_4105_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, LUXOR_4105, tag, owner, clock),
|
||||
device_abcbus_card_interface(mconfig, *this),
|
||||
m_sasi(*this, "sasi:7:scsicb"),
|
||||
m_1e(*this, "1E"),
|
||||
m_5e(*this, "5E"),
|
||||
m_cs(false),
|
||||
m_dma(0)
|
||||
{
|
||||
bool cd = !m_sasi_cd;
|
||||
bool req = !m_sasi_req;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void luxor_4105_device::device_start()
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_cs));
|
||||
save_item(NAME(m_dma));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void luxor_4105_device::device_reset()
|
||||
{
|
||||
m_cs = false;
|
||||
m_dma = 0;
|
||||
|
||||
m_sasi->rst_w(1);
|
||||
m_sasi->rst_w(0);
|
||||
|
||||
m_slot->trrq_w(1);
|
||||
}
|
||||
|
||||
|
||||
void luxor_4105_device::update_trrq_int()
|
||||
{
|
||||
bool cd = !m_sasi->cd_r();
|
||||
bool req = !m_sasi->req_r();
|
||||
int trrq = (cd & !req) ? 0 : 1;
|
||||
|
||||
if (BIT(m_dma, 5))
|
||||
@ -189,61 +252,38 @@ inline void luxor_4105_device::update_trrq_int()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// luxor_4105_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, LUXOR_4105, tag, owner, clock),
|
||||
device_abcbus_card_interface(mconfig, *this),
|
||||
m_sasibus(*this, SASIBUS_TAG),
|
||||
m_sasi_data_out(*this, "sasi_data_out"),
|
||||
m_sasi_data_in(*this, "sasi_data_in"),
|
||||
m_1e(*this, "1E"),
|
||||
m_5e(*this, "5E"),
|
||||
m_cs(false),
|
||||
m_data(0),
|
||||
m_dma(0),
|
||||
m_sasi_bsy(false),
|
||||
m_sasi_req(false),
|
||||
m_sasi_cd(false),
|
||||
m_sasi_io(false)
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_bsy )
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
m_sasi->sel_w(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void luxor_4105_device::device_start()
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_cd )
|
||||
{
|
||||
// state saving
|
||||
save_item(NAME(m_cs));
|
||||
save_item(NAME(m_data));
|
||||
save_item(NAME(m_dma));
|
||||
update_trrq_int();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void luxor_4105_device::device_reset()
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req )
|
||||
{
|
||||
m_cs = false;
|
||||
m_data = 0;
|
||||
m_dma = 0;
|
||||
if (!state)
|
||||
{
|
||||
m_sasi->ack_w(0);
|
||||
}
|
||||
|
||||
m_sasibus->write_rst(1);
|
||||
m_sasibus->write_rst(0);
|
||||
update_trrq_int();
|
||||
}
|
||||
|
||||
m_slot->trrq_w(1);
|
||||
|
||||
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_io )
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
m_sasi->write(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -292,10 +332,11 @@ uint8_t luxor_4105_device::abcbus_stat()
|
||||
|
||||
*/
|
||||
|
||||
data = m_sasi_bsy ? 0 : (1 << 0);
|
||||
data |= m_sasi_req ? 0 : (1 << 2);
|
||||
data |= m_sasi_cd ? 0 : (1 << 3);
|
||||
data |= m_sasi_io ? 0 : (1 << 6);
|
||||
data = m_sasi->req_r();
|
||||
data |= !m_sasi->cd_r() << 1;
|
||||
data |= m_sasi->bsy_r() << 2;
|
||||
data |= !m_sasi->io_r() << 3;
|
||||
data |= !m_sasi->msg_r() << 6;
|
||||
}
|
||||
|
||||
return data;
|
||||
@ -312,21 +353,15 @@ uint8_t luxor_4105_device::abcbus_inp()
|
||||
|
||||
if (m_cs)
|
||||
{
|
||||
if (!m_sasi_bsy)
|
||||
if (!m_sasi->bsy_r())
|
||||
{
|
||||
data = m_1e->read();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_sasi_io)
|
||||
{
|
||||
data = m_sasi_data_in->read();
|
||||
data = m_sasi->read();
|
||||
|
||||
if (m_sasi_req)
|
||||
{
|
||||
m_sasibus->write_ack(1);
|
||||
}
|
||||
}
|
||||
m_sasi->ack_w(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,17 +377,9 @@ void luxor_4105_device::abcbus_out(uint8_t data)
|
||||
{
|
||||
if (m_cs)
|
||||
{
|
||||
m_data = data;
|
||||
m_sasi->write(data);
|
||||
|
||||
if (!m_sasi_io)
|
||||
{
|
||||
m_sasi_data_out->write(m_data);
|
||||
|
||||
if (m_sasi_req)
|
||||
{
|
||||
m_sasibus->write_ack(1);
|
||||
}
|
||||
}
|
||||
m_sasi->ack_w(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +392,7 @@ void luxor_4105_device::abcbus_c1(uint8_t data)
|
||||
{
|
||||
if (m_cs)
|
||||
{
|
||||
m_sasibus->write_sel(1);
|
||||
m_sasi->sel_w(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -378,11 +405,12 @@ void luxor_4105_device::abcbus_c3(uint8_t data)
|
||||
{
|
||||
if (m_cs)
|
||||
{
|
||||
m_data = 0;
|
||||
m_dma = 0;
|
||||
|
||||
m_sasibus->write_rst(1);
|
||||
m_sasibus->write_rst(0);
|
||||
m_sasi->sel_w(0);
|
||||
|
||||
m_sasi->rst_w(1);
|
||||
m_sasi->rst_w(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,9 @@
|
||||
|
||||
|
||||
#include "abcbus.h"
|
||||
#include "bus/scsi/scsi.h"
|
||||
#include "bus/nscsi/devices.h"
|
||||
#include "machine/nscsi_bus.h"
|
||||
#include "machine/nscsi_cb.h"
|
||||
|
||||
|
||||
|
||||
@ -24,7 +26,7 @@
|
||||
// ======================> luxor_4105_device
|
||||
|
||||
class luxor_4105_device : public device_t,
|
||||
public device_abcbus_card_interface
|
||||
public device_abcbus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -53,24 +55,16 @@ private:
|
||||
inline void update_trrq_int();
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_sasi_bsy );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_sasi_cd );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_sasi_io );
|
||||
|
||||
required_device<scsi_port_device> m_sasibus;
|
||||
required_device<output_latch_device> m_sasi_data_out;
|
||||
required_device<input_buffer_device> m_sasi_data_in;
|
||||
required_device<nscsi_callback_device> m_sasi;
|
||||
required_ioport m_1e;
|
||||
required_ioport m_5e;
|
||||
|
||||
bool m_cs;
|
||||
uint8_t m_data;
|
||||
uint8_t m_dma;
|
||||
|
||||
int m_sasi_bsy;
|
||||
bool m_sasi_req;
|
||||
bool m_sasi_cd;
|
||||
bool m_sasi_io;
|
||||
};
|
||||
|
||||
|
||||
|
@ -79,22 +79,22 @@ void nscsi_s1410_device::scsi_command()
|
||||
return;
|
||||
}
|
||||
|
||||
scsi_data_in(2, 3);
|
||||
scsi_data_out(2, 3);
|
||||
scsi_status_complete(SS_GOOD);
|
||||
break;
|
||||
|
||||
case SC_INIT_DRIVE_PARAMS:
|
||||
scsi_data_in(2, 8);
|
||||
scsi_data_out(2, 8);
|
||||
scsi_status_complete(SS_GOOD);
|
||||
break;
|
||||
|
||||
case SC_WRITE_SECTOR_BUFFER:
|
||||
scsi_data_in(2, 512);
|
||||
scsi_data_out(2, 512);
|
||||
scsi_status_complete(SS_GOOD);
|
||||
break;
|
||||
|
||||
case SC_READ_SECTOR_BUFFER:
|
||||
scsi_data_out(2, 512);
|
||||
scsi_data_in(2, 512);
|
||||
scsi_status_complete(SS_GOOD);
|
||||
break;
|
||||
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
How to create HDD image:
|
||||
------------------------
|
||||
chdman createhd -chs 615,4,17 -ss 512 -o necd5126a.chd
|
||||
./chdman createhd -chs 615,4,17 -ss 512 -o necd5126a.chd
|
||||
./chdman createhd -chs 1024,8,17 -ss 512 -o micr1325a.chd
|
||||
|
||||
How to format HDD:
|
||||
------------------
|
||||
mf(2,0)
|
||||
mf(2,0)
|
||||
abcenix
|
||||
sas/format/format
|
||||
sa(40,0)
|
||||
y
|
||||
@ -377,7 +377,7 @@ WRITE8_MEMBER( abc1600_state::fw0_w )
|
||||
|
||||
*/
|
||||
|
||||
if (LOG) logerror("FW0 %02x\n", data);
|
||||
if (LOG) logerror("%s FW0 %02x\n", machine().describe_context(), data);
|
||||
|
||||
// drive select
|
||||
floppy_image_device *floppy = nullptr;
|
||||
@ -414,7 +414,7 @@ WRITE8_MEMBER( abc1600_state::fw1_w )
|
||||
|
||||
*/
|
||||
|
||||
if (LOG) logerror("FW1 %02x\n", data);
|
||||
if (LOG) logerror("%s FW1 %02x\n", machine().describe_context(), data);
|
||||
|
||||
// FDC master reset
|
||||
if (!BIT(data, 0)) m_fdc->reset();
|
||||
|
Loading…
Reference in New Issue
Block a user