2010-12-06 23:22:06 +01:00
|
|
|
#include "layout.h"
|
|
|
|
#include "../vgmstream.h"
|
|
|
|
|
2018-04-13 16:40:50 +02:00
|
|
|
/* blocks with mini header (0x48124812 + unknown + block data + block size) */
|
2018-03-29 19:00:04 +02:00
|
|
|
void block_update_ps2_iab(off_t block_offset, VGMSTREAM * vgmstream) {
|
2018-04-13 16:40:50 +02:00
|
|
|
STREAMFILE* streamFile = vgmstream->ch[0].streamfile;
|
2010-12-06 23:22:06 +01:00
|
|
|
int i;
|
2018-04-13 16:40:50 +02:00
|
|
|
size_t block_size, channel_size;
|
2010-12-06 23:22:06 +01:00
|
|
|
|
2018-04-13 16:40:50 +02:00
|
|
|
channel_size = read_32bitLE(block_offset+0x08,streamFile) / vgmstream->channels;
|
|
|
|
block_size = read_32bitLE(block_offset+0x0c,streamFile);
|
|
|
|
if (!block_size)
|
|
|
|
block_size = 0x10; /* happens on last block */
|
2010-12-06 23:22:06 +01:00
|
|
|
|
2018-04-13 16:40:50 +02:00
|
|
|
vgmstream->current_block_size = channel_size;
|
|
|
|
vgmstream->current_block_offset = block_offset;
|
|
|
|
vgmstream->next_block_offset = block_offset + block_size;
|
|
|
|
|
|
|
|
for (i = 0; i < vgmstream->channels; i++) {
|
|
|
|
vgmstream->ch[i].offset = block_offset + 0x10 + channel_size*i;
|
2010-12-06 23:22:06 +01:00
|
|
|
}
|
|
|
|
}
|