mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
cleanup
This commit is contained in:
parent
d4e697fdbe
commit
d8cd1487ea
@ -395,7 +395,7 @@ int get_vgmstream_samples_per_frame(VGMSTREAM* vgmstream) {
|
|||||||
case coding_IMA:
|
case coding_IMA:
|
||||||
case coding_DVI_IMA:
|
case coding_DVI_IMA:
|
||||||
case coding_SNDS_IMA:
|
case coding_SNDS_IMA:
|
||||||
case coding_OTNS_IMA:
|
case coding_QD_IMA:
|
||||||
case coding_UBI_IMA:
|
case coding_UBI_IMA:
|
||||||
case coding_UBI_SCE_IMA:
|
case coding_UBI_SCE_IMA:
|
||||||
case coding_OKI16:
|
case coding_OKI16:
|
||||||
@ -631,7 +631,7 @@ int get_vgmstream_frame_size(VGMSTREAM* vgmstream) {
|
|||||||
case coding_RAD_IMA_mono:
|
case coding_RAD_IMA_mono:
|
||||||
return 0x14;
|
return 0x14;
|
||||||
case coding_SNDS_IMA:
|
case coding_SNDS_IMA:
|
||||||
case coding_OTNS_IMA:
|
case coding_QD_IMA:
|
||||||
return 0; //todo: 0x01?
|
return 0; //todo: 0x01?
|
||||||
case coding_UBI_IMA: /* variable (PCM then IMA) */
|
case coding_UBI_IMA: /* variable (PCM then IMA) */
|
||||||
return 0;
|
return 0;
|
||||||
@ -1173,7 +1173,7 @@ void decode_vgmstream(VGMSTREAM* vgmstream, int samples_written, int samples_to_
|
|||||||
vgmstream->channels, vgmstream->samples_into_block, samples_to_do, ch);
|
vgmstream->channels, vgmstream->samples_into_block, samples_to_do, ch);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case coding_OTNS_IMA:
|
case coding_QD_IMA:
|
||||||
for (ch = 0; ch < vgmstream->channels; ch++) {
|
for (ch = 0; ch < vgmstream->channels; ch++) {
|
||||||
decode_otns_ima(vgmstream, &vgmstream->ch[ch], buffer+ch,
|
decode_otns_ima(vgmstream, &vgmstream->ch[ch], buffer+ch,
|
||||||
vgmstream->channels, vgmstream->samples_into_block, samples_to_do, ch);
|
vgmstream->channels, vgmstream->samples_into_block, samples_to_do, ch);
|
||||||
|
@ -747,7 +747,7 @@ static const coding_info coding_info_list[] = {
|
|||||||
{coding_DVI_IMA_int, "Intel DVI 4-bit IMA ADPCM (mono/interleave)"},
|
{coding_DVI_IMA_int, "Intel DVI 4-bit IMA ADPCM (mono/interleave)"},
|
||||||
{coding_3DS_IMA, "3DS IMA 4-bit ADPCM"},
|
{coding_3DS_IMA, "3DS IMA 4-bit ADPCM"},
|
||||||
{coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"},
|
{coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"},
|
||||||
{coding_OTNS_IMA, "Omikron: The Nomad Soul 4-bit IMA ADPCM"},
|
{coding_QD_IMA, "Quantic Dream 4-bit IMA ADPCM"},
|
||||||
{coding_WV6_IMA, "Gorilla Systems WV6 4-bit IMA ADPCM"},
|
{coding_WV6_IMA, "Gorilla Systems WV6 4-bit IMA ADPCM"},
|
||||||
{coding_ALP_IMA, "High Voltage ALP 4-bit IMA ADPCM"},
|
{coding_ALP_IMA, "High Voltage ALP 4-bit IMA ADPCM"},
|
||||||
{coding_FFTA2_IMA, "Final Fantasy Tactics A2 4-bit IMA ADPCM"},
|
{coding_FFTA2_IMA, "Final Fantasy Tactics A2 4-bit IMA ADPCM"},
|
||||||
@ -1167,7 +1167,7 @@ static const meta_info meta_info_list[] = {
|
|||||||
{meta_HYPERSCAN_KVAG, "Mattel Hyperscan KVAG"},
|
{meta_HYPERSCAN_KVAG, "Mattel Hyperscan KVAG"},
|
||||||
{meta_IOS_PSND, "PSND Header"},
|
{meta_IOS_PSND, "PSND Header"},
|
||||||
{meta_BOS_ADP, "ADP! header"},
|
{meta_BOS_ADP, "ADP! header"},
|
||||||
{meta_OTNS_ADP, "Omikron: The Nomad Soul ADP header"},
|
{meta_QD_ADP, "Quantic Dream .ADP header"},
|
||||||
{meta_EB_SFX, "Excitebots .sfx header"},
|
{meta_EB_SFX, "Excitebots .sfx header"},
|
||||||
{meta_EB_SF0, "assumed Excitebots .sf0 by extension"},
|
{meta_EB_SF0, "assumed Excitebots .sf0 by extension"},
|
||||||
{meta_MTAF, "Konami MTAF header"},
|
{meta_MTAF, "Konami MTAF header"},
|
||||||
|
@ -533,9 +533,9 @@ VGMSTREAM * init_vgmstream_hyperscan_kvag(STREAMFILE* streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_ios_psnd(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_ios_psnd(STREAMFILE* streamFile);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_pc_adp_bos(STREAMFILE* streamFile);
|
VGMSTREAM* init_vgmstream_adp_bos(STREAMFILE* sf);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_pc_adp_otns(STREAMFILE* streamFile);
|
VGMSTREAM* init_vgmstream_adp_qd(STREAMFILE* sf);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_eb_sfx(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_eb_sfx(STREAMFILE* streamFile);
|
||||||
VGMSTREAM * init_vgmstream_eb_sf0(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_eb_sf0(STREAMFILE* streamFile);
|
||||||
|
@ -1,45 +1,43 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
|
|
||||||
/* ADP - from Balls of Steel */
|
/* ADP - from Balls of Steel */
|
||||||
VGMSTREAM * init_vgmstream_pc_adp_bos(STREAMFILE *streamFile) {
|
VGMSTREAM* init_vgmstream_adp_bos(STREAMFILE* sf) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
off_t start_offset;
|
off_t start_offset;
|
||||||
int loop_flag = 0;
|
int loop_flag = 0;
|
||||||
int channel_count;
|
int channels;
|
||||||
|
|
||||||
if (!check_extensions(streamFile,"adp")) goto fail;
|
/* checks */
|
||||||
|
if (!check_extensions(sf,"adp"))
|
||||||
/* check header */
|
|
||||||
if (read_32bitBE(0x00,streamFile) != 0x41445021) /* "ADP!" */
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
loop_flag = (-1 != read_32bitLE(0x08,streamFile));
|
if (!is_id32be(0x00,sf, "ADP!"))
|
||||||
channel_count = 1;
|
goto fail;
|
||||||
|
|
||||||
|
loop_flag = (-1 != read_s32le(0x08,sf));
|
||||||
|
channels = 1;
|
||||||
|
start_offset = 0x18;
|
||||||
|
|
||||||
|
|
||||||
/* build the VGMSTREAM */
|
/* build the VGMSTREAM */
|
||||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||||
if (!vgmstream) goto fail;
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
/* fill in the vital statistics */
|
vgmstream->sample_rate = read_s32le(0x0C,sf);
|
||||||
start_offset = 0x18;
|
vgmstream->num_samples = read_s32le(0x04,sf);
|
||||||
vgmstream->channels = channel_count;
|
vgmstream->loop_start_sample = read_s32le(0x08,sf);
|
||||||
vgmstream->sample_rate = read_32bitLE(0x0C,streamFile);
|
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||||
vgmstream->num_samples = read_32bitLE(0x04,streamFile);
|
|
||||||
if (loop_flag) {
|
|
||||||
vgmstream->loop_start_sample = read_32bitLE(0x08,streamFile);
|
|
||||||
vgmstream->loop_end_sample = vgmstream->num_samples;
|
|
||||||
}
|
|
||||||
|
|
||||||
vgmstream->coding_type = coding_DVI_IMA_int;
|
vgmstream->coding_type = coding_DVI_IMA_int;
|
||||||
vgmstream->layout_type = layout_none;
|
vgmstream->layout_type = layout_none;
|
||||||
vgmstream->meta_type = meta_BOS_ADP;
|
vgmstream->meta_type = meta_BOS_ADP;
|
||||||
|
|
||||||
// 0x10, 0x12 - both initial history?
|
// 0x10, 0x12 - both initial history?
|
||||||
//vgmstream->ch[0].adpcm_history1_32 = read_16bitLE(0x10,streamFile);
|
//vgmstream->ch[0].adpcm_history1_32 = read_16bitLE(0x10,sf);
|
||||||
// 0x14 - initial step index?
|
// 0x14 - initial step index?
|
||||||
//vgmstream->ch[0].adpcm_step_index = read_32bitLE(0x14,streamFile);
|
//vgmstream->ch[0].adpcm_step_index = read_32bitLE(0x14,sf);
|
||||||
|
|
||||||
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
|
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||||
goto fail;
|
goto fail;
|
||||||
return vgmstream;
|
return vgmstream;
|
||||||
|
|
||||||
|
@ -1,39 +1,42 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
|
|
||||||
/* ADP - from Omikron: The Nomad Soul (PC/DC) */
|
/* ADP - from Omikron: The Nomad Soul (PC/DC) */
|
||||||
VGMSTREAM * init_vgmstream_pc_adp_otns(STREAMFILE *streamFile) {
|
VGMSTREAM* init_vgmstream_adp_qd(STREAMFILE* sf) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
off_t start_offset, datasize;
|
off_t start_offset, data_size;
|
||||||
int loop_flag = 0, channel_count, stereo_flag;
|
int loop_flag = 0, channels, stereo_flag;
|
||||||
|
|
||||||
if (!check_extensions(streamFile,"adp")) goto fail;
|
|
||||||
|
|
||||||
/* no ID, only a basic 0x10 header with filesize and nulls; do some extra checks */
|
/* checks */
|
||||||
datasize = read_32bitLE(0x00,streamFile) & 0x00FFFFFF; /*24 bit*/
|
if (!check_extensions(sf,"adp"))
|
||||||
if (datasize + 0x10 != streamFile->get_size(streamFile)
|
|
||||||
|| read_32bitLE(0x04,streamFile) != 0
|
|
||||||
|| read_32bitLE(0x08,streamFile) != 0
|
|
||||||
|| read_32bitLE(0x0c,streamFile) != 0)
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
stereo_flag = read_8bit(0x03, streamFile);
|
/* no ID, only a basic 0x10 header with filesize and nulls; do some extra checks */
|
||||||
|
data_size = read_u32le(0x00,sf) & 0x00FFFFFF; /*24 bit*/
|
||||||
|
if (data_size + 0x10 != sf->get_size(sf)
|
||||||
|
|| read_u32le(0x04,sf) != 0
|
||||||
|
|| read_u32le(0x08,sf) != 0
|
||||||
|
|| read_u32le(0x0c,sf) != 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
stereo_flag = read_u8(0x03, sf);
|
||||||
if (stereo_flag > 1 || stereo_flag < 0) goto fail;
|
if (stereo_flag > 1 || stereo_flag < 0) goto fail;
|
||||||
channel_count = stereo_flag ? 2 : 1;
|
channels = stereo_flag ? 2 : 1;
|
||||||
|
start_offset = 0x10;
|
||||||
|
|
||||||
|
|
||||||
/* build the VGMSTREAM */
|
/* build the VGMSTREAM */
|
||||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||||
if (!vgmstream) goto fail;
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
start_offset = 0x10;
|
vgmstream->meta_type = meta_QD_ADP;
|
||||||
vgmstream->channels = channel_count;
|
|
||||||
vgmstream->sample_rate = 22050;
|
vgmstream->sample_rate = 22050;
|
||||||
vgmstream->num_samples = channel_count== 1 ? datasize*2 : datasize;
|
vgmstream->num_samples = data_size * 2 / channels;
|
||||||
|
|
||||||
vgmstream->coding_type = coding_OTNS_IMA;
|
vgmstream->coding_type = coding_QD_IMA;
|
||||||
vgmstream->layout_type = layout_none;
|
vgmstream->layout_type = layout_none;
|
||||||
vgmstream->meta_type = meta_OTNS_ADP;
|
|
||||||
|
|
||||||
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
|
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||||
goto fail;
|
goto fail;
|
||||||
return vgmstream;
|
return vgmstream;
|
||||||
|
|
||||||
|
@ -275,8 +275,8 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
|
|||||||
init_vgmstream_ps2_wmus,
|
init_vgmstream_ps2_wmus,
|
||||||
init_vgmstream_hyperscan_kvag,
|
init_vgmstream_hyperscan_kvag,
|
||||||
init_vgmstream_ios_psnd,
|
init_vgmstream_ios_psnd,
|
||||||
init_vgmstream_pc_adp_bos,
|
init_vgmstream_adp_bos,
|
||||||
init_vgmstream_pc_adp_otns,
|
init_vgmstream_adp_qd,
|
||||||
init_vgmstream_eb_sfx,
|
init_vgmstream_eb_sfx,
|
||||||
init_vgmstream_eb_sf0,
|
init_vgmstream_eb_sf0,
|
||||||
init_vgmstream_mtaf,
|
init_vgmstream_mtaf,
|
||||||
|
@ -106,7 +106,7 @@ typedef enum {
|
|||||||
coding_DVI_IMA_int, /* DVI IMA ADPCM (mono/interleave, high nibble first) */
|
coding_DVI_IMA_int, /* DVI IMA ADPCM (mono/interleave, high nibble first) */
|
||||||
coding_3DS_IMA, /* 3DS IMA ADPCM */
|
coding_3DS_IMA, /* 3DS IMA ADPCM */
|
||||||
coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */
|
coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */
|
||||||
coding_OTNS_IMA, /* Omikron The Nomad Soul IMA ADPCM */
|
coding_QD_IMA,
|
||||||
coding_WV6_IMA, /* Gorilla Systems WV6 4-bit IMA ADPCM */
|
coding_WV6_IMA, /* Gorilla Systems WV6 4-bit IMA ADPCM */
|
||||||
coding_ALP_IMA, /* High Voltage ALP 4-bit IMA ADPCM */
|
coding_ALP_IMA, /* High Voltage ALP 4-bit IMA ADPCM */
|
||||||
coding_FFTA2_IMA, /* Final Fantasy Tactics A2 4-bit IMA ADPCM */
|
coding_FFTA2_IMA, /* Final Fantasy Tactics A2 4-bit IMA ADPCM */
|
||||||
@ -558,8 +558,8 @@ typedef enum {
|
|||||||
meta_PS2_WMUS, /* The Warriors (PS2) */
|
meta_PS2_WMUS, /* The Warriors (PS2) */
|
||||||
meta_HYPERSCAN_KVAG, /* Hyperscan KVAG/BVG */
|
meta_HYPERSCAN_KVAG, /* Hyperscan KVAG/BVG */
|
||||||
meta_IOS_PSND, /* Crash Bandicoot Nitro Kart 2 (iOS) */
|
meta_IOS_PSND, /* Crash Bandicoot Nitro Kart 2 (iOS) */
|
||||||
meta_BOS_ADP, /* ADP! (Balls of Steel, PC) */
|
meta_BOS_ADP,
|
||||||
meta_OTNS_ADP, /* Omikron: The Nomad Soul .adp (PC/DC) */
|
meta_QD_ADP,
|
||||||
meta_EB_SFX, /* Excitebots .sfx */
|
meta_EB_SFX, /* Excitebots .sfx */
|
||||||
meta_EB_SF0, /* Excitebots .sf0 */
|
meta_EB_SF0, /* Excitebots .sf0 */
|
||||||
meta_MTAF,
|
meta_MTAF,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user