CDXA not working

This commit is contained in:
2024-05-26 09:33:23 +02:00
parent 4f06d39e43
commit 43c534cf9b
10 changed files with 135 additions and 51 deletions

View File

@@ -27,4 +27,8 @@ namespace Assets {
void load_font_cycler();
void load_screen_center();
}
namespace XAAudio {
void play_fox();
}
}

View File

@@ -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/Periphery/periphery.hpp>
#include <PSX/System/callbacks.hpp>
#include <stdio.hpp>
@@ -105,8 +105,11 @@ static void setup() {
}
},MenuEntries);
const auto [first_track, last_track] = CDDA::get_tracks();
CDDA::play(first_track);
// TODO: CDDA?
// const auto [first_track, last_track] = CDDA::get_tracks();
// CDDA::play(first_track);
Assets::XAAudio::play_fox();
}
namespace NormalScene {
@@ -158,6 +161,7 @@ namespace LoadingScene {
printf("Loading new state...\n");
Callback::VSyncCallback::install([]() {
// TODO: Use it or remove it!!
printf("Still loading...\n");
});
@@ -166,10 +170,11 @@ namespace LoadingScene {
render();
GPU::swap_buffers_vsync(1);
CDDA::push_play();
// TODO: Enable push and pop
//CDDA::push_play();
state_changer.asset_load();
old_state_changer = state_changer;
CDDA::pop_play();
//CDDA::pop_play();
Callback::VSyncCallback::uninstall();
}

View File

@@ -1,8 +1,9 @@
#include "../include/asset_mgr.hpp"
#include "Overlay/Overlays.hpp"
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/Audio/CDXA.hpp>
#include <PSX/AutoLBA/auto_lba.hpp>
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <stdio.hpp>
extern "C" uint32_t __bios_info_start;
@@ -15,6 +16,7 @@ namespace Assets {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.BIN"),
__jabyengine_request_lba_for(DFISH, "ASSETS/MAIN/DFISH.BIN"),
__jabyengine_request_lba_for(FOX_XA, "XAAUDIO/FOX.XA"),
__jabyengine_request_lba_for(BIOS_INFO_OVL, "BIO.BIN"),
__jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"),
__jabyengine_request_lba_for(GTE_TEST_OVL, "GTE.BIN"),
@@ -106,4 +108,10 @@ namespace Assets {
load(CDFileBuilder::overlay(LBA::SCREEN_CENT_OVL, &__screen_center_start));
}
}
namespace XAAudio {
void play_fox() {
CDXA::play(lba, CDXA::CDFile{FOX_XA}, 0);
}
}
}