summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2017-05-17 09:49:54 -0600
committer Ted Green <tedgreen99@protonmail.com>2017-05-17 09:49:54 -0600
commit0626b116ee7b1d2eaff453cf9665ddc62e898623 (patch)
tree3a151ccd1518b9ec9c127638f29be46772167646
parent8cb689e7ac2001636fca54f98d7c7e02fda3007b (diff)
pci-ide: Added function to set default PIF byte. (nw)
-rw-r--r--src/devices/machine/pci-ide.cpp5
-rw-r--r--src/devices/machine/pci-ide.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp
index bac97798949..98ec5180b46 100644
--- a/src/devices/machine/pci-ide.cpp
+++ b/src/devices/machine/pci-ide.cpp
@@ -11,7 +11,8 @@ ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, d
m_ide2(*this, "ide2"),
m_irq_num(-1),
m_irq_handler(*this),
- m_legacy_top(0x000)
+ m_legacy_top(0x000),
+ m_pif(0x8a)
{
}
@@ -106,7 +107,7 @@ void ide_pci_device::device_reset()
bank_infos[2].adr = (m_legacy_top << 20) | 0x170;
bank_infos[3].adr = (m_legacy_top << 20) | 0x374;
bank_infos[4].adr = 0xf00;
- pclass = 0x01018a;
+ pclass = 0x010100 | m_pif;
remap_cb();
// PCI0646U allow BAR
diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h
index d9200898b4e..f3849fb1515 100644
--- a/src/devices/machine/pci-ide.h
+++ b/src/devices/machine/pci-ide.h
@@ -33,6 +33,10 @@ TODO:
#define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \
downcast<ide_pci_device *>(device)->set_legacy_top(_val);
+// Sets the default Programming Interface (PIF) register
+#define MCFG_IDE_PCI_SET_PIF(_val) \
+ downcast<ide_pci_device *>(device)->set_pif(_val);
+
class ide_pci_device : public pci_device {
public:
ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -47,6 +51,7 @@ public:
void set_irq_info(const char *tag, const int irq_num);
template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<ide_pci_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
void set_legacy_top(int val) { m_legacy_top = val & 0xfff; };
+ void set_pif(int val) { m_pif = val & 0xff; };
protected:
virtual void device_start() override;
@@ -63,6 +68,7 @@ private:
uint32_t pci_bar[6];
// Bits 31-20 for legacy mode hack
uint32_t m_legacy_top;
+ uint32_t m_pif;
uint32_t m_config_data[0x10];
DECLARE_ADDRESS_MAP(chan1_data_command_map, 32);