Play nice jingle and more clean-up
This commit is contained in:
parent
d7bcae9e33
commit
2515975ba8
|
@ -7,7 +7,7 @@ enum struct FileType : JabyEngine::CDFileType_t {
|
||||||
|
|
||||||
struct CustomCDFileBuilder {
|
struct CustomCDFileBuilder {
|
||||||
static constexpr JabyEngine::CDFile jingle(uint32_t sfx_id) {
|
static constexpr JabyEngine::CDFile jingle(uint32_t sfx_id) {
|
||||||
// TODO: This currently re-loads Paco; We should make this treat it's own file!
|
// v we reload Paco
|
||||||
return JabyEngine::CDFile::custom(0, FileType::Jingle, sfx_id);
|
return JabyEngine::CDFile::custom(0, FileType::Jingle, sfx_id);
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -9,7 +9,7 @@ namespace JabyEngine {
|
||||||
};
|
};
|
||||||
|
|
||||||
static Progress parse_jingle(State::Configuration& config, JingleState& jingle) {
|
static Progress parse_jingle(State::Configuration& config, JingleState& jingle) {
|
||||||
printf("Playing jingle: %i\n", jingle.sfx_id);
|
SPU::voice[jingle.sfx_id].play();
|
||||||
return Progress::Done;
|
return Progress::Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,6 @@ static void setup() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},MenuEntries);
|
},MenuEntries);
|
||||||
|
|
||||||
cd_player.play();
|
cd_player.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,8 +288,8 @@ namespace LoadingScene {
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
const auto& controller = Periphery::get_primary_controller_as<JabyEngine::Periphery::GenericController>();
|
const auto& controller = Periphery::get_primary_controller_as<JabyEngine::Periphery::GenericController>();
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
if(state_changer.contains_state()) {
|
if(state_changer.contains_state()) {
|
||||||
LoadingScene::run();
|
LoadingScene::run();
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace Assets {
|
||||||
__jabyengine_request_lba_for(JABY_LOAD, "ASSETS/MAIN/LOAD.IMG"),
|
__jabyengine_request_lba_for(JABY_LOAD, "ASSETS/MAIN/LOAD.IMG"),
|
||||||
__jabyengine_request_lba_for(APPLE_SFX, "SFX/APPLE.VAG"),
|
__jabyengine_request_lba_for(APPLE_SFX, "SFX/APPLE.VAG"),
|
||||||
__jabyengine_request_lba_for(BLUBB_SFX, "SFX/BLUBB.VAG"),
|
__jabyengine_request_lba_for(BLUBB_SFX, "SFX/BLUBB.VAG"),
|
||||||
|
__jabyengine_request_lba_for(FRIEND_SFX, "SFX/FRIEND.VAG"),
|
||||||
__jabyengine_request_lba_for(MIX_XA, "XAAUDIO/MIX.XA"),
|
__jabyengine_request_lba_for(MIX_XA, "XAAUDIO/MIX.XA"),
|
||||||
__jabyengine_request_lba_for(BIOS_INFO_OVL, "BIO.BIN"),
|
__jabyengine_request_lba_for(BIOS_INFO_OVL, "BIO.BIN"),
|
||||||
__jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"),
|
__jabyengine_request_lba_for(GPU_TEST_OVL, "GTO.BIN"),
|
||||||
|
@ -69,7 +70,8 @@ namespace Assets {
|
||||||
CDFileBuilder::simple_tim(LBA::JABY_LOAD, JabyLoader::TIMLoaction),
|
CDFileBuilder::simple_tim(LBA::JABY_LOAD, JabyLoader::TIMLoaction),
|
||||||
CDFileBuilder::sony_vag(LBA::APPLE_SFX, VAG::create(0, 1.0_vol)),
|
CDFileBuilder::sony_vag(LBA::APPLE_SFX, VAG::create(0, 1.0_vol)),
|
||||||
CDFileBuilder::sony_vag(LBA::BLUBB_SFX, VAG::create(1, 1.0_vol)),
|
CDFileBuilder::sony_vag(LBA::BLUBB_SFX, VAG::create(1, 1.0_vol)),
|
||||||
CustomCDFileBuilder::jingle(32),
|
CDFileBuilder::sony_vag(LBA::FRIEND_SFX, VAG::create(2, 1.0_vol)),
|
||||||
|
CustomCDFileBuilder::jingle(2),
|
||||||
};
|
};
|
||||||
|
|
||||||
void load() {
|
void load() {
|
||||||
|
|
BIN
examples/PoolBox/assets/JabyTails.png (Stored with Git LFS)
BIN
examples/PoolBox/assets/JabyTails.png (Stored with Git LFS)
Binary file not shown.
|
@ -14,6 +14,7 @@ INPUT += $(OUTPUT_DIR)/Evacuation_cdda.xa
|
||||||
INPUT += $(OUTPUT_DIR)/fox.xa
|
INPUT += $(OUTPUT_DIR)/fox.xa
|
||||||
INPUT += $(OUTPUT_DIR)/apple.vag
|
INPUT += $(OUTPUT_DIR)/apple.vag
|
||||||
INPUT += $(OUTPUT_DIR)/blubb.vag
|
INPUT += $(OUTPUT_DIR)/blubb.vag
|
||||||
|
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag
|
||||||
|
|
||||||
## Images
|
## Images
|
||||||
INPUT += $(OUTPUT_DIR)/TexturePage.img
|
INPUT += $(OUTPUT_DIR)/TexturePage.img
|
||||||
|
|
|
@ -49,8 +49,9 @@
|
||||||
</InterleavedFile>
|
</InterleavedFile>
|
||||||
</Directory>
|
</Directory>
|
||||||
<Directory name = "SFX" hidden = "true">
|
<Directory name = "SFX" hidden = "true">
|
||||||
<File name = "APPLE.VAG" lz4 = "already">../assets/bin/apple.vag</File>
|
<File name = "APPLE.VAG" lz4 = "already">../assets/bin/apple.vag</File>
|
||||||
<File name = "BLUBB.VAG" lz4 = "already">../assets/bin/blubb.vag</File>
|
<File name = "BLUBB.VAG" lz4 = "already">../assets/bin/blubb.vag</File>
|
||||||
|
<File name = "FRIEND.VAG">../assets/tmp.vag</File><!--TODO: Find working vag tool-->
|
||||||
</Directory>
|
</Directory>
|
||||||
</Filesystem>
|
</Filesystem>
|
||||||
<AudioTrack align = "true">../assets/audio/temp/breaking.wav</AudioTrack>
|
<AudioTrack align = "true">../assets/audio/temp/breaking.wav</AudioTrack>
|
||||||
|
|
|
@ -42,24 +42,6 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_spu_alloc() {
|
|
||||||
static const auto calculate_spu_adr = [](size_t size) -> const uint8_t* {
|
|
||||||
return reinterpret_cast<const uint8_t*>(SPU_IO_Values::MemoryMap::ADPCM + size);
|
|
||||||
};
|
|
||||||
static const auto simple_assert = [](uint32_t test_id, const uint8_t* adr, const uint8_t* expected) {
|
|
||||||
static const char* ok_text = "Test %i: 0x%p == 0x%p; OK\n";
|
|
||||||
static const char* failed_text = "Test %i: 0x%p != 0x%p; Failed\n";
|
|
||||||
|
|
||||||
printf(adr == expected ? ok_text : failed_text, test_id, adr, expected);
|
|
||||||
};
|
|
||||||
|
|
||||||
printf("=== SPU test ===\n");
|
|
||||||
simple_assert(0, SPU_MMU::allocate(0, 0x600), calculate_spu_adr(0x0));
|
|
||||||
simple_assert(1, SPU_MMU::allocate(1, 0x800), calculate_spu_adr(0x600));
|
|
||||||
simple_assert(2, SPU_MMU::allocate(0, 0x300), calculate_spu_adr(0x0));
|
|
||||||
simple_assert(3, SPU_MMU::allocate(2, 0x300), calculate_spu_adr(0x300));
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace boot {
|
namespace boot {
|
||||||
namespace Start {
|
namespace Start {
|
||||||
// Thanks to Nicolas Noble!
|
// Thanks to Nicolas Noble!
|
||||||
|
@ -99,7 +81,6 @@ namespace JabyEngine {
|
||||||
GTE::setup();
|
GTE::setup();
|
||||||
test_bios_font();
|
test_bios_font();
|
||||||
test_gte_scale();
|
test_gte_scale();
|
||||||
test_spu_alloc();
|
|
||||||
|
|
||||||
SPU::setup();
|
SPU::setup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <PSX/System/syscalls.hpp>
|
#include <PSX/System/syscalls.hpp>
|
||||||
#include <stdio.hpp>
|
#include <stdio.hpp>
|
||||||
|
|
||||||
// TODO: Can you use the GPU IO Port while also using DMA?
|
|
||||||
namespace JabyEngine {
|
namespace JabyEngine {
|
||||||
namespace CD {
|
namespace CD {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace JabyEngine {
|
||||||
const auto words_used = Helper::DMA::send_words<SPU::internal::DMA>(words_to_use, is_last);
|
const auto words_used = Helper::DMA::send_words<SPU::internal::DMA>(words_to_use, is_last);
|
||||||
|
|
||||||
state.words_left -= words_used;
|
state.words_left -= words_used;
|
||||||
|
|
||||||
config.processed(words_used*sizeof(uint32_t));
|
config.processed(words_used*sizeof(uint32_t));
|
||||||
return is_last ? Progress::Done : Progress::InProgress;
|
return is_last ? Progress::Done : Progress::InProgress;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,6 @@ namespace JabyEngine {
|
||||||
|
|
||||||
void render(const uint32_t* data, size_t words) {
|
void render(const uint32_t* data, size_t words) {
|
||||||
wait_ready_for_CMD();
|
wait_ready_for_CMD();
|
||||||
#ifdef __SUPPORT_PS3__
|
|
||||||
// TODO: Doesn't matter anymore...?
|
|
||||||
// The PS3 needs explict change to FiFo
|
|
||||||
//GPU_IO::GP1.set_dma_direction(GPU_IO_Values::GPUSTAT::DMADirection::Fifo);
|
|
||||||
#endif // __SUPPORT_PS3__
|
|
||||||
|
|
||||||
for(size_t n = 0; n < words; n++) {
|
for(size_t n = 0; n < words; n++) {
|
||||||
GPU_IO::GP0.write({data[n]});
|
GPU_IO::GP0.write({data[n]});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <PSX/System/IOPorts/spu_io.hpp>
|
#include <PSX/System/IOPorts/spu_io.hpp>
|
||||||
#include <PSX/Auxiliary/math_helper.hpp>
|
#include <PSX/Auxiliary/math_helper.hpp>
|
||||||
#include <PSX/SPU/spu.hpp>
|
#include <PSX/SPU/spu.hpp>
|
||||||
|
#include <PSX/jabyengine_config.hpp>
|
||||||
#include <stddef.hpp>
|
#include <stddef.hpp>
|
||||||
#ifdef __DEBUG_SPU_MMU__
|
#ifdef __DEBUG_SPU_MMU__
|
||||||
#include <stdio.hpp>
|
#include <stdio.hpp>
|
||||||
|
|
Loading…
Reference in New Issue