diff --git a/examples/PoolBox/application/Makefile b/examples/PoolBox/application/Makefile index efec30b8..a35a6de4 100644 --- a/examples/PoolBox/application/Makefile +++ b/examples/PoolBox/application/Makefile @@ -1,7 +1,7 @@ ARTIFACT = PoolBox BUILD_DIR = bin -#OVERLAY_CONFIG = Overlays.json +OVERLAY_CONFIG = Overlays.json include $(JABY_ENGINE_DIR)/lib/Wildcard.mk SRCS = $(call rwildcard, src, c cpp) diff --git a/examples/PoolBox/application/Overlays.json b/examples/PoolBox/application/Overlays.json index 5e779d49..0e5d7be0 100644 --- a/examples/PoolBox/application/Overlays.json +++ b/examples/PoolBox/application/Overlays.json @@ -1,12 +1,7 @@ { "slot_0": { - "main_area": { - "pattern": "bin/*/src/MainState/*.o" - } - }, - "slot_1": { - "main_area2": { - "pattern": "bin/*/src/MainState2/*.o" + "timer_tests": { + "pattern": "bin/*/src/TimerTests/*.o" } } } \ No newline at end of file diff --git a/examples/PoolBox/application/src/TimerTests/timer_tests.cpp b/examples/PoolBox/application/src/TimerTests/timer_tests.cpp new file mode 100644 index 00000000..e62774eb --- /dev/null +++ b/examples/PoolBox/application/src/TimerTests/timer_tests.cpp @@ -0,0 +1,17 @@ +#include +#include + +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)); + } +} \ No newline at end of file diff --git a/examples/PoolBox/application/src/main.cpp b/examples/PoolBox/application/src/main.cpp index a24f83f9..ecf17d07 100644 --- a/examples/PoolBox/application/src/main.cpp +++ b/examples/PoolBox/application/src/main.cpp @@ -1,26 +1,47 @@ -#include +#include +#include #include #include -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); } -} \ No newline at end of file +} +__declare_lba_header(LBA); \ No newline at end of file diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 9c58e342..2c265b3c 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -4,7 +4,10 @@ %PSX_LICENSE_PATH%/LICENSEE.DAT - iso/System.cnf -
application/bin/PSX-release/PoolBox.psexe
+ iso/System.cnf +
application/bin/PSX-release/PoolBox.psexe
+ + assets/bin/TexturePage.bin + \ No newline at end of file