From b079ed1aa8276f103689bf3c27e88bfddb539d22 Mon Sep 17 00:00:00 2001 From: Jaby Date: Tue, 30 Jul 2024 15:40:44 -0500 Subject: [PATCH] Clear up load test button combination and display of audio playback type --- .../PoolBox/application/src/application.cpp | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/examples/PoolBox/application/src/application.cpp b/examples/PoolBox/application/src/application.cpp index 9889965a..567c9975 100644 --- a/examples/PoolBox/application/src/application.cpp +++ b/examples/PoolBox/application/src/application.cpp @@ -132,13 +132,6 @@ static void setup() { // Use this size for the doener fish state? // doener_fish.set_rect_size_fast(Make::SizeI16(64, 32)); - const auto& controller = Periphery::get_primary_controller_as(); - // With this approach we can default load_test to true for debugging reasons - if(controller.is_connected()) { - // TODO: Make this work on the PS3 - Shared::load_test = controller.button.is_down(DigitalButton::R2) && controller.button.is_down(DigitalButton::L2); - } - Assets::Main::load(); FontWriter::setup(); paco.setup(); @@ -191,16 +184,23 @@ namespace NormalScene { Periphery::query_controller(); const auto& controller = Periphery::get_primary_controller_as(); - if(controller.button.went_down(DigitalButton::SEL)) { - cd_player.change_audio(); - } + if(controller.is_connected()) { + if(controller.button.went_down(DigitalButton::SEL)) { + cd_player.change_audio(); + } - if(controller.button.went_down(DigitalButton::R1)) { - cd_player.change_channel(1); - } + if(controller.button.went_down(DigitalButton::R1)) { + cd_player.change_channel(1); + } - if(controller.button.went_down(DigitalButton::L1)) { - cd_player.change_channel(-1); + if(controller.button.went_down(DigitalButton::L1)) { + cd_player.change_channel(-1); + } + + // Trigger load test + if(controller.button.is_down(DigitalButton::R2) && controller.button.is_down(DigitalButton::L2) && controller.button.is_down(DigitalButton::ST)) { + Shared::load_test = true; + } } auto cursor = FontWriter::update(Make::PositionI16((GPU::Display::Width-TitleLength)/2, 16)); @@ -210,12 +210,14 @@ namespace NormalScene { FontWriter::new_font_writer.write(cursor.change_position(Make::PositionI16((GPU::Display::Width-VersionLength)/2, 16 + DefaultFont::Info.get_kern_size().height)), Version, GPU::Color24::Green(0xD0), &FontWriter::wiggle); menu.update(FontWriter::bios_font_writer, cursor, Make::PositionI16(8, 64)); + cursor.change_position(Make::PositionI16(doener_fish.position.x + doener_fish.size.width, GPU::Display::Height - 32)); + FontWriter::bios_font_writer.write(cursor, "Audio:\n%s", cd_player.is_xa ? "CD-XA" : "CD-DA"); + if(Shared::load_test) { // Force state change if we are in the load_test state state_changer.asset_load = Assets::Overlay::load_large_gpu_test; state_changer.main = GPUTest::main; } - } static void render() { @@ -265,7 +267,7 @@ namespace LoadingScene { } void main() { - Periphery::query_controller(); + const auto& controller = Periphery::get_primary_controller_as(); setup(); while(true) {