Convert Interrupt IO
This commit is contained in:
parent
862fffaf11
commit
32378e4b2b
|
@ -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) {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "ioport.hpp"
|
#include "IOValues/interrupt_io_values.hpp"
|
||||||
|
|
||||||
namespace JabyEngine {
|
namespace JabyEngine {
|
||||||
|
using StatusIO = IOPort<Interrupt_IO_Values::Status>;
|
||||||
|
using MaskIO = IOPort<Interrupt_IO_Values::Mask>;
|
||||||
|
|
||||||
struct Interrupt {
|
struct Interrupt {
|
||||||
static constexpr auto VBlank = Bit(0);
|
static constexpr auto VBlank = Bit(0);
|
||||||
static constexpr auto GPU = Bit(1);
|
static constexpr auto GPU = Bit(1);
|
||||||
|
@ -16,14 +19,8 @@ namespace JabyEngine {
|
||||||
static constexpr auto Controller = Bit(10);
|
static constexpr auto Controller = Bit(10);
|
||||||
static constexpr auto LightPen = Controller;
|
static constexpr auto LightPen = Controller;
|
||||||
|
|
||||||
__declare_io_value(Status, uint32_t) {
|
static inline auto& Status = __new_declare_io_port(StatusIO, 0x1F801070);
|
||||||
};
|
static inline auto& Mask = __new_declare_io_port(MaskIO, 0x1F801074);
|
||||||
|
|
||||||
__declare_io_value(Mask, uint32_t) {
|
|
||||||
};
|
|
||||||
|
|
||||||
__declare_io_port(inline, Status, 0x1F801070);
|
|
||||||
__declare_io_port(inline, Mask, 0x1F801074);
|
|
||||||
|
|
||||||
static bool is_irq(Bit irq) {
|
static bool is_irq(Bit irq) {
|
||||||
return Status.read().is_set(irq);
|
return Status.read().is_set(irq);
|
||||||
|
|
Loading…
Reference in New Issue