Setup Periperhy

This commit is contained in:
Jaby 2024-01-02 16:43:36 -06:00
parent f7ad811304
commit f15061fe67
4 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
namespace Periphery_IO {
__declare_io_value(JOY_MODE, uint16_t) {
static constexpr JOY_MODE create() {
return JOY_MODE{0x000D};
}
};
__declare_io_value(JOY_BAUD, uint16_t) {
static constexpr JOY_BAUD create() {
return JOY_BAUD{0x0088};
}
};
__declare_io_port(, JOY_MODE, 0x1F801048);
__declare_io_port(, JOY_BAUD, 0x1F80104E);
}
}

View File

@ -21,6 +21,10 @@ namespace JabyEngine {
namespace Timer {
void setup();
}
namespace Periphery {
void setup();
}
}
void __no_return run();

View File

@ -0,0 +1,12 @@
#include <PSX/System/IOPorts/periphery_io.hpp>
namespace JabyEngine {
namespace boot {
namespace Periphery {
void setup() {
Periphery_IO::JOY_MODE.write(Periphery_IO::JOY_MODE::create());
Periphery_IO::JOY_BAUD.write(Periphery_IO::JOY_BAUD::create());
}
}
}
}

View File

@ -24,6 +24,9 @@ namespace JabyEngine {
static constexpr auto DebugY = 0;
static constexpr auto DebugScale = 1.0;
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
Periphery::setup();
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
enable_DMA();