summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/gio64/gio64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/gio64/gio64.h')
-rw-r--r--src/devices/bus/gio64/gio64.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/devices/bus/gio64/gio64.h b/src/devices/bus/gio64/gio64.h
index 9cbea5a3ab1..dd2c77aefc6 100644
--- a/src/devices/bus/gio64/gio64.h
+++ b/src/devices/bus/gio64/gio64.h
@@ -12,16 +12,24 @@
#pragma once
#include "cpu/mips/r4000.h"
-#include "machine/hpc3.h"
class gio64_device;
class gio64_slot_device : public device_t, public device_slot_interface
{
public:
+ enum slot_type_t : uint32_t
+ {
+ GIO64_SLOT_GFX,
+ GIO64_SLOT_EXP0,
+ GIO64_SLOT_EXP1,
+
+ GIO64_SLOT_COUNT
+ };
+
// construction/destruction
template <typename T, typename U>
- gio64_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gio64_tag, U &&opts, const char *dflt)
+ gio64_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&gio64_tag, slot_type_t slot_type, U &&opts, const char *dflt)
: gio64_slot_device(mconfig, tag, owner, (uint32_t)0)
{
option_reset();
@@ -29,6 +37,7 @@ public:
set_default_option(dflt);
set_fixed(false);
m_gio64.set_tag(std::forward<T>(gio64_tag));
+ m_slot_type = slot_type;
}
gio64_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -42,6 +51,7 @@ protected:
// configuration
required_device<gio64_device> m_gio64;
+ slot_type_t m_slot_type;
DECLARE_READ32_MEMBER(timeout_r);
DECLARE_WRITE32_MEMBER(timeout_w);
@@ -59,31 +69,23 @@ public:
virtual ~device_gio64_card_interface();
// inline configuration
- void set_gio64(gio64_device *gio64, const char *slottag);
+ void set_gio64(gio64_device *gio64, gio64_slot_device::slot_type_t slot_type);
virtual void mem_map(address_map &map) = 0;
protected:
device_gio64_card_interface(const machine_config &mconfig, device_t &device);
- enum gio64_slot_type_t : uint32_t
- {
- GIO64_SLOT_GFX,
- GIO64_SLOT_EXP0,
- GIO64_SLOT_EXP1,
-
- GIO64_SLOT_COUNT
- };
-
virtual void interface_validity_check(validity_checker &valid) const override;
virtual void interface_pre_start() override;
+ virtual void interface_post_start() override;
virtual void install_device() = 0;
gio64_device &gio64() { assert(m_gio64); return *m_gio64; }
gio64_device *m_gio64;
const char *m_gio64_slottag;
- gio64_slot_type_t m_slot_type;
+ gio64_slot_device::slot_type_t m_slot_type;
};
@@ -93,25 +95,24 @@ class gio64_device : public device_t,
friend class device_gio64_card_interface;
public:
// construction/destruction
- template <typename T, typename U>
- gio64_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag, U &&hpc3_tag)
+ template <typename T>
+ gio64_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag)
: gio64_device(mconfig, tag, owner, (uint32_t)0)
{
set_cpu_tag(std::forward<T>(cpu_tag));
- set_hpc3_tag(std::forward<U>(hpc3_tag));
}
gio64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
template <typename T> void set_cpu_tag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); }
- template <typename T> void set_hpc3_tag(T &&tag) { m_hpc3.set_tag(std::forward<T>(tag)); }
+ template <int N> auto interrupt_cb() { return m_interrupt_cb[N].bind(); }
virtual space_config_vector memory_space_config() const override;
const address_space_config m_space_config;
- void add_gio64_card(device_gio64_card_interface::gio64_slot_type_t slot_type, device_gio64_card_interface *card);
+ void add_gio64_card(gio64_slot_device::slot_type_t slot_type, device_gio64_card_interface *card);
device_gio64_card_interface *get_gio64_card(int slot);
template<typename T> void install_graphics(T &device, void (T::*map)(class address_map &map), uint64_t unitmask = ~u64(0))
@@ -129,7 +130,7 @@ public:
fatalerror("Invalid SGI GIO64 expansion slot index: %d\n", index);
}
- hpc3_base_device* get_hpc3() { return m_hpc3.target(); }
+ template <int N> DECLARE_WRITE_LINE_MEMBER(interrupt) { m_interrupt_cb[N](state); }
DECLARE_READ64_MEMBER(read);
DECLARE_WRITE64_MEMBER(write);
@@ -143,12 +144,13 @@ protected:
// internal state
required_device<r4000_base_device> m_maincpu;
- required_device<hpc3_base_device> m_hpc3;
address_space *m_space;
device_gio64_card_interface *m_device_list[3];
private:
+ devcb_write_line m_interrupt_cb[3];
+
DECLARE_READ64_MEMBER(no_gfx_r);
DECLARE_READ64_MEMBER(no_exp0_r);
DECLARE_READ64_MEMBER(no_exp1_r);