Try loading TexturePage
This commit is contained in:
17
examples/PoolBox/application/src/TimerTests/timer_tests.cpp
Normal file
17
examples/PoolBox/application/src/TimerTests/timer_tests.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <PSX/Timer/high_res_timer.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" void busy_loop(int count);
|
||||
namespace Overlay {
|
||||
void mesaure_busy_loop() {
|
||||
static constexpr auto Counts = 500;
|
||||
|
||||
JabyEngine::HighResTime::enable();
|
||||
const auto start = JabyEngine::HighResTime::get_time_stamp();
|
||||
busy_loop(Counts);
|
||||
const auto end = JabyEngine::HighResTime::get_time_stamp();
|
||||
JabyEngine::HighResTime::disable();
|
||||
|
||||
printf("Busy loop of %i took %ims %ins\n", Counts, start.milliseconds_to(end), start.microseconds_to(end));
|
||||
}
|
||||
}
|
@@ -1,26 +1,47 @@
|
||||
#include <PSX/Timer/high_res_timer.hpp>
|
||||
#include <PSX/File/Processor/cd_file_processor.hpp>
|
||||
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
|
||||
#include <PSX/GPU/gpu.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" void busy_loop(int count);
|
||||
enum LBA {
|
||||
__jabyengine_start_lba_request
|
||||
__jabyengine_request_lba_for(FONT, "ASSETS/FONT.BIN"),
|
||||
__jabyengine_end_lba_request
|
||||
};
|
||||
|
||||
static void mesaure_busy_loop() {
|
||||
static constexpr auto Counts = 500;
|
||||
static void load_assets() {
|
||||
static const JabyEngine::CDFile Assets[] = {
|
||||
JabyEngine::CDFileBuilder::simple_tim(LBA::FONT, JabyEngine::SimpleTIM(320, 0, 320, 256)),
|
||||
};
|
||||
|
||||
JabyEngine::HighResTime::enable();
|
||||
const auto start = JabyEngine::HighResTime::get_time_stamp();
|
||||
busy_loop(Counts);
|
||||
const auto end = JabyEngine::HighResTime::get_time_stamp();
|
||||
JabyEngine::HighResTime::disable();
|
||||
const auto buffer_cfg = JabyEngine::CDFileProcessor::BufferConfiguration::new_default();
|
||||
JabyEngine::CDFileProcessor file_processor;
|
||||
|
||||
printf("Busy loop of %i took %ims %ins\n", Counts, start.milliseconds_to(end), start.microseconds_to(end));
|
||||
file_processor.setup(lba, Assets, buffer_cfg);
|
||||
while(true) {
|
||||
switch(file_processor.process()) {
|
||||
case JabyEngine::Progress::InProgress:
|
||||
break;
|
||||
|
||||
case JabyEngine::Progress::Done:
|
||||
if(!file_processor.next(lba, buffer_cfg)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case JabyEngine::Progress::Error:
|
||||
printf("Error detected! Aborting load\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
printf("Hello PoolBox!\n");
|
||||
mesaure_busy_loop();
|
||||
load_assets();
|
||||
|
||||
while(true) {
|
||||
JabyEngine::GPU::swap_buffers_vsync(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
__declare_lba_header(LBA);
|
Reference in New Issue
Block a user