Add ControllerTest Overlay and support not loading new state if previous loaded
This commit is contained in:
parent
17a6b6e223
commit
5e050f3ffd
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"slot_0": {
|
||||
"!timer_tests": {
|
||||
"pattern": "bin/*/src/Overlay/TimerTests/*.o"
|
||||
"controller_tests": {
|
||||
"pattern": "bin/*/src/Overlay/ControllerTest/*.o"
|
||||
},
|
||||
"gpu_tests": {
|
||||
"pattern": "bin/*/src/Overlay/GPUTest/*.o"
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace Assets {
|
|||
}
|
||||
|
||||
namespace Overlay {
|
||||
void load_controller_test();
|
||||
void load_gpu_test();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
namespace ControllerTest {
|
||||
void main() {
|
||||
printf("CONT: BlubbBlubbBlubb!!\n");
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace GPUTest {
|
||||
void main() {
|
||||
printf("BlubbBlubbBlubb!!\n");
|
||||
while(true);
|
||||
printf("GPU: BlubbBlubbBlubb!!\n");
|
||||
}
|
||||
}
|
|
@ -1,4 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
namespace ControllerTest {
|
||||
void main();
|
||||
}
|
||||
|
||||
namespace GPUTest {
|
||||
void main();
|
||||
}
|
|
@ -26,11 +26,13 @@ struct StateChange {
|
|||
bool contains_state() const {
|
||||
return this->main;
|
||||
}
|
||||
|
||||
auto operator<=>(const StateChange&) const = default;
|
||||
};
|
||||
|
||||
static const Menu::SimpleMenu::Entry MenuEntries[] = {
|
||||
{"Menu 1"},
|
||||
{"Menu 2"},
|
||||
{"Controller Test"},
|
||||
{"GPU Test"},
|
||||
{"Menu 3"},
|
||||
{"Menu 4"},
|
||||
{"Menu 5"}
|
||||
|
@ -41,14 +43,24 @@ static const Menu::SimpleMenu::Entry MenuEntries[] = {
|
|||
static object::Paco paco;
|
||||
static Menu::SimpleMenu menu;
|
||||
static StateChange state_changer;
|
||||
static StateChange old_state_changer;
|
||||
|
||||
static void setup() {
|
||||
Assets::Main::load();
|
||||
FontWriter::setup();
|
||||
paco.setup();
|
||||
menu.setup([](uint32_t selection) {
|
||||
switch(selection) {
|
||||
case 0:
|
||||
state_changer.asset_load = Assets::Overlay::load_controller_test;
|
||||
state_changer.main = ControllerTest::main;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
state_changer.asset_load = Assets::Overlay::load_gpu_test;
|
||||
state_changer.main = GPUTest::main;
|
||||
break;
|
||||
}
|
||||
},MenuEntries);
|
||||
}
|
||||
|
||||
|
@ -92,18 +104,19 @@ namespace LoadingScene {
|
|||
}
|
||||
|
||||
static void run() {
|
||||
if(old_state_changer != state_changer) {
|
||||
printf("Loading new state...\n");
|
||||
|
||||
update();
|
||||
GPU::swap_buffers_vsync(1);
|
||||
render();
|
||||
GPU::swap_buffers_vsync(1);
|
||||
|
||||
printf("End of execution!\n");
|
||||
old_state_changer = state_changer;
|
||||
}
|
||||
|
||||
state_changer.asset_load();
|
||||
state_changer.main();
|
||||
printf("Done in state!\n");
|
||||
|
||||
while(true);
|
||||
|
||||
state_changer.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" uint32_t __controller_tests_start;
|
||||
extern "C" uint32_t __gpu_tests_start;
|
||||
|
||||
namespace Assets {
|
||||
|
@ -11,6 +12,7 @@ namespace Assets {
|
|||
__jabyengine_start_lba_request
|
||||
__jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.BIN"),
|
||||
__jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"),
|
||||
__jabyengine_request_lba_for(CONT_TEST_OVL, "CTO.BIN"),
|
||||
__jabyengine_end_lba_request
|
||||
};
|
||||
__declare_lba_header(LBA);
|
||||
|
@ -54,12 +56,20 @@ namespace Assets {
|
|||
}
|
||||
|
||||
namespace Overlay {
|
||||
static const CDFile Files[] = {
|
||||
static const CDFile GPUFiles[] = {
|
||||
CDFileBuilder::overlay(LBA::GPU_TEST_OVL, &__gpu_tests_start)
|
||||
};
|
||||
|
||||
static const CDFile ControllerFiles[] = {
|
||||
CDFileBuilder::overlay(LBA::CONT_TEST_OVL, &__controller_tests_start)
|
||||
};
|
||||
|
||||
void load_controller_test() {
|
||||
::Assets::load(ControllerFiles);
|
||||
}
|
||||
|
||||
void load_gpu_test() {
|
||||
::Assets::load(Files);
|
||||
::Assets::load(GPUFiles);
|
||||
// Load Overlay assets?!
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<Track>
|
||||
<File name = "SYSTEM.CNF">System.cnf</File>
|
||||
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/asset_mgr.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
|
||||
<Overlay name = "CTO.BIN">../application/bin/PSX-release/Overlay.controller_tests</Overlay>
|
||||
<Overlay name = "GTO.BIN">../application/bin/PSX-release/Overlay.gpu_tests</Overlay>
|
||||
|
||||
<Directory name="ASSETS" hidden = "true">
|
||||
|
|
Loading…
Reference in New Issue