From ede23116df2700ed2acb2aab3f2eecf75b9245e1 Mon Sep 17 00:00:00 2001 From: NicknineTheEagle Date: Mon, 21 Nov 2022 21:36:59 +0300 Subject: [PATCH] Ubi SB: Added a new version [Prince of Persia: Warrior Within Demo (Xbox)] --- src/meta/ubi_sb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/meta/ubi_sb.c b/src/meta/ubi_sb.c index deb09b49..2e6d7f8f 100644 --- a/src/meta/ubi_sb.c +++ b/src/meta/ubi_sb.c @@ -1530,7 +1530,7 @@ static VGMSTREAM* init_vgmstream_ubi_sb_silence(ubi_sb_header* sb) { sample_rate = sb->sample_rate; if (sample_rate == 0) sample_rate = 48000; - num_samples = sb->duration * sample_rate; + num_samples = (int)(sb->duration * sample_rate); /* init the VGMSTREAM */ @@ -3563,6 +3563,18 @@ static int config_sb_version(ubi_sb_header* sb, STREAMFILE* sf) { return 1; } + /* Prince of Persia: Warrior Within (Demo)(2004)(Xbox)-bank */ + if (sb->version == 0x00100000 && sb->platform == UBI_XBOX) { + config_sb_entry(sb, 0x68, 0x90); + + config_sb_audio_fs(sb, 0x24, 0x28, 0x40); + config_sb_audio_hs(sb, 0x60, 0x58, 0x44, 0x4c, 0x68, 0x64); + sb->cfg.audio_has_internal_names = 1; + + config_sb_sequence(sb, 0x28, 0x14); + return 1; + } + /* two configs with same id; try to autodetect or use project file as identifier */ if (sb->version == 0x00120006 && sb->platform == UBI_PC) { if (test_version_sb(sb, sf, 0x6c, 0xa4) || check_project_file(sf, "gamesnd_myst4.sp0", 1)) {