From 32378e4b2ba6b8534d4c0b115d99b5c7d94b2553 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 29 Sep 2024 16:15:36 +0200 Subject: [PATCH] Convert Interrupt IO --- .../IOPorts/IOValues/interrupt_io_values.hpp | 12 ++++++++++++ include/PSX/System/IOPorts/interrupt_io.hpp | 15 ++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 include/PSX/System/IOPorts/IOValues/interrupt_io_values.hpp diff --git a/include/PSX/System/IOPorts/IOValues/interrupt_io_values.hpp b/include/PSX/System/IOPorts/IOValues/interrupt_io_values.hpp new file mode 100644 index 00000000..cbcfe792 --- /dev/null +++ b/include/PSX/System/IOPorts/IOValues/interrupt_io_values.hpp @@ -0,0 +1,12 @@ +#pragma once +#include "../ioport.hpp" + +namespace JabyEngine { + namespace Interrupt_IO_Values { + __declare_io_value(Mask, uint32_t) { + }; + + __declare_io_value(Status, uint32_t) { + }; + } +} \ No newline at end of file diff --git a/include/PSX/System/IOPorts/interrupt_io.hpp b/include/PSX/System/IOPorts/interrupt_io.hpp index 18f59d60..97787011 100644 --- a/include/PSX/System/IOPorts/interrupt_io.hpp +++ b/include/PSX/System/IOPorts/interrupt_io.hpp @@ -1,7 +1,10 @@ #pragma once -#include "ioport.hpp" +#include "IOValues/interrupt_io_values.hpp" namespace JabyEngine { + using StatusIO = IOPort; + using MaskIO = IOPort; + struct Interrupt { static constexpr auto VBlank = Bit(0); static constexpr auto GPU = Bit(1); @@ -16,14 +19,8 @@ namespace JabyEngine { static constexpr auto Controller = Bit(10); static constexpr auto LightPen = Controller; - __declare_io_value(Status, uint32_t) { - }; - - __declare_io_value(Mask, uint32_t) { - }; - - __declare_io_port(inline, Status, 0x1F801070); - __declare_io_port(inline, Mask, 0x1F801074); + static inline auto& Status = __new_declare_io_port(StatusIO, 0x1F801070); + static inline auto& Mask = __new_declare_io_port(MaskIO, 0x1F801074); static bool is_irq(Bit irq) { return Status.read().is_set(irq);