summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/peb/tn_ide.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/peb/tn_ide.h')
-rw-r--r--src/devices/bus/ti99/peb/tn_ide.h85
1 files changed, 51 insertions, 34 deletions
diff --git a/src/devices/bus/ti99/peb/tn_ide.h b/src/devices/bus/ti99/peb/tn_ide.h
index 2b4bd6c97de..fba16021778 100644
--- a/src/devices/bus/ti99/peb/tn_ide.h
+++ b/src/devices/bus/ti99/peb/tn_ide.h
@@ -2,12 +2,11 @@
// copyright-holders:Michael Zapf
/****************************************************************************
- Nouspikel IDE controller card
- See tn_ide.c for documentation
+ IDE adapter card
+ See tn_ide.cpp for documentation
Michael Zapf
-
- February 2012: Rewritten as class
+ April 2020
*****************************************************************************/
@@ -18,53 +17,71 @@
#include "peribox.h"
#include "bus/ata/ataintf.h"
-#include "machine/ram.h"
+#include "bus/ti99/internal/buffram.h"
#include "machine/rtc65271.h"
+#include "machine/bq4847.h"
+#include "machine/bq48x2.h"
+#include "machine/74259.h"
+#include "machine/74543.h"
-namespace bus { namespace ti99 { namespace peb {
+namespace bus::ti99::peb {
-class nouspikel_ide_interface_device : public device_t, public device_ti99_peribox_card_interface
+class nouspikel_ide_card_device : public device_t, public device_ti99_peribox_card_interface
{
public:
- nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ8Z_MEMBER(readz) override;
+ nouspikel_ide_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ void readz(offs_t offset, uint8_t *value) override;
void write(offs_t offset, uint8_t data) override;
-
- DECLARE_READ8Z_MEMBER(crureadz) override;
+ void crureadz(offs_t offset, uint8_t *value) override;
void cruwrite(offs_t offset, uint8_t data) override;
-
- void do_inta(int state);
- bool m_ata_irq;
- int m_cru_register;
-
-protected:
- virtual void device_start() override;
- virtual void device_reset() override;
- virtual void device_add_mconfig(machine_config &config) override;
- virtual ioport_constructor device_input_ports() const override;
+ DECLARE_INPUT_CHANGED_MEMBER( mode_changed );
private:
- DECLARE_WRITE_LINE_MEMBER(clock_interrupt_callback);
- DECLARE_WRITE_LINE_MEMBER(ide_interrupt_callback);
+ void device_start() override;
+ void device_reset() override;
+ void device_add_mconfig(machine_config &config) override;
+ ioport_constructor device_input_ports() const override;
+
+ required_device<rtc65271_device> m_rtc65;
+ required_device<bq4847_device> m_rtc47;
+ required_device<bq4842_device> m_rtc42;
+ required_device<bq4852_device> m_rtc52;
- required_device<rtc65271_device> m_rtc;
required_device<ata_interface_device> m_ata;
+ required_device<bus::ti99::internal::buffered_ram_device> m_sram;
+ required_device<ls259_device> m_crulatch;
+ required_device<ttl74543_device> m_latch0_7;
+ required_device<ttl74543_device> m_latch8_15;
+
+ // Latches the IDE interrupt
+ bool m_ideint;
+
+ // TI mode or Geneve mode (or off)
+ int m_mode;
+
+ // Stores the currently selected page (74ALS373)
+ int m_page;
+
+ // Is the SRAM buffered?
+ bool m_srammap;
+
+ // RTC type
+ int m_rtctype;
- bool m_clk_irq;
- bool m_sram_enable;
- bool m_sram_enable_dip;
- int m_cur_page;
+ // Genmod decoding. If not used, the AME line is pulled up, and the AMD line is pulled down
+ bool m_genmod;
- bool m_tms9995_mode;
+ template<int rtctype> void rtc_int_callback(int state);
+ void ide_interrupt_callback(int state);
+ void resetdr_callback(int state);
- uint16_t m_input_latch;
- uint16_t m_output_latch;
+ void decode(offs_t offset, bool& mmap, bool& sramsel, bool& xramsel, bool& rtcsel, bool& cs1fx, bool& cs3fx);
- required_device<ram_device> m_ram;
+ int m_rtc_int;
};
-} } } // end namespace bus::ti99::peb
+} // end namespace bus::ti99::peb
-DECLARE_DEVICE_TYPE_NS(TI99_IDE, bus::ti99::peb, nouspikel_ide_interface_device)
+DECLARE_DEVICE_TYPE_NS(TI99_IDE, bus::ti99::peb, nouspikel_ide_card_device)
#endif // MAME_BUS_TI99_PEB_TN_IDE_H