mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-31 20:25:23 +01:00
RWS 0x80D: DSP-ADPCM initial sample history data
This commit is contained in:
parent
abbd226b36
commit
268c24efc6
@ -40,6 +40,7 @@ typedef struct {
|
|||||||
size_t block_layers_size;
|
size_t block_layers_size;
|
||||||
|
|
||||||
off_t coefs_offset;
|
off_t coefs_offset;
|
||||||
|
off_t hist_offset;
|
||||||
|
|
||||||
char readable_name[STREAM_NAME_SIZE];
|
char readable_name[STREAM_NAME_SIZE];
|
||||||
} rws_header;
|
} rws_header;
|
||||||
@ -200,7 +201,7 @@ VGMSTREAM* init_vgmstream_rws(STREAMFILE* sf) {
|
|||||||
for (i = 0; i < rws.total_layers; i++) {
|
for (i = 0; i < rws.total_layers; i++) {
|
||||||
uint32_t layer_codec = 0;
|
uint32_t layer_codec = 0;
|
||||||
if (i+1 == rws.target_layer) {
|
if (i+1 == rws.target_layer) {
|
||||||
rws.sample_rate = read_u32(offset + 0x00, sf);
|
rws.sample_rate = read_u32(offset + 0x00, sf);
|
||||||
/* 0x04: config? */
|
/* 0x04: config? */
|
||||||
//rws.layer_size = read_u32(offset + 0x08, sf); /* same or close to usable size */
|
//rws.layer_size = read_u32(offset + 0x08, sf); /* same or close to usable size */
|
||||||
/* 0x0c: bits per sample */
|
/* 0x0c: bits per sample */
|
||||||
@ -210,7 +211,7 @@ VGMSTREAM* init_vgmstream_rws(STREAMFILE* sf) {
|
|||||||
/* 0x18: null or some size? */
|
/* 0x18: null or some size? */
|
||||||
rws.codec = read_u32(offset + 0x1c, sf); /* 128b uuid (32b-16b-16b-8b*8) but first 32b is enough */
|
rws.codec = read_u32(offset + 0x1c, sf); /* 128b uuid (32b-16b-16b-8b*8) but first 32b is enough */
|
||||||
}
|
}
|
||||||
layer_codec = read_u32(offset + 0x1c, sf);
|
layer_codec = read_u32(offset + 0x1c, sf);
|
||||||
offset += 0x2c;
|
offset += 0x2c;
|
||||||
|
|
||||||
/* DSP has an extra field per layer */
|
/* DSP has an extra field per layer */
|
||||||
@ -219,6 +220,7 @@ VGMSTREAM* init_vgmstream_rws(STREAMFILE* sf) {
|
|||||||
/* 0x04: approx size/loop related? (can be 0) */
|
/* 0x04: approx size/loop related? (can be 0) */
|
||||||
if (i+1 == rws.target_layer) {
|
if (i+1 == rws.target_layer) {
|
||||||
rws.coefs_offset = offset + 0x1c;
|
rws.coefs_offset = offset + 0x1c;
|
||||||
|
rws.hist_offset = offset + 0x40;
|
||||||
}
|
}
|
||||||
offset += 0x60;
|
offset += 0x60;
|
||||||
}
|
}
|
||||||
@ -322,12 +324,14 @@ VGMSTREAM* init_vgmstream_rws(STREAMFILE* sf) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xF86215B0: /* {F86215B0,31D5,4C29,BD,37,CD,BF,9B,D1,0C,53} DSP GC/Wii */
|
case 0xF86215B0: /* {F86215B0,31D5,4C29,BD,37,CD,BF,9B,D1,0C,53} DSP GC/Wii */
|
||||||
/* Burnout 2 (GC), Alice in Wonderland (Wii) */
|
/* Burnout 2 (GC), Alice in Wonderland (Wii), Call of Duty: Finest Hour (GC) */
|
||||||
vgmstream->coding_type = coding_NGC_DSP;
|
vgmstream->coding_type = coding_NGC_DSP;
|
||||||
vgmstream->interleave_block_size = rws.block_size / 2;
|
vgmstream->interleave_block_size = rws.block_size / 2;
|
||||||
|
|
||||||
/* get coefs (all channels share them; also seem fixed for all RWS) */
|
/* get coefs (all channels share them; also seem fixed for all RWS) */
|
||||||
dsp_read_coefs_be(vgmstream, sf, rws.coefs_offset, 0);
|
dsp_read_coefs_be(vgmstream, sf, rws.coefs_offset, 0);
|
||||||
|
/* get initial sample history data (rarely used / often empty) */
|
||||||
|
dsp_read_hist_be(vgmstream, sf, rws.hist_offset, 0);
|
||||||
|
|
||||||
vgmstream->num_samples = dsp_bytes_to_samples(stream_size, rws.channels);
|
vgmstream->num_samples = dsp_bytes_to_samples(stream_size, rws.channels);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user