cleanup: rename ALP_IMA to HV_IMA

This commit is contained in:
bnnm 2022-05-15 12:12:11 +02:00
parent e83d776385
commit 0dc64cdd8b
6 changed files with 53 additions and 53 deletions

View File

@ -21,7 +21,7 @@ void decode_3ds_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspaci
void decode_snds_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel); void decode_snds_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
void decode_otns_ima(VGMSTREAM* vgmstream, VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel); void decode_otns_ima(VGMSTREAM* vgmstream, VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel);
void decode_wv6_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do); void decode_wv6_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_alp_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do); void decode_hv_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_ffta2_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do); void decode_ffta2_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_blitz_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do); void decode_blitz_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
void decode_mtf_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel, int is_stereo); void decode_mtf_ima(VGMSTREAMCHANNEL* stream, sample_t* outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do, int channel, int is_stereo);

View File

@ -190,8 +190,8 @@ static void wv6_ima_expand_nibble(VGMSTREAMCHANNEL * stream, off_t byte_offset,
if (*step_index > 88) *step_index=88; if (*step_index > 88) *step_index=88;
} }
/* Lego Racers (PC) .TUN variation, reverse engineered from the .exe */ /* High Voltage variation, reverse engineered from .exes [Lego Racers (PC), NBA Hangtime (PC)] */
static void alp_ima_expand_nibble(VGMSTREAMCHANNEL * stream, off_t byte_offset, int nibble_shift, int32_t * hist1, int32_t * step_index) { static void hv_ima_expand_nibble(VGMSTREAMCHANNEL * stream, off_t byte_offset, int nibble_shift, int32_t * hist1, int32_t * step_index) {
int sample_nibble, sample_decoded, step, delta; int sample_nibble, sample_decoded, step, delta;
sample_nibble = (read_8bit(byte_offset,stream->streamfile) >> nibble_shift)&0xf; sample_nibble = (read_8bit(byte_offset,stream->streamfile) >> nibble_shift)&0xf;
@ -489,8 +489,8 @@ void decode_wv6_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspa
stream->adpcm_step_index = step_index; stream->adpcm_step_index = step_index;
} }
/* ALT IMA, DVI IMA with custom nibble expand */ /* High Voltage's DVI IMA with simplified nibble expand */
void decode_alp_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) { void decode_hv_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do) {
int i, sample_count; int i, sample_count;
int32_t hist1 = stream->adpcm_history1_32; int32_t hist1 = stream->adpcm_history1_32;
int step_index = stream->adpcm_step_index; int step_index = stream->adpcm_step_index;
@ -503,7 +503,7 @@ void decode_alp_ima(VGMSTREAMCHANNEL * stream, sample_t * outbuf, int channelspa
off_t byte_offset = stream->offset + i/2; off_t byte_offset = stream->offset + i/2;
int nibble_shift = (i&1?0:4); //high nibble first int nibble_shift = (i&1?0:4); //high nibble first
alp_ima_expand_nibble(stream, byte_offset,nibble_shift, &hist1, &step_index); hv_ima_expand_nibble(stream, byte_offset,nibble_shift, &hist1, &step_index);
outbuf[sample_count] = (short)(hist1); outbuf[sample_count] = (short)(hist1);
} }

View File

@ -412,7 +412,7 @@ int get_vgmstream_samples_per_frame(VGMSTREAM* vgmstream) {
case coding_DVI_IMA_int: case coding_DVI_IMA_int:
case coding_3DS_IMA: case coding_3DS_IMA:
case coding_WV6_IMA: case coding_WV6_IMA:
case coding_ALP_IMA: case coding_HV_IMA:
case coding_FFTA2_IMA: case coding_FFTA2_IMA:
case coding_BLITZ_IMA: case coding_BLITZ_IMA:
case coding_PCFX: case coding_PCFX:
@ -622,7 +622,7 @@ int get_vgmstream_frame_size(VGMSTREAM* vgmstream) {
case coding_DVI_IMA_int: case coding_DVI_IMA_int:
case coding_3DS_IMA: case coding_3DS_IMA:
case coding_WV6_IMA: case coding_WV6_IMA:
case coding_ALP_IMA: case coding_HV_IMA:
case coding_FFTA2_IMA: case coding_FFTA2_IMA:
case coding_BLITZ_IMA: case coding_BLITZ_IMA:
case coding_PCFX: case coding_PCFX:
@ -1163,9 +1163,9 @@ void decode_vgmstream(VGMSTREAM* vgmstream, int samples_written, int samples_to_
vgmstream->channels, vgmstream->samples_into_block, samples_to_do); vgmstream->channels, vgmstream->samples_into_block, samples_to_do);
} }
break; break;
case coding_ALP_IMA: case coding_HV_IMA:
for (ch = 0; ch < vgmstream->channels; ch++) { for (ch = 0; ch < vgmstream->channels; ch++) {
decode_alp_ima(&vgmstream->ch[ch], buffer+ch, decode_hv_ima(&vgmstream->ch[ch], buffer+ch,
vgmstream->channels, vgmstream->samples_into_block, samples_to_do); vgmstream->channels, vgmstream->samples_into_block, samples_to_do);
} }
break; break;

