Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
2 changed files with 18 additions and 9 deletions
Showing only changes of commit 32378e4b2b - Show all commits

View File

@ -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) {
};
}
}

View File

@ -1,7 +1,10 @@
#pragma once
#include "ioport.hpp"
#include "IOValues/interrupt_io_values.hpp"
namespace JabyEngine {
using StatusIO = IOPort<Interrupt_IO_Values::Status>;
using MaskIO = IOPort<Interrupt_IO_Values::Mask>;
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);