Sketch Timer and implement Interrupt support

This commit is contained in:
2023-01-06 15:18:35 +01:00
parent d0f52aa494
commit b9b3656180
6 changed files with 102 additions and 11 deletions

View File

@@ -31,15 +31,12 @@ namespace JabyEngine {
};
struct __no_align Timer {
IOPort<CounterMode> counter_mode;
IOPort<CounterTarget> counter_target;
IOPort<CounterMode> mode;
IOPort<CounterTarget> target;
private:
uint32_t _unused[2];
};
__declare_io_port_global_array(Timer, timer, 0x1F801104, 3);
static_assert(sizeof(Timer) == 0x10);
namespace Counter0 {
struct SyncMode {
static constexpr auto Pause_During_Hblank = CounterMode::SyncMode.with(0);
@@ -87,6 +84,9 @@ namespace JabyEngine {
static constexpr auto System_Clock_Div_8_Too = CounterMode::ClockSource.with(3);
};
}
__declare_io_port_global_array(Timer, Counter, 0x1F801104, 3);
static_assert(sizeof(Timer) == 0x10);
}
}