From 3cbc80192aada36461659f16b6910b4d42f08e05 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Wed, 29 May 2013 19:20:56 +0000 Subject: [PATCH] (MESS) softbox: Added Corvus hard disk. [Curt Coder, Mike Naberezny] --- src/mess/drivers/softbox.c | 28 ++++++++++++++++++++++++++-- src/mess/includes/softbox.h | 9 ++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/softbox.c b/src/mess/drivers/softbox.c index 2849564bc0b..e5365afd697 100644 --- a/src/mess/drivers/softbox.c +++ b/src/mess/drivers/softbox.c @@ -51,7 +51,7 @@ static ADDRESS_MAP_START( softbox_io, AS_IO, 8, softbox_state ) AM_RANGE(0x0c, 0x0c) AM_WRITE(dbrg_w) AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(I8255_0_TAG, i8255_device, read, write) AM_RANGE(0x14, 0x17) AM_DEVREADWRITE(I8255_1_TAG, i8255_device, read, write) - //AM_RANGE(0x18, 0x18) AM_WRITE(corvus_data_r, corvus_data_w) + AM_RANGE(0x18, 0x18) AM_READWRITE_LEGACY(corvus_hdc_data_r, corvus_hdc_data_w) ADDRESS_MAP_END @@ -204,7 +204,12 @@ READ8_MEMBER( softbox_state::ppi1_pc_r ) */ - return 0; + UINT8 data = 0; + + data |= (corvus_hdc_status_r(space, 0) & CONTROLLER_BUSY) ? 0x10 : 0; + data |= m_corvus_active ? 0x20 : 0; + + return data; } WRITE8_MEMBER( softbox_state::ppi1_pc_w ) @@ -284,6 +289,24 @@ static const rs232_port_interface rs232_intf = +//************************************************************************** +// MACHINE INITIALIZATION +//************************************************************************** + +//------------------------------------------------- +// MACHINE_START( softbox ) +//------------------------------------------------- + +void softbox_state::machine_start() +{ + if (corvus_hdc_init(machine()) == TRUE) + { + m_corvus_active = true; + } +} + + + //************************************************************************** // MACHINE CONFIGURATION //************************************************************************** @@ -304,6 +327,7 @@ static MACHINE_CONFIG_START( softbox, softbox_state ) MCFG_I8255A_ADD(I8255_1_TAG, ppi1_intf) MCFG_COM8116_ADD(COM8116_TAG, XTAL_5_0688MHz, dbrg_intf) MCFG_CBM_IEEE488_ADD("c8050") + MCFG_HARDDISK_ADD("harddisk1") MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, "serial_terminal") MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) diff --git a/src/mess/includes/softbox.h b/src/mess/includes/softbox.h index 1e12e4714ca..913bfdaf84a 100644 --- a/src/mess/includes/softbox.h +++ b/src/mess/includes/softbox.h @@ -5,6 +5,8 @@ #include "emu.h" #include "cpu/z80/z80.h" +#include "imagedev/harddriv.h" +#include "includes/corvushd.h" #include "machine/cbmipt.h" #include "machine/com8116.h" #include "machine/i8251.h" @@ -27,7 +29,8 @@ public: m_maincpu(*this, Z80_TAG), m_usart(*this, I8251_TAG), m_dbrg(*this, COM8116_TAG), - m_ieee(*this, IEEE488_TAG) + m_ieee(*this, IEEE488_TAG), + m_corvus_active(false) { } required_device m_maincpu; @@ -35,6 +38,8 @@ public: required_device m_dbrg; required_device m_ieee; + virtual void machine_start(); + DECLARE_WRITE8_MEMBER( dbrg_w ); DECLARE_READ8_MEMBER( ppi0_pa_r ); @@ -54,6 +59,8 @@ public: LED_B, LED_READY }; + + bool m_corvus_active; }; #endif