Save progress

This commit is contained in:
Jaby
2023-01-06 22:15:03 +01:00
committed by Jaby
parent d444222d49
commit 758c4c305a
6 changed files with 57 additions and 26 deletions

View File

@@ -1,14 +1,21 @@
#include <PSX/System/IOPorts/interrupt_io.hpp>
#include <PSX/System/IOPorts/timer_io.hpp>
#include <PSX/System/syscalls.h>
namespace JabyEngine {
namespace Timer {
void setup() {
// Just testing around
static constexpr auto wuff = CounterMode::with(CounterMode::IRQAtMax, Counter0::SyncMode::Zero_At_Hblank);
extern InterrupCallback IRQCallback;
Counter[0].mode = wuff;
Counter[0].mode = wuff;
Counter[0].mode = wuff;
void setup() {
static constexpr auto Mode = CounterMode::with(CounterMode::FreeRun, Counter2::SyncMode::Freerun, CounterMode::ResetAfterTarget, CounterMode::IRQAtTarget, CounterMode::IRQEveryTime, Counter2::Source::System_Clock_Div_8);
static constexpr uint16_t Target = 0x1234;
//Counter[2].target.ref().set(CounterTarget::CounterTargetValue.with(Target));
__syscall_EnterCriticalSection();
__syscall_SysEnqIntRP(Timer2Irq, &IRQCallback);
__syscall_ExitCriticalSection();
Interrupt::enable_irq(Interrupt::Timer2);
}
}
}