Lift RawController code

This commit is contained in:
2024-01-02 20:18:40 -06:00
parent fb20f8fe30
commit f1d4197762
5 changed files with 163 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/GPU/gpu_auto_load_font.hpp>
#include <PSX/GPU/make_gpu_primitives.hpp>
#include <PSX/Periphery/periphery.hpp>
#include <PSX/Timer/frame_timer.hpp>
#include <FontWriter/fonts.hpp>
@@ -31,7 +32,7 @@ void font_writer_update() {
auto state = JabyEngine::State::create(JabyEngine::Make::PositionI16(8, 8), wiggle_count);
new_font_writer.write(state, "012345 ABCDEFGHIJKL\nabcedfghijkl\n", JabyEngine::GPU::Color24::Blue(), &wiggle);
new_font_writer.write(state, "%i (0x%p)\nWiggle (%s)\n", JabyEngine::GPU::Color24::Green(), &wiggle, wiggle_count, 0xAABBCCDD, Text[wiggle_count&0x1]);
bios_font_writer.write(state, "!!PLANSCHBECKEN!!", JabyEngine::GPU::Color24::White());
bios_font_writer.write(state, "!!PLANSCHBECKEN!!", JabyEngine::Periphery::controller[0][0].button.is_down(JabyEngine::Periphery::GenericButton::D7) ? JabyEngine::GPU::Color24::Blue() : JabyEngine::GPU::Color24::White());
if(timer.is_expired_for(50_ms)) {
timer.reset();

View File

@@ -5,6 +5,7 @@
#include "assets.hpp"
#include <PSX/GPU/gpu.hpp>
#include <PSX/GPU/make_gpu_primitives.hpp>
#include <PSX/Periphery/periphery.hpp>
#include <PSX/Timer/frame_timer.hpp>
#include <stdio.h>
@@ -22,6 +23,8 @@ static void setup() {
}
static void update() {
Periphery::query_controller();
FontWriter::FontWriter cursor;
const auto end_pos = cursor.write(FontWriter::Position::create(0, 32), "Cody is cute\n&\na \x1b[8;0;0mBAAAAABY!!!");
@@ -45,7 +48,7 @@ void main() {
JabyEngine::HighResTime::enable();
while(true) {
const auto start = Overlay::TimerTest::start_measuring();
const auto start = Overlay::TimerTest::start_measuring();
update();
render();
Overlay::TimerTest::end_measuring(start, GPU::Display::frames_per_sec);