View File

@ -779,7 +779,7 @@ static const coding_info coding_info_list[] = {
{coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"}, {coding_SNDS_IMA, "Heavy Iron .snds 4-bit IMA ADPCM"},
{coding_QD_IMA, "Quantic Dream 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_HV_IMA, "High Voltage 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"},
{coding_BLITZ_IMA, "Blitz Games 4-bit IMA ADPCM"}, {coding_BLITZ_IMA, "Blitz Games 4-bit IMA ADPCM"},
{coding_MTF_IMA, "MT Framework 4-bit IMA ADPCM"}, {coding_MTF_IMA, "MT Framework 4-bit IMA ADPCM"},

View File

@ -1,41 +1,41 @@
#include "meta.h" #include "meta.h"
#include "../coding/coding.h" #include "../coding/coding.h"
/* ALP - from LEGO Racers (PC) */ /* ALP - from LEGO Racers (PC) */
VGMSTREAM * init_vgmstream_tun(STREAMFILE *streamFile) { VGMSTREAM* init_vgmstream_tun(STREAMFILE* sf) {
VGMSTREAM * vgmstream = NULL; VGMSTREAM* vgmstream = NULL;
off_t start_offset; off_t start_offset;
int loop_flag, channel_count; int loop_flag, channels;
/* checks */ /* checks */
if ( !check_extensions(streamFile,"tun") ) if (!is_id32be(0x00,sf, "ALP "))
goto fail; goto fail;
if (read_32bitBE(0x00,streamFile) != 0x414C5020) /* "ALP " */ if (!check_extensions(sf,"tun"))
goto fail; goto fail;
/* also "ADPCM" at 0x08 */
channel_count = 2; /* probably at 0x0F */
loop_flag = 0; channels = 2; /* probably at 0x0F */
start_offset = 0x10; loop_flag = 0;
/* also "ADPCM" at 0x08 */ 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;
vgmstream->channels = channel_count; vgmstream->meta_type = meta_TUN;
vgmstream->sample_rate = 22050; vgmstream->channels = channels;
vgmstream->num_samples = ima_bytes_to_samples(get_streamfile_size(streamFile) - 0x10, channel_count); vgmstream->sample_rate = 22050;
vgmstream->num_samples = ima_bytes_to_samples(get_streamfile_size(sf) - 0x10, channels);
vgmstream->coding_type = coding_ALP_IMA;
vgmstream->layout_type = layout_interleave; vgmstream->coding_type = coding_HV_IMA;
vgmstream->interleave_block_size = 0x01; vgmstream->layout_type = layout_interleave;
vgmstream->meta_type = meta_TUN; vgmstream->interleave_block_size = 0x01;
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) ) if (!vgmstream_open_stream(vgmstream, sf, start_offset))
goto fail; goto fail;
return vgmstream; return vgmstream;
fail: fail:
if (vgmstream) close_vgmstream(vgmstream); if (vgmstream) close_vgmstream(vgmstream);
return NULL; return NULL;
} }

View File

@ -109,7 +109,7 @@ typedef enum {
coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */ coding_SNDS_IMA, /* Heavy Iron Studios .snds IMA ADPCM */
coding_QD_IMA, 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_HV_IMA, /* High Voltage 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 */
coding_BLITZ_IMA, /* Blitz Games 4-bit IMA ADPCM */ coding_BLITZ_IMA, /* Blitz Games 4-bit IMA ADPCM */