Increase PoolBox to Version 0.9.0
This commit is contained in:
@@ -13,10 +13,32 @@ namespace GPUTest {
|
||||
};
|
||||
__declare_lba_header(LBA);
|
||||
|
||||
CDFile Assets[18] = {
|
||||
CDFile Assets[2] = {
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
};
|
||||
|
||||
CDFile LargeAssets[36] = {
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::TEX, TexPageTIM),
|
||||
CDFileBuilder::simple_tim(LBA::ICON, IconTIM),
|
||||
|
@@ -14,7 +14,8 @@ namespace ControllerTest {
|
||||
|
||||
namespace GPUTest {
|
||||
extern const volatile JabyEngine::AutoLBAEntry lba[];
|
||||
extern JabyEngine::CDFile Assets[18];
|
||||
extern JabyEngine::CDFile Assets[2];
|
||||
extern JabyEngine::CDFile LargeAssets[36];
|
||||
|
||||
void main();
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "Overlay/Overlays.hpp"
|
||||
#include <FontWriter/fonts.hpp>
|
||||
#include <FontWriter/font_writer.hpp>
|
||||
//#include <PSX/Audio/CDDA.hpp>
|
||||
#include <PSX/Audio/CDDA.hpp>
|
||||
#include <PSX/Audio/CDXA.hpp>
|
||||
#include <PSX/Periphery/periphery.hpp>
|
||||
#include <stdio.hpp>
|
||||
@@ -13,35 +13,68 @@
|
||||
using namespace JabyEngine;
|
||||
using DigitalButton = Periphery::GenericController::Button;
|
||||
|
||||
struct XAPlayer {
|
||||
struct CDPlayer {
|
||||
static constexpr auto MaxChannels = 2;
|
||||
|
||||
uint8_t channel;
|
||||
bool is_xa;
|
||||
|
||||
static XAPlayer create() {
|
||||
return XAPlayer{0};
|
||||
static constexpr CDPlayer create() {
|
||||
return CDPlayer{.channel = 0, .is_xa = true};
|
||||
}
|
||||
|
||||
void play() {
|
||||
this->channel = 0;
|
||||
Assets::XAAudio::play_fox();
|
||||
if(this->is_xa) {
|
||||
Assets::XAAudio::play_fox();
|
||||
}
|
||||
|
||||
else {
|
||||
const auto [first_track, last_track] = CDDA::get_tracks();
|
||||
CDDA::play(first_track);
|
||||
}
|
||||
}
|
||||
|
||||
void stop() {
|
||||
CDXA::stop();
|
||||
if(this->is_xa) {
|
||||
CDXA::stop();
|
||||
}
|
||||
|
||||
else {
|
||||
CDDA::stop();
|
||||
}
|
||||
}
|
||||
|
||||
void change_channel(int8_t step) {
|
||||
this->channel = static_cast<uint8_t>((this->channel + step))%MaxChannels;
|
||||
CDXA::set_channel(this->channel);
|
||||
if(this->is_xa) {
|
||||
this->channel = static_cast<uint8_t>((this->channel + step))%MaxChannels;
|
||||
CDXA::set_channel(this->channel);
|
||||
}
|
||||
}
|
||||
|
||||
void change_audio() {
|
||||
CDPlayer::stop();
|
||||
this->is_xa = !this->is_xa;
|
||||
CDPlayer::play();
|
||||
}
|
||||
|
||||
void push() {
|
||||
CDXA::push_play();
|
||||
if(this->is_xa) {
|
||||
CDXA::push_play();
|
||||
}
|
||||
|
||||
else {
|
||||
CDDA::push_play();
|
||||
}
|
||||
}
|
||||
|
||||
void pop() {
|
||||
CDXA::pop_play();
|
||||
if(this->is_xa) {
|
||||
CDXA::pop_play();
|
||||
}
|
||||
|
||||
else {
|
||||
CDDA::pop_play();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -80,7 +113,7 @@ static const auto doener_fish = Make::SPRT(
|
||||
GPU::Color24::Grey()
|
||||
);
|
||||
|
||||
static XAPlayer xa = XAPlayer::create();
|
||||
static CDPlayer cd_player = CDPlayer::create();
|
||||
static object::Paco paco;
|
||||
static Menu::SimpleMenu menu;
|
||||
static StateChange state_changer;
|
||||
@@ -101,8 +134,9 @@ static void setup() {
|
||||
|
||||
const auto& controller = Periphery::get_primary_controller_as<JabyEngine::Periphery::GenericController>();
|
||||
// With this approach we can default load_test to true for debugging reasons
|
||||
if(controller.button.is_down(DigitalButton::R2) && controller.button.is_down(DigitalButton::L2)) {
|
||||
Shared::load_test = true;
|
||||
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();
|
||||
@@ -144,11 +178,7 @@ static void setup() {
|
||||
}
|
||||
},MenuEntries);
|
||||
|
||||
// TODO: CDDA?
|
||||
// const auto [first_track, last_track] = CDDA::get_tracks();
|
||||
// CDDA::play(first_track);
|
||||
|
||||
xa.play();
|
||||
cd_player.play();
|
||||
}
|
||||
|
||||
namespace NormalScene {
|
||||
@@ -161,12 +191,16 @@ namespace NormalScene {
|
||||
Periphery::query_controller();
|
||||
const auto& controller = Periphery::get_primary_controller_as<JabyEngine::Periphery::GenericController>();
|
||||
|
||||
if(controller.button.went_down(DigitalButton::SEL)) {
|
||||
cd_player.change_audio();
|
||||
}
|
||||
|
||||
if(controller.button.went_down(DigitalButton::R1)) {
|
||||
xa.change_channel(1);
|
||||
cd_player.change_channel(1);
|
||||
}
|
||||
|
||||
if(controller.button.went_down(DigitalButton::L1)) {
|
||||
xa.change_channel(-1);
|
||||
cd_player.change_channel(-1);
|
||||
}
|
||||
|
||||
auto cursor = FontWriter::update(Make::PositionI16((GPU::Display::Width-TitleLength)/2, 16));
|
||||
@@ -176,10 +210,9 @@ 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));
|
||||
|
||||
|
||||
if(Shared::load_test) {
|
||||
// Force state change if we are in the load_test state
|
||||
state_changer.asset_load = Assets::Overlay::load_gpu_test;
|
||||
state_changer.asset_load = Assets::Overlay::load_large_gpu_test;
|
||||
state_changer.main = GPUTest::main;
|
||||
}
|
||||
|
||||
@@ -220,10 +253,10 @@ namespace LoadingScene {
|
||||
render();
|
||||
GPU::swap_buffers_vsync(1);
|
||||
|
||||
xa.push();
|
||||
cd_player.push();
|
||||
state_changer.asset_load();
|
||||
old_state_changer = state_changer;
|
||||
xa.pop();
|
||||
cd_player.pop();
|
||||
}
|
||||
|
||||
state_changer.main();
|
||||
|
@@ -96,6 +96,10 @@ namespace Assets {
|
||||
load(CDFileBuilder::overlay(LBA::GPU_TEST_OVL, &__gpu_tests_start), GPUTest::lba, GPUTest::Assets);
|
||||
}
|
||||
|
||||
void load_large_gpu_test() {
|
||||
load(CDFileBuilder::overlay(LBA::GPU_TEST_OVL, &__gpu_tests_start), GPUTest::lba, GPUTest::LargeAssets);
|
||||
}
|
||||
|
||||
void load_gte_test() {
|
||||
load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start), GTETest::lba, GTETest::Assets);
|
||||
}
|
||||
|
Reference in New Issue
Block a user