mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
Fix ds2 samples
This commit is contained in:
parent
ac4aae7fce
commit
ce07e6af9e
@ -223,7 +223,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
|||||||
if (dspm->fix_looping && vgmstream->loop_end_sample > vgmstream->num_samples)
|
if (dspm->fix_looping && vgmstream->loop_end_sample > vgmstream->num_samples)
|
||||||
vgmstream->loop_end_sample = vgmstream->num_samples;
|
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||||
|
|
||||||
if (dspm->single_header) {
|
if (dspm->single_header == 2) { /* double the samples */
|
||||||
vgmstream->num_samples /= dspm->channel_count;
|
vgmstream->num_samples /= dspm->channel_count;
|
||||||
vgmstream->loop_start_sample /= dspm->channel_count;
|
vgmstream->loop_start_sample /= dspm->channel_count;
|
||||||
vgmstream->loop_end_sample /= dspm->channel_count;
|
vgmstream->loop_end_sample /= dspm->channel_count;
|
||||||
@ -517,14 +517,13 @@ VGMSTREAM * init_vgmstream_ngc_mpdsp(STREAMFILE *streamFile) {
|
|||||||
if (!check_extensions(streamFile, "mpdsp"))
|
if (!check_extensions(streamFile, "mpdsp"))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/* at 0x48 is extra data that could help differenciating these DSPs, but other games
|
/* at 0x48 is extra data that could help differenciating these DSPs, but seems like
|
||||||
* put similar stuff there, needs more checks (ex. Battallion Wars, Army Men) */
|
* memory garbage created by the encoder that other games also have */
|
||||||
//0x00005300 60A94000 64FF1200 00000000 00000000 00000000
|
|
||||||
/* 0x02(2): sample rate, 0x08+: channel sizes/loop offsets? */
|
/* 0x02(2): sample rate, 0x08+: channel sizes/loop offsets? */
|
||||||
|
|
||||||
dspm.channel_count = 2;
|
dspm.channel_count = 2;
|
||||||
dspm.max_channels = 2;
|
dspm.max_channels = 2;
|
||||||
dspm.single_header = 1;
|
dspm.single_header = 2;
|
||||||
|
|
||||||
dspm.header_offset = 0x00;
|
dspm.header_offset = 0x00;
|
||||||
dspm.header_spacing = 0x00; /* same header for both channels */
|
dspm.header_spacing = 0x00; /* same header for both channels */
|
||||||
@ -1204,7 +1203,7 @@ VGMSTREAM * init_vgmstream_dsp_ds2(STREAMFILE *streamFile) {
|
|||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
/* .ds2: real extension, dsp: fake/renamed */
|
/* .ds2: real extension, dsp: fake/renamed */
|
||||||
if (!check_extensions(streamFile, "ds2"))
|
if (!check_extensions(streamFile, "ds2,dsp"))
|
||||||
goto fail;
|
goto fail;
|
||||||
if (!(read_32bitBE(0x50,streamFile) == 0 &&
|
if (!(read_32bitBE(0x50,streamFile) == 0 &&
|
||||||
read_32bitBE(0x54,streamFile) == 0 &&
|
read_32bitBE(0x54,streamFile) == 0 &&
|
||||||
@ -1213,8 +1212,7 @@ VGMSTREAM * init_vgmstream_dsp_ds2(STREAMFILE *streamFile) {
|
|||||||
goto fail;
|
goto fail;
|
||||||
file_size = get_streamfile_size(streamFile);
|
file_size = get_streamfile_size(streamFile);
|
||||||
channel_offset = read_32bitBE(0x5c,streamFile); /* absolute offset to 2nd channel */
|
channel_offset = read_32bitBE(0x5c,streamFile); /* absolute offset to 2nd channel */
|
||||||
/* just to make sure */
|
if (channel_offset < file_size / 2 || channel_offset > file_size) /* just to make sure */
|
||||||
if (channel_offset < file_size / 2 || channel_offset > file_size)
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
dspm.channel_count = 2;
|
dspm.channel_count = 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user