mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 20:03:44 +01:00
Ubi SB: Added a new version [Rainbow Six 3 (PC)]
This commit is contained in:
parent
c96a7a34c5
commit
a89651ef92
@ -212,17 +212,30 @@ VGMSTREAM * init_vgmstream_ubi_sb(STREAMFILE *streamFile) {
|
|||||||
if (!config_sb_version(&sb, streamFile))
|
if (!config_sb_version(&sb, streamFile))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (sb.version <= 0x0000000D) {
|
||||||
sb.section1_num = read_32bit(0x04, streamFile);
|
sb.section1_num = read_32bit(0x04, streamFile);
|
||||||
sb.section2_num = read_32bit(0x08, streamFile);
|
sb.section2_num = read_32bit(0x0c, streamFile);
|
||||||
sb.section3_num = read_32bit(0x0c, streamFile);
|
sb.section3_num = read_32bit(0x14, streamFile);
|
||||||
sb.sectionX_size = read_32bit(0x10, streamFile);
|
sb.sectionX_size = read_32bit(0x1c, streamFile);
|
||||||
|
|
||||||
|
sb.section1_offset = 0x20;
|
||||||
|
} else if (sb.version <= 0x000A0000) {
|
||||||
|
sb.section1_num = read_32bit(0x04, streamFile);
|
||||||
|
sb.section2_num = read_32bit(0x0c, streamFile);
|
||||||
|
sb.section3_num = read_32bit(0x14, streamFile);
|
||||||
|
sb.sectionX_size = read_32bit(0x1c, streamFile);
|
||||||
sb.flag1 = read_32bit(0x14, streamFile);
|
sb.flag1 = read_32bit(0x14, streamFile);
|
||||||
|
|
||||||
if (sb.version <= 0x000A0000) {
|
|
||||||
sb.section1_offset = 0x18;
|
sb.section1_offset = 0x18;
|
||||||
} else {
|
} else {
|
||||||
sb.section1_offset = 0x1c;
|
sb.section1_num = read_32bit(0x04, streamFile);
|
||||||
|
sb.section2_num = read_32bit(0x0c, streamFile);
|
||||||
|
sb.section3_num = read_32bit(0x14, streamFile);
|
||||||
|
sb.sectionX_size = read_32bit(0x1c, streamFile);
|
||||||
|
sb.flag1 = read_32bit(0x14, streamFile);
|
||||||
sb.flag2 = read_32bit(0x18, streamFile);
|
sb.flag2 = read_32bit(0x18, streamFile);
|
||||||
|
|
||||||
|
sb.section1_offset = 0x1c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sb.cfg.is_padded_section1_offset)
|
if (sb.cfg.is_padded_section1_offset)
|
||||||
@ -2351,6 +2364,21 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rainbow Six 3 (2003)(PC)-bank 0x0000000B */
|
||||||
|
if (sb->version == 0x0000000B && sb->platform == UBI_PC) {
|
||||||
|
config_sb_entry(sb, 0x5c, 0x7c);
|
||||||
|
|
||||||
|
config_sb_audio_fs(sb, 0x24, 0x00, 0x28);
|
||||||
|
config_sb_audio_hs(sb, 0x46, 0x40, 0x2c, 0x34, 0x4c, 0x48);
|
||||||
|
sb->cfg.audio_has_internal_names = 1;
|
||||||
|
|
||||||
|
config_sb_sequence(sb, 0x28, 0x34);
|
||||||
|
|
||||||
|
config_sb_layer_hs(sb, 0x20, 0x60, 0x58, 0x30);
|
||||||
|
config_sb_layer_sh(sb, 0x14, 0x00, 0x06, 0x08, 0x10);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Prince of Persia: The Sands of Time Demo (2003)(Xbox)-bank 0x0000000D */
|
/* Prince of Persia: The Sands of Time Demo (2003)(Xbox)-bank 0x0000000D */
|
||||||
if (sb->version == 0x0000000D && sb->platform == UBI_XBOX) {
|
if (sb->version == 0x0000000D && sb->platform == UBI_XBOX) {
|
||||||
config_sb_entry(sb, 0x5c, 0x74);
|
config_sb_entry(sb, 0x5c, 0x74);
|
||||||
@ -2358,6 +2386,11 @@ static int config_sb_version(ubi_sb_header * sb, STREAMFILE *streamFile) {
|
|||||||
config_sb_audio_fs(sb, 0x24, 0x00, 0x28);
|
config_sb_audio_fs(sb, 0x24, 0x00, 0x28);
|
||||||
config_sb_audio_hs(sb, 0x46, 0x40, 0x2c, 0x34, 0x4c, 0x48);
|
config_sb_audio_hs(sb, 0x46, 0x40, 0x2c, 0x34, 0x4c, 0x48);
|
||||||
sb->cfg.audio_has_internal_names = 1;
|
sb->cfg.audio_has_internal_names = 1;
|
||||||
|
|
||||||
|
config_sb_sequence(sb, 0x28, 0x34);
|
||||||
|
|
||||||
|
config_sb_layer_hs(sb, 0x20, 0x60, 0x58, 0x30);
|
||||||
|
config_sb_layer_sh(sb, 0x14, 0x00, 0x06, 0x08, 0x10);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +178,31 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
data->block_data_start = 0x08 + data->layer_max*0x04;
|
data->block_data_start = 0x08 + data->layer_max*0x04;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x00000003: /* Rainbow Six 3 */
|
||||||
|
/* - layer header
|
||||||
|
* 0x04: layer count
|
||||||
|
* 0x08: stream size
|
||||||
|
* 0x0c: block header size
|
||||||
|
* 0x10: block size (fixed)
|
||||||
|
* 0x14: min layer data?
|
||||||
|
* 0x18: size of header sizes and headers
|
||||||
|
* 0x1c+(04*N): header size per layer
|
||||||
|
* - block header
|
||||||
|
* 0x00: block number
|
||||||
|
* 0x04: block offset
|
||||||
|
* 0x08+(04*N): layer size per layer
|
||||||
|
* 0xNN: layer data per layer */
|
||||||
|
data->layer_max = read_32bit(offset+0x04, streamfile);
|
||||||
|
|
||||||
|
data->header_next_start = 0x10;
|
||||||
|
data->header_sizes_start = 0x1c;
|
||||||
|
data->header_data_start = 0x1c + data->layer_max*0x04;
|
||||||
|
|
||||||
|
data->block_next_start = 0;
|
||||||
|
data->block_sizes_start = 0x08;
|
||||||
|
data->block_data_start = 0x08 + data->layer_max*0x04;
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x00000004: /* Prince of Persia: Sands of Time, Batman: Rise of Sin Tzu */
|
case 0x00000004: /* Prince of Persia: Sands of Time, Batman: Rise of Sin Tzu */
|
||||||
/* - layer header
|
/* - layer header
|
||||||
* 0x04: layer count
|
* 0x04: layer count
|
||||||
@ -186,7 +211,7 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
* 0x10: block header size
|
* 0x10: block header size
|
||||||
* 0x14: block size (fixed)
|
* 0x14: block size (fixed)
|
||||||
* 0x18: min layer data?
|
* 0x18: min layer data?
|
||||||
* 0x1c: size of header sizes
|
* 0x1c: size of header sizes and headers
|
||||||
* 0x20+(04*N): header size per layer
|
* 0x20+(04*N): header size per layer
|
||||||
* - block header
|
* - block header
|
||||||
* 0x00: block number
|
* 0x00: block number
|
||||||
@ -214,7 +239,7 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
* 0x14: block header size
|
* 0x14: block header size
|
||||||
* 0x18: block size (fixed)
|
* 0x18: block size (fixed)
|
||||||
* 0x1c+(04*8): min layer data? for 8 layers (-1 after layer count)
|
* 0x1c+(04*8): min layer data? for 8 layers (-1 after layer count)
|
||||||
* 0x3c: size of header sizes
|
* 0x3c: size of header sizes and headers
|
||||||
* 0x40+(04*N): header size per layer
|
* 0x40+(04*N): header size per layer
|
||||||
* 0xNN: header data per layer
|
* 0xNN: header data per layer
|
||||||
* - block header
|
* - block header
|
||||||
@ -243,7 +268,7 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
* 0x14: block header size
|
* 0x14: block header size
|
||||||
* 0x18: block size (fixed)
|
* 0x18: block size (fixed)
|
||||||
* 0x1c+(04*11): min layer data? for 11 layers (-1 after layer count)
|
* 0x1c+(04*11): min layer data? for 11 layers (-1 after layer count)
|
||||||
* 0x48: size of header sizes
|
* 0x48: size of header sizes and headers
|
||||||
* 0x4c+(04*N): header size per layer
|
* 0x4c+(04*N): header size per layer
|
||||||
* 0xNN: header data per layer
|
* 0xNN: header data per layer
|
||||||
* - block header
|
* - block header
|
||||||
@ -272,7 +297,7 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
* 0x08: layer count
|
* 0x08: layer count
|
||||||
* 0x0c: blocks count
|
* 0x0c: blocks count
|
||||||
* 0x10: block header size
|
* 0x10: block header size
|
||||||
* 0x14: size of header sizes/data
|
* 0x14: size of header sizes and headers/data
|
||||||
* 0x18: next block size
|
* 0x18: next block size
|
||||||
* 0x1c+(04*N): layer header size
|
* 0x1c+(04*N): layer header size
|
||||||
* 0xNN: header data per layer
|
* 0xNN: header data per layer
|
||||||
@ -298,7 +323,7 @@ static int ubi_sb_io_init(STREAMFILE *streamfile, ubi_sb_io_data* data) {
|
|||||||
* 0x08: layer count
|
* 0x08: layer count
|
||||||
* 0x0c: blocks count
|
* 0x0c: blocks count
|
||||||
* 0x10: block header size
|
* 0x10: block header size
|
||||||
* 0x14: size of header sizes/data
|
* 0x14: size of header sizes and headers/data
|
||||||
* 0x18: next block size
|
* 0x18: next block size
|
||||||
* 0x1c+(04*10): usable size per layer
|
* 0x1c+(04*10): usable size per layer
|
||||||
* 0x5c+(04*N): layer header size
|
* 0x5c+(04*N): layer header size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user