diff --git a/examples/PoolBox/application/src/Custom/custom_files.hpp b/examples/PoolBox/application/src/Custom/custom_files.hpp index c99999ea..39e17ce4 100644 --- a/examples/PoolBox/application/src/Custom/custom_files.hpp +++ b/examples/PoolBox/application/src/Custom/custom_files.hpp @@ -7,7 +7,7 @@ enum struct FileType : JabyEngine::CDFileType_t { struct CustomCDFileBuilder { 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); } }; \ No newline at end of file diff --git a/examples/PoolBox/application/src/Custom/file_parser.cpp b/examples/PoolBox/application/src/Custom/file_parser.cpp index f9a8da64..c22cd4df 100644 --- a/examples/PoolBox/application/src/Custom/file_parser.cpp +++ b/examples/PoolBox/application/src/Custom/file_parser.cpp @@ -9,7 +9,7 @@ namespace JabyEngine { }; 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; } diff --git a/examples/PoolBox/application/src/application.cpp b/examples/PoolBox/application/src/application.cpp index 2221a76c..1c0a6b89 100644 --- a/examples/PoolBox/application/src/application.cpp +++ b/examples/PoolBox/application/src/application.cpp @@ -170,7 +170,6 @@ static void setup() { break; } },MenuEntries); - cd_player.play(); } @@ -289,8 +288,8 @@ namespace LoadingScene { void main() { const auto& controller = Periphery::get_primary_controller_as(); + setup(); - while(true) { if(state_changer.contains_state()) { LoadingScene::run(); diff --git a/examples/PoolBox/application/src/asset_mgr.cpp b/examples/PoolBox/application/src/asset_mgr.cpp index 87a789e2..8adc3dc9 100644 --- a/examples/PoolBox/application/src/asset_mgr.cpp +++ b/examples/PoolBox/application/src/asset_mgr.cpp @@ -20,6 +20,7 @@ namespace Assets { __jabyengine_request_lba_for(JABY_LOAD, "ASSETS/MAIN/LOAD.IMG"), __jabyengine_request_lba_for(APPLE_SFX, "SFX/APPLE.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(BIOS_INFO_OVL, "BIO.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::sony_vag(LBA::APPLE_SFX, VAG::create(0, 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() { diff --git a/examples/PoolBox/assets/JabyTails.png b/examples/PoolBox/assets/JabyTails.png index 1199a1fb..a07750e4 100644 --- a/examples/PoolBox/assets/JabyTails.png +++ b/examples/PoolBox/assets/JabyTails.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:50c3fd85a0327a6cff4a75d47349c1e329a129498c7fee46d57a8c1aabfe6b1d -size 1676 +oid sha256:49577dbd3b72299e84a2e252e457fd40ce496a51e2179533239d9d2959d3f995 +size 9345 diff --git a/examples/PoolBox/assets/Makefile b/examples/PoolBox/assets/Makefile index 08b582e3..644f7b10 100644 --- a/examples/PoolBox/assets/Makefile +++ b/examples/PoolBox/assets/Makefile @@ -14,6 +14,7 @@ INPUT += $(OUTPUT_DIR)/Evacuation_cdda.xa INPUT += $(OUTPUT_DIR)/fox.xa INPUT += $(OUTPUT_DIR)/apple.vag INPUT += $(OUTPUT_DIR)/blubb.vag +INPUT += $(OUTPUT_DIR)/Friendship_samp.vag ## Images INPUT += $(OUTPUT_DIR)/TexturePage.img diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index e6abd5fd..3dbc14d2 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -49,8 +49,9 @@ ../assets/audio/temp/breaking.wav diff --git a/src/Library/src/BootLoader/start_boot.cpp b/src/Library/src/BootLoader/start_boot.cpp index d2990f37..0616f596 100644 --- a/src/Library/src/BootLoader/start_boot.cpp +++ b/src/Library/src/BootLoader/start_boot.cpp @@ -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(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 Start { // Thanks to Nicolas Noble! @@ -99,7 +81,6 @@ namespace JabyEngine { GTE::setup(); test_bios_font(); test_gte_scale(); - test_spu_alloc(); SPU::setup(); } diff --git a/src/Library/src/CD/cd.cpp b/src/Library/src/CD/cd.cpp index 0e34c54a..250ba58d 100644 --- a/src/Library/src/CD/cd.cpp +++ b/src/Library/src/CD/cd.cpp @@ -5,7 +5,6 @@ #include #include -// TODO: Can you use the GPU IO Port while also using DMA? namespace JabyEngine { namespace CD { namespace internal { diff --git a/src/Library/src/File/Processor/vag_processor.cpp b/src/Library/src/File/Processor/vag_processor.cpp index 9c6555ce..1375b4f4 100644 --- a/src/Library/src/File/Processor/vag_processor.cpp +++ b/src/Library/src/File/Processor/vag_processor.cpp @@ -44,6 +44,7 @@ namespace JabyEngine { const auto words_used = Helper::DMA::send_words(words_to_use, is_last); state.words_left -= words_used; + config.processed(words_used*sizeof(uint32_t)); return is_last ? Progress::Done : Progress::InProgress; } diff --git a/src/Library/src/GPU/gpu.cpp b/src/Library/src/GPU/gpu.cpp index aa7c14e6..7962403c 100644 --- a/src/Library/src/GPU/gpu.cpp +++ b/src/Library/src/GPU/gpu.cpp @@ -62,12 +62,6 @@ namespace JabyEngine { void render(const uint32_t* data, size_t words) { 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++) { GPU_IO::GP0.write({data[n]}); } diff --git a/src/Library/src/SPU/spu_mmu.cpp b/src/Library/src/SPU/spu_mmu.cpp index c38ea785..7692ee75 100644 --- a/src/Library/src/SPU/spu_mmu.cpp +++ b/src/Library/src/SPU/spu_mmu.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #ifdef __DEBUG_SPU_MMU__ #include