From 1aa8438f679eb85df1143e9c94d5f9e07d55ba94 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 22 Feb 2020 20:40:07 +0100 Subject: [PATCH] Add .al [Dominions 3: The Awakening (PC)] --- src/formats.c | 3 ++- src/meta/meta.h | 2 +- src/meta/raw_al.c | 16 +++++++++------- src/vgmstream.c | 2 +- src/vgmstream.h | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/formats.c b/src/formats.c index dbf8ad08..02cb4c25 100644 --- a/src/formats.c +++ b/src/formats.c @@ -62,6 +62,7 @@ static const char* extension_list[] = { "aiffl", //fake extension for .aif??? "aix", "akb", + "al", "al2", "amts", //fake extension/header id for .stm (renamed? to be removed?) "ao", @@ -1156,7 +1157,7 @@ static const meta_info meta_info_list[] = { {meta_EA_SNU, "Electronic Arts SNU header"}, {meta_AWC, "Rockstar AWC header"}, {meta_OPUS, "Nintendo Switch OPUS header"}, - {meta_PC_AL2, "Illwinter Game Design AL2 raw header"}, + {meta_RAW_AL, "Illwinter Game Design .AL raw header"}, {meta_PC_AST, "Capcom AST (PC) header"}, {meta_UBI_SB, "Ubisoft SBx header"}, {meta_NAAC, "Namco NAAC header"}, diff --git a/src/meta/meta.h b/src/meta/meta.h index a78e2fed..39ab32c6 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -646,7 +646,7 @@ VGMSTREAM * init_vgmstream_opus_prototype(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_opus_opusnx(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_opus_sqex(STREAMFILE* streamFile); -VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile); +VGMSTREAM * init_vgmstream_raw_al(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_pc_ast(STREAMFILE * streamFile); diff --git a/src/meta/raw_al.c b/src/meta/raw_al.c index cc440a17..717940df 100644 --- a/src/meta/raw_al.c +++ b/src/meta/raw_al.c @@ -1,27 +1,29 @@ #include "meta.h" #include "../coding/coding.h" -/* AL" - headerless a-law, found in Conquest of Elysium 3 (PC) */ -VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE *streamFile) { +/* AL/AL2 - headerless a-law, from Illwinter Game Design games */ +VGMSTREAM * init_vgmstream_raw_al(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; off_t start_offset; int loop_flag = 0, channel_count; - - if ( !check_extensions(streamFile,"al2")) + /* checks */ + /* .al: Dominions 3 - The Awakening (PC) + * .al2: Conquest of Elysium 3 (PC) */ + if ( !check_extensions(streamFile,"al,al2")) goto fail; - channel_count = 2; + channel_count = check_extensions(streamFile,"al") ? 1 : 2; /* build the VGMSTREAM */ vgmstream = allocate_vgmstream(channel_count,loop_flag); if (!vgmstream) goto fail; - vgmstream->sample_rate = 22050; + vgmstream->sample_rate = 22050; vgmstream->coding_type = coding_ALAW; vgmstream->layout_type = layout_interleave; vgmstream->interleave_block_size = 0x01; - vgmstream->meta_type = meta_PC_AL2; + vgmstream->meta_type = meta_RAW_AL; vgmstream->num_samples = pcm_bytes_to_samples(get_streamfile_size(streamFile), channel_count, 8); if (loop_flag) { vgmstream->loop_start_sample = 0; diff --git a/src/vgmstream.c b/src/vgmstream.c index 648d0b6a..e8634ccf 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -346,7 +346,6 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = { init_vgmstream_opus_nus3, init_vgmstream_opus_sps_n1, init_vgmstream_opus_nxa, - init_vgmstream_pc_al2, init_vgmstream_pc_ast, init_vgmstream_naac, init_vgmstream_ubi_sb, @@ -500,6 +499,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = { init_vgmstream_raw_wavm, /* .wavm raw xbox */ init_vgmstream_raw_pcm, /* .raw raw PCM */ init_vgmstream_s14_sss, /* .s14/sss raw siren14 */ + init_vgmstream_raw_al, /* .al/al2 raw A-LAW */ #ifdef VGM_USE_FFMPEG init_vgmstream_ffmpeg, /* may play anything incorrectly, since FFmpeg doesn't check extensions */ #endif diff --git a/src/vgmstream.h b/src/vgmstream.h index d270effa..51d520ad 100644 --- a/src/vgmstream.h +++ b/src/vgmstream.h @@ -612,7 +612,7 @@ typedef enum { meta_EA_SNU, /* Electronic Arts SNU (Dead Space) */ meta_AWC, /* Rockstar AWC (GTA5, RDR) */ meta_OPUS, /* Nintendo Opus [Lego City Undercover (Switch)] */ - meta_PC_AL2, /* Conquest of Elysium 3 (PC) */ + meta_RAW_AL, meta_PC_AST, /* Dead Rising (PC) */ meta_NAAC, /* Namco AAC (3DS) */ meta_UBI_SB, /* Ubisoft banks */