(MESS) softbox: Fixed Corvus hard disk interface. (nw)

This commit is contained in:
Curt Coder 2013-05-30 13:58:06 +00:00
parent 8cc08ea8e3
commit e0d03e60ea
6 changed files with 24 additions and 75 deletions

View File

@ -198,16 +198,17 @@ READ8_MEMBER( softbox_state::ppi1_pc_r )
PC2
PC3
PC4 Corvus READY
PC5 Corvus ACTIVE
PC5 Corvus DIRC
PC6
PC7
*/
UINT8 status = corvus_hdc_status_r(space, 0);
UINT8 data = 0;
data |= (corvus_hdc_status_r(space, 0) & CONTROLLER_BUSY) ? 0x10 : 0;
data |= m_corvus_active ? 0x20 : 0;
data |= (status & CONTROLLER_BUSY) ? 0 : 0x10;
data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20;
return data;
}
@ -249,21 +250,11 @@ static I8255A_INTERFACE( ppi1_intf )
// COM8116_INTERFACE( dbrg_intf )
//-------------------------------------------------
WRITE_LINE_MEMBER( softbox_state::fr_w )
{
m_usart->receive_clock();
}
WRITE_LINE_MEMBER( softbox_state::ft_w )
{
m_usart->transmit_clock();
}
static COM8116_INTERFACE( dbrg_intf )
{
DEVCB_NULL, // fX/4
DEVCB_DRIVER_LINE_MEMBER(softbox_state, fr_w),
DEVCB_DRIVER_LINE_MEMBER(softbox_state, ft_w),
DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, rxc_w),
DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, txc_w),
COM8116_DIVISORS_16X_5_0688MHz, // receiver
COM8116_DIVISORS_16X_5_0688MHz // transmitter
};
@ -299,10 +290,7 @@ static const rs232_port_interface rs232_intf =
void softbox_state::machine_start()
{
if (corvus_hdc_init(machine()) == TRUE)
{
m_corvus_active = true;
}
corvus_hdc_init(machine());
}

View File

@ -4,6 +4,10 @@
*
* Implementation of the Corvus Systems Flat Cable Hard Disk controller
*
* Corvus Model 6 (5 MB): IMI 5006H hard disk (-chs 144,4,20 -ss 512)
* Corvus Model 11 (10 MB): IMI 5012H hard disk (-chs 358,3,20 -ss 512)
* Corvus Model 20 (20 MB): IMI 5018H hard disk (-chs 388,5,20 -ss 512)
*
****************************************************************************/
#ifndef CORVUSHD_H_

View File

@ -15,7 +15,7 @@
#include "machine/serial.h"
#define Z80_TAG "z80"
#define I8251_TAG "i8251"
#define I8251_TAG "ic15"
#define I8255_0_TAG "ic17"
#define I8255_1_TAG "ic16"
#define COM8116_TAG "ic14"
@ -26,15 +26,10 @@ class softbox_state : public driver_device
public:
softbox_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, Z80_TAG),
m_usart(*this, I8251_TAG),
m_dbrg(*this, COM8116_TAG),
m_ieee(*this, IEEE488_TAG),
m_corvus_active(false)
m_ieee(*this, IEEE488_TAG)
{ }
required_device<cpu_device> m_maincpu;
required_device<i8251_device> m_usart;
required_device<com8116_device> m_dbrg;
required_device<ieee488_device> m_ieee;
@ -50,17 +45,12 @@ public:
DECLARE_READ8_MEMBER( ppi1_pc_r );
DECLARE_WRITE8_MEMBER( ppi1_pc_w );
DECLARE_WRITE_LINE_MEMBER( fr_w );
DECLARE_WRITE_LINE_MEMBER( ft_w );
enum
{
LED_A,
LED_B,
LED_READY
};
bool m_corvus_active;
};
#endif

View File

@ -1306,7 +1306,7 @@ static void corvus_process_command_packet(running_machine &machine, UINT8 invali
default:
c->xmit_bytes = 1;
c->buffer.single_byte_response.status = STAT_FAULT | STAT_FATAL_ERR;
logerror("corvus_hdc_data_w: Unimplemented Prep command, returning FATAL FAULT status!\n");
logerror("corvus_hdc_data_w: Unimplemented Prep command %02x, returning FATAL FAULT status!\n", c->buffer.command.code);
}
}
if (VERBOSE_RESPONSES)
@ -1328,7 +1328,7 @@ static void corvus_process_command_packet(running_machine &machine, UINT8 invali
c->buffer.single_byte_response.status =
STAT_FATAL_ERR | STAT_ILL_CMD_OP_CODE; // Respond with an Illegal Op Code
logerror("corvus_hdc_data_w: Illegal Command, status: 0x%2.2x\n", c->buffer.single_byte_response.status);
logerror("corvus_hdc_data_w: Illegal Command %02x, status: 0x%2.2x\n", c->buffer.single_byte_response.status, c->buffer.command.code);
}
//
// Command execution complete, free up the controller

View File

@ -16,7 +16,7 @@
//**************************************************************************
#define Z80_TAG "z80"
#define I8251_TAG "i8251"
#define I8251_TAG "ic15"
#define I8255_0_TAG "ic17"
#define I8255_1_TAG "ic16"
#define COM8116_TAG "ic14"
@ -199,16 +199,17 @@ READ8_MEMBER( softbox_device::ppi1_pc_r )
PC2
PC3
PC4 Corvus READY
PC5 Corvus ACTIVE
PC5 Corvus DIRC
PC6
PC7
*/
UINT8 status = corvus_hdc_status_r(space, 0);
UINT8 data = 0;
data |= (corvus_hdc_status_r(space, 0) & CONTROLLER_BUSY) ? 0x10 : 0;
data |= m_corvus_active ? 0x20 : 0;
data |= (status & CONTROLLER_BUSY) ? 0 : 0x10;
data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20;
return data;
}
@ -250,21 +251,11 @@ static I8255A_INTERFACE( ppi1_intf )
// COM8116_INTERFACE( dbrg_intf )
//-------------------------------------------------
WRITE_LINE_MEMBER( softbox_device::fr_w )
{
m_usart->receive_clock();
}
WRITE_LINE_MEMBER( softbox_device::ft_w )
{
m_usart->transmit_clock();
}
static COM8116_INTERFACE( dbrg_intf )
{
DEVCB_NULL, // fX/4
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, softbox_device, fr_w),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, softbox_device, ft_w),
DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, rxc_w),
DEVCB_DEVICE_LINE_MEMBER(I8251_TAG, i8251_device, txc_w),
COM8116_DIVISORS_16X_5_0688MHz, // receiver
COM8116_DIVISORS_16X_5_0688MHz // transmitter
};
@ -354,10 +345,7 @@ ioport_constructor softbox_device::device_input_ports() const
softbox_device::softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SOFTBOX, "PET SoftBox", tag, owner, clock, "pet_softbox", __FILE__),
device_ieee488_interface(mconfig, *this),
m_maincpu(*this, Z80_TAG),
m_usart(*this, I8251_TAG),
m_dbrg(*this, COM8116_TAG),
m_corvus_active(false)
m_dbrg(*this, COM8116_TAG)
{
}
@ -368,19 +356,7 @@ softbox_device::softbox_device(const machine_config &mconfig, const char *tag, d
void softbox_device::device_start()
{
if (corvus_hdc_init(machine()) == TRUE)
{
m_corvus_active = true;
}
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void softbox_device::device_reset()
{
corvus_hdc_init(machine());
}

View File

@ -12,7 +12,6 @@
#ifndef __PET_SOFTBOX__
#define __PET_SOFTBOX__
#include "emu.h"
#include "cpu/z80/z80.h"
#include "imagedev/harddriv.h"
@ -54,13 +53,9 @@ public:
DECLARE_READ8_MEMBER( ppi1_pc_r );
DECLARE_WRITE8_MEMBER( ppi1_pc_w );
DECLARE_WRITE_LINE_MEMBER( fr_w );
DECLARE_WRITE_LINE_MEMBER( ft_w );
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
enum
@ -70,11 +65,7 @@ private:
LED_READY
};
required_device<cpu_device> m_maincpu;
required_device<i8251_device> m_usart;
required_device<com8116_device> m_dbrg;
bool m_corvus_active;
};