diff options
Diffstat (limited to 'src/devices/machine/ps2sif.h')
-rw-r--r-- | src/devices/machine/ps2sif.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/devices/machine/ps2sif.h b/src/devices/machine/ps2sif.h new file mode 100644 index 00000000000..8a19586d502 --- /dev/null +++ b/src/devices/machine/ps2sif.h @@ -0,0 +1,61 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/****************************************************************************** +* +* Sony PlayStation 2 SIF device skeleton +* +* To Do: +* Everything +* +*/ + +#ifndef DEVICES_MACHINE_PS2SIF_H +#define DEVICES_MACHINE_PS2SIF_H + +#pragma once + +#include "emu.h" +#include "ps2intc.h" + +class ps2_sif_device : public device_t +{ +public: + template <typename T> + ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag) + : ps2_sif_device(mconfig, tag, owner, (uint32_t)0) + { + m_intc.set_tag(std::forward<T>(intc_tag)); + } + + ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + DECLARE_READ32_MEMBER(ee_r); + DECLARE_WRITE32_MEMBER(ee_w); + DECLARE_READ32_MEMBER(iop_r); + DECLARE_WRITE32_MEMBER(iop_w); + + uint32_t fifo_depth(uint32_t channel); + void fifo_push(uint32_t channel, uint32_t value); + uint32_t fifo_pop(uint32_t channel); + + static const size_t MAX_FIFO_DEPTH; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + required_device<ps2_intc_device> m_intc; + + uint32_t m_ms_mailbox; + uint32_t m_sm_mailbox; + uint32_t m_ms_flag; + uint32_t m_sm_flag; + uint32_t m_ctrl; + + std::unique_ptr<uint32_t[]> m_fifo[2]; + uint32_t m_fifo_curr[2]; +}; + +DECLARE_DEVICE_TYPE(SONYPS2_SIF, ps2_sif_device) + +#endif // DEVICES_MACHINE_PS2SIF_H
\ No newline at end of file |