Merge pull request #1076 from bnnm/hca-fsb

- Add HCA keys
- Add .sfx FSB extension
This commit is contained in:
bnnm 2022-02-13 22:01:35 +01:00 committed by GitHub
commit 0dddcfc7ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 16 deletions

View File

@ -11,6 +11,9 @@ import os, glob, argparse
# bgm.awb#1 .txtp
# >> creates bgm.awb#1 .txtp
#
# data/bgm.fsb #2 : bgm_field.txtp
# >> creates bgm_field.txtp full txtp, with data/bgm.fsb #2 inside
#
#******************************************************************************
class Cli(object):

View File

@ -21,7 +21,7 @@ def parse():
'- find all .ogg in files including those that end with 0.ogg or 1.ogg\n'
'%(prog)s files/*.ogg -fe .+(a|all)[.]ogg$\n'
'- find all .ogg in files excluding those that end with a.ogg or all.ogg\n'
'%(prog)s files/*.* -fi "(.+)(_intro|_loop)([.].+)$" -n "\\1)_full" -cfa\n'
'%(prog)s files/*.* -fi "(.+)(_intro|_loop)([.].+)$" -n "\\1_full" -cla\n'
'- makes intro+loop .txtp named (first part without _intro/_loop)_full.txtp + loops\n'
'%(prog)s files/*.* -fe "(.+)(_intro|_loop)([.].+)$" -s\n'
'- makes single .txtp for files that don\'t have intro+loop pairs\n'
@ -96,9 +96,9 @@ def main():
args = parse()
if args.filter_include:
args.p_include = re.compile(args.filter_include)
args.p_include = re.compile(args.filter_include, re.IGNORECASE)
if args.filter_exclude:
args.p_exclude = re.compile(args.filter_exclude)
args.p_exclude = re.compile(args.filter_exclude, re.IGNORECASE)
# get target files
files = glob.glob(args.files)

View File

@ -112,15 +112,18 @@ VGMSTREAM* init_vgmstream_fsb(STREAMFILE* sf) {
fsb_header fsb = {0};
/* checks
* .fsb: standard
* .bnk: Hard Corps Uprising (PS3) */
if ( !check_extensions(sf, "fsb,bnk") )
/* checks */
if ((read_u32be(0x00,sf) & 0xFFFFFF00) != get_id32be("FSB\0"))
goto fail;
/* check header */
fsb.id = read_32bitBE(0x00,sf);
if (fsb.id == 0x46534231) { /* "FSB1" (somewhat different from other fsbs) */
/* .fsb: standard
* .bnk: Hard Corps Uprising (PS3)
* .sfx: Geon Cube (Wii) */
if ( !check_extensions(sf, "fsb,bnk,sfx") )
goto fail;
fsb.id = read_u32be(0x00,sf);
if (fsb.id == get_id32be("FSB1")) {
fsb.meta_type = meta_FSB1;
fsb.base_header_size = 0x10;
fsb.sample_header_min = 0x40;
@ -132,7 +135,8 @@ VGMSTREAM* init_vgmstream_fsb(STREAMFILE* sf) {
fsb.version = 0;
fsb.flags = 0;
if (fsb.total_subsongs > 1) goto fail;
if (fsb.total_subsongs > 1)
goto fail;
/* sample header (first stream only, not sure if there are multi-FSB1) */
{
@ -159,16 +163,16 @@ VGMSTREAM* init_vgmstream_fsb(STREAMFILE* sf) {
fsb.stream_offset = fsb.base_header_size + fsb.sample_headers_size;
}
}
else { /* other FSBs (common/extended format) */
if (fsb.id == 0x46534232) { /* "FSB2" */
else {
if (fsb.id == get_id32be("FSB2")) {
fsb.meta_type = meta_FSB2;
fsb.base_header_size = 0x10;
fsb.sample_header_min = 0x40; /* guessed */
} else if (fsb.id == 0x46534233) { /* "FSB3" */
} else if (fsb.id == get_id32be("FSB3")) {
fsb.meta_type = meta_FSB3;
fsb.base_header_size = 0x18;
fsb.sample_header_min = 0x40;
} else if (fsb.id == 0x46534234) { /* "FSB4" */
} else if (fsb.id == get_id32be("FSB4")) {
fsb.meta_type = meta_FSB4;
fsb.base_header_size = 0x30;
fsb.sample_header_min = 0x50;
@ -183,7 +187,7 @@ VGMSTREAM* init_vgmstream_fsb(STREAMFILE* sf) {
if (fsb.base_header_size > 0x10) {
fsb.version = read_32bitLE(0x10,sf);
fsb.flags = read_32bitLE(0x14,sf);
/* FSB4: 0x18(8):hash 0x20(10):guid */
/* FSB4: 0x18(8):hash, 0x20(10):guid */
} else {
fsb.version = 0;
fsb.flags = 0;

View File

@ -858,6 +858,8 @@ static const hcakey_info hcakey_list[] = {
{0x0a5d0fc8cc5c4502}, // Sng018
{0x198ea1a17416050b}, // Sng019
{0x2aa3b8abad207a1e}, // Sng020
{0x08ad2fe12c79bca9}, // Sng022
{0x18488992b1632ef5}, // Sng023
{0x1175edbbacc1fc18}, // Sng024
{0x0e14d06d7f7a6c8c}, // Sng025
{0x33d98a3a9f9bfdef}, // Sng026