summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-07-26 10:19:02 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-07-26 10:19:02 -0500
commit3708c7a37e0b213dc96d6d90cd823141a561192e (patch)
treef28ad2a7c0f200c42b1c9540007c530e77be7b43
parentc936278b52d16fb7cb763598ff112821efdfd637 (diff)
atapicdr: unbreak firebeat (nw)
ins8250: reassert thre irq when setting mask (nw)
-rw-r--r--src/devices/machine/atapicdr.cpp13
-rw-r--r--src/devices/machine/atapicdr.h10
-rw-r--r--src/devices/machine/ins8250.cpp2
-rw-r--r--src/mame/drivers/firebeat.cpp11
4 files changed, 32 insertions, 4 deletions
diff --git a/src/devices/machine/atapicdr.cpp b/src/devices/machine/atapicdr.cpp
index 13fd79570dd..deb0da52c52 100644
--- a/src/devices/machine/atapicdr.cpp
+++ b/src/devices/machine/atapicdr.cpp
@@ -8,6 +8,7 @@
// device type definition
const device_type ATAPI_CDROM = &device_creator<atapi_cdrom_device>;
+const device_type ATAPI_FIXED_CDROM = &device_creator<atapi_fixed_cdrom_device>;
atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
atapi_hle_device(mconfig, ATAPI_CDROM, "ATAPI CDROM", tag, owner, clock, "cdrom", __FILE__)
@@ -19,6 +20,11 @@ atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, device_typ
{
}
+atapi_fixed_cdrom_device::atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ atapi_cdrom_device(mconfig, ATAPI_FIXED_CDROM, "ATAPI fixed CDROM", tag, owner, clock, "cdrom_fixed", __FILE__)
+{
+}
+
static MACHINE_CONFIG_FRAGMENT( atapicdr )
MCFG_CDROM_ADD("image")
MCFG_CDROM_INTERFACE("cdrom")
@@ -81,6 +87,13 @@ void atapi_cdrom_device::device_reset()
m_media_change = true;
}
+void atapi_fixed_cdrom_device::device_reset()
+{
+ atapi_hle_device::device_reset();
+ m_cdrom = m_image->get_cdrom_file();
+ m_media_change = false;
+}
+
void atapi_cdrom_device::process_buffer()
{
if(m_cdrom != m_image->get_cdrom_file())
diff --git a/src/devices/machine/atapicdr.h b/src/devices/machine/atapicdr.h
index dc5220c000d..041081a0cd0 100644
--- a/src/devices/machine/atapicdr.h
+++ b/src/devices/machine/atapicdr.h
@@ -35,11 +35,19 @@ protected:
virtual void identify_packet_device() override;
virtual void process_buffer() override;
virtual void ExecCommand() override;
-private:
bool m_media_change;
};
+class atapi_fixed_cdrom_device : public atapi_cdrom_device
+{
+public:
+ atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ virtual void device_reset() override;
+};
+
// device type definition
extern const device_type ATAPI_CDROM;
+extern const device_type ATAPI_FIXED_CDROM;
#endif
diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp
index e032039cb7d..1703f5b38e8 100644
--- a/src/devices/machine/ins8250.cpp
+++ b/src/devices/machine/ins8250.cpp
@@ -235,6 +235,8 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
}
else
{
+ if (m_regs.lsr & 0x20)
+ trigger_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
m_regs.ier = data;
update_interrupt();
}
diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp
index bdfaac9e1a6..89665e9625c 100644
--- a/src/mame/drivers/firebeat.cpp
+++ b/src/mame/drivers/firebeat.cpp
@@ -144,6 +144,7 @@ Keyboard Mania 2nd Mix - dongle, program CD, audio CD
#include "machine/rtc65271.h"
#include "machine/ins8250.h"
#include "machine/midikbd.h"
+#include "machine/atapicdr.h"
#include "sound/ymz280b.h"
#include "sound/cdda.h"
#include "sound/rf5c400.h"
@@ -1268,6 +1269,10 @@ static MACHINE_CONFIG_FRAGMENT( cdrom_config )
MCFG_SOUND_ROUTE(1, "^^^^rspeaker", 1.0)
MACHINE_CONFIG_END
+static SLOT_INTERFACE_START(firebeat_ata_devices)
+ SLOT_INTERFACE("cdrom", ATAPI_FIXED_CDROM)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( firebeat, firebeat_state )
/* basic machine hardware */
@@ -1284,7 +1289,7 @@ static MACHINE_CONFIG_START( firebeat, firebeat_state )
MCFG_FUJITSU_29F016A_ADD("flash_snd1")
MCFG_FUJITSU_29F016A_ADD("flash_snd2")
- MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "cdrom", "cdrom", true)
+ MCFG_ATA_INTERFACE_ADD("ata", firebeat_ata_devices, "cdrom", "cdrom", true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(firebeat_state, ata_interrupt))
MCFG_DEVICE_MODIFY("ata:1")
@@ -1344,7 +1349,7 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state )
MCFG_FUJITSU_29F016A_ADD("flash_snd1")
MCFG_FUJITSU_29F016A_ADD("flash_snd2")
- MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "cdrom", "cdrom", true)
+ MCFG_ATA_INTERFACE_ADD("ata", firebeat_ata_devices, "cdrom", "cdrom", true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(firebeat_state, ata_interrupt))
MCFG_DEVICE_MODIFY("ata:1")
@@ -1410,7 +1415,7 @@ static MACHINE_CONFIG_DERIVED( firebeat_spu, firebeat )
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_ATA_INTERFACE_ADD("spu_ata", ata_devices, "cdrom", nullptr, true)
+ MCFG_ATA_INTERFACE_ADD("spu_ata", firebeat_ata_devices, "cdrom", nullptr, true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(firebeat_state, spu_ata_interrupt))
MACHINE_CONFIG_END