Prepare timer bug fix

This commit is contained in:
jaby 2023-10-12 18:26:32 +02:00
parent f1bc9da7e8
commit b130cb9542
3 changed files with 48 additions and 45 deletions

View File

@ -1,10 +1,10 @@
{ {
"slot_0": { "slot_0": {
"timer_tests": { "timer_tests": {
"pattern": "bin/*/src/Overlay/TimerTests/*.o" "pattern": "bin/*/src/Overlay/TimerTests2/*.o"
}, },
"gpu_tests": { "gpu_tests": {
"pattern": "bin/*/src/Overlay/GPUTests/*.o" "pattern": "bin/*/src/Overlay/GPUTests/*.o"
} }
} }
} }

View File

@ -1,37 +1,36 @@
#pragma once #pragma once
#include <PSX/File/Processor/cd_file_processor.hpp> #include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/GPU/gpu.hpp> #include <PSX/GPU/gpu.hpp>
#include <PSX/Timer/frame_timer.hpp> #include <PSX/Timer/frame_timer.hpp>
namespace object { namespace object {
using namespace JabyEngine; using namespace JabyEngine;
class Paco { class Paco {
public: public:
static constexpr auto TIM = SimpleTIM(896, 0, 960, 510); static constexpr auto TIM = SimpleTIM(896, 0, 960, 510);
private: private:
static const GPU::Color24 Colors[]; static const GPU::Color24 Colors[];
GPU::TexPage::Linked tex_page; GPU::TexPage::Linked tex_page;
GPU::SPRT::Linked sprite; GPU::SPRT::Linked sprite;
SimpleTimer<uint8_t> timer; SimpleTimer<uint8_t> timer;
uint8_t color_idx; uint8_t color_idx;
public: public:
constexpr Paco() : constexpr Paco() :
tex_page(GPU::TexPage::create(GPU::PositionU16::create( tex_page(GPU::TexPage::create(GPU::PositionU16::create(
TIM.get_texture_x(), TIM.get_texture_y()), TIM.get_texture_x(), TIM.get_texture_y()),
GPU::TexturePageColor::$4bit).linked()), GPU::TexturePageColor::$4bit).linked()),
sprite(GPU::SPRT::create( sprite(GPU::SPRT::create(
#pragma GCC warning "This pic used to be 122px (file size) and every tool would except it - however the display would be corrupt" GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)), GPU::PagePositionClut(GPU::PagePosition::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
GPU::PagePositionClut(GPU::PagePosition::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())), GPU::Color24::Blue()).linked()),
GPU::Color24::Blue()).linked()), timer(),
timer(), color_idx(0) {}
color_idx(0) {}
void setup();
void setup(); void update();
void update(); void render();
void render(); };
};
} }

View File

@ -0,0 +1,4 @@
#pragma once
namespace Overlay {
void mesaure_busy_loop();
}