mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-31 04:13:47 +01:00
pdt fixed (mario party gamecube)
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@472 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
e6c10765ae
commit
863e8f3b58
@ -1,7 +1,7 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* PDT (Mario Party 6, possibly other MP games) */
|
||||
/* PDT (Mario Party) */
|
||||
VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
@ -20,8 +20,8 @@ VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
|
||||
goto fail;
|
||||
#endif
|
||||
|
||||
loop_flag = 1;
|
||||
channel_count = read_32bitBE(0x0C,streamFile);
|
||||
loop_flag = (read_32bitBE(0x0C,streamFile)!=2); /* not sure, but it seems unlooped = 2 */
|
||||
channel_count = 2; /* read_32bitBE(0x0C,streamFile); */
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
@ -32,14 +32,19 @@ VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x04,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x08,streamFile);
|
||||
vgmstream->num_samples = read_32bitBE(0x08,streamFile)*14/8/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x08,streamFile);
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x0C,streamFile)*14/8/channel_count;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x08,streamFile)*14/8/channel_count;
|
||||
}
|
||||
|
||||
if (vgmstream->channels == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else {
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
vgmstream->interleave_block_size = (get_streamfile_size(streamFile)-start_offset)/2;
|
||||
}
|
||||
|
||||
vgmstream->meta_type = meta_NGC_PDT;
|
||||
|
||||
|
||||
@ -48,7 +53,7 @@ VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE *streamFile) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x20+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
if (vgmstream->channels == 2) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x40+i*2,streamFile);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user