Cleanup code

This commit is contained in:
jaby 2024-04-01 17:34:12 -05:00
parent d0f5731bdb
commit 96b7963404
2 changed files with 23 additions and 34 deletions

View File

@ -107,7 +107,7 @@ static void setup() {
namespace NormalScene {
static void update() {
static const char Title[] = ">> Pool Box <<";
static const char Version[] = "Ver. 0.8.1";
static const char Version[] = "Ver. 0.8.5";
static constexpr auto TitleLength = DefaultFont::Info.estimate_str_render_length(Title);
static constexpr auto VersionLength = DefaultFont::Info.estimate_str_render_length(Version);

View File

@ -65,56 +65,45 @@ namespace Assets {
}
namespace Overlay {
// TODO: All these loadings can be done by one function taking the LBA of ther overlay, the new LBA and the new Asset array
static void load(const CDFile& overlay_file, const volatile AutoLBAEntry* overlay_lba, const CDFile* overlay_assets, size_t size) {
::Assets::load(lba, &overlay_file, 1);
if(overlay_lba) {
::Assets::load(overlay_lba, overlay_assets, size);
}
}
static void load(const CDFile& overlay_file) {
load(overlay_file, nullptr, nullptr, 0ull);
}
template<size_t N>
static void load(const CDFile& overlay_file, const volatile AutoLBAEntry* overlay_lba, const CDFile (&overlay_assets)[N]) {
load(overlay_file, overlay_lba, overlay_assets, N);
}
// TODO: Get rid of these as soon as we have a proper loading screen
void load_bios_info() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::BIOS_INFO_OVL, &__bios_info_start)
};
::Assets::load(lba, Files);
load(CDFileBuilder::overlay(LBA::BIOS_INFO_OVL, &__bios_info_start));
}
void load_controller_test() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::CONT_TEST_OVL, &__controller_tests_start)
};
::Assets::load(lba, Files);
::Assets::load(ControllerTest::lba, ControllerTest::Assets);
load(CDFileBuilder::overlay(LBA::CONT_TEST_OVL, &__controller_tests_start), ControllerTest::lba, ControllerTest::Assets);
}
void load_gpu_test() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::GPU_TEST_OVL, &__gpu_tests_start)
};
::Assets::load(lba, Files);
::Assets::load(GPUTest::lba, GPUTest::Assets);
load(CDFileBuilder::overlay(LBA::GPU_TEST_OVL, &__gpu_tests_start), GPUTest::lba, GPUTest::Assets);
}
void load_gte_test() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start)
};
::Assets::load(lba, Files);
load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start));
}
void load_font_cycler() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::FONT_CYC_OVL, &__screen_center_start)
};
::Assets::load(lba, Files);
load(CDFileBuilder::overlay(LBA::FONT_CYC_OVL, &__screen_center_start));
}
void load_screen_center() {
const CDFile Files[] = {
CDFileBuilder::overlay(LBA::SCREEN_CENT_OVL, &__screen_center_start)
};
::Assets::load(lba, Files);
load(CDFileBuilder::overlay(LBA::SCREEN_CENT_OVL, &__screen_center_start));
}
}
}