mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-20 20:41:08 +01:00
cleanup
This commit is contained in:
parent
61e82459b2
commit
f4fe1482c9
@ -110,7 +110,6 @@
|
||||
<ClInclude Include="meta\bar_streamfile.h" />
|
||||
<ClInclude Include="meta\bgw_streamfile.h" />
|
||||
<ClInclude Include="meta\bnsf_keys.h" />
|
||||
<ClInclude Include="meta\cri_utf.h" />
|
||||
<ClInclude Include="meta\deblock_streamfile.h" />
|
||||
<ClInclude Include="meta\ea_eaac_streamfile.h" />
|
||||
<ClInclude Include="meta\ea_eaac_opus_streamfile.h" />
|
||||
@ -172,6 +171,7 @@
|
||||
<ClInclude Include="coding\tac_decoder_lib_ops.h" />
|
||||
<ClInclude Include="layout\layout.h" />
|
||||
<ClInclude Include="util\chunks.h" />
|
||||
<ClInclude Include="util\cri_utf.h" />
|
||||
<ClInclude Include="util\endianness.h" />
|
||||
<ClInclude Include="util\log.h" />
|
||||
<ClInclude Include="util\m2_psb.h" />
|
||||
@ -340,7 +340,6 @@
|
||||
<ClCompile Include="meta\ck.c" />
|
||||
<ClCompile Include="meta\compresswave.c" />
|
||||
<ClCompile Include="meta\cpk.c" />
|
||||
<ClCompile Include="meta\cri_utf.c" />
|
||||
<ClCompile Include="meta\csb.c" />
|
||||
<ClCompile Include="meta\csmp.c" />
|
||||
<ClCompile Include="meta\cstr.c" />
|
||||
@ -731,6 +730,7 @@
|
||||
<ClCompile Include="layout\blocked_xa_aiff.c" />
|
||||
<ClCompile Include="layout\blocked_xvas.c" />
|
||||
<ClCompile Include="util\chunks.c" />
|
||||
<ClCompile Include="util\cri_utf.c" />
|
||||
<ClCompile Include="util\log.c" />
|
||||
<ClCompile Include="util\m2_psb.c" />
|
||||
<ClCompile Include="util\text_reader.c" />
|
||||
|
@ -95,9 +95,6 @@
|
||||
<ClInclude Include="meta\bnsf_keys.h">
|
||||
<Filter>meta\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="meta\cri_utf.h">
|
||||
<Filter>meta\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="meta\deblock_streamfile.h">
|
||||
<Filter>meta\Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -314,6 +311,9 @@
|
||||
<ClInclude Include="util\chunks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="util\cri_utf.h">
|
||||
<Filter>meta\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="util\endianness.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -490,9 +490,6 @@
|
||||
<ClCompile Include="meta\cpk.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\cri_utf.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\csb.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -1975,6 +1972,9 @@
|
||||
<ClCompile Include="util\chunks.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="util\cri_utf.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="util\log.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1,31 +1,32 @@
|
||||
#include "meta.h"
|
||||
#include "../layout/layout.h"
|
||||
#include "../coding/coding.h"
|
||||
#include "cri_utf.h"
|
||||
#include "../util/cri_utf.h"
|
||||
|
||||
|
||||
#define MAX_SEGMENTS 2 /* usually segment0=intro, segment1=loop/main */
|
||||
|
||||
/* AAX - segmented ADX [Bayonetta (PS3), Pandora's Tower (Wii), Catherine (X360), Binary Domain (PS3)] */
|
||||
VGMSTREAM * init_vgmstream_aax(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
int loop_flag = 0, channel_count = 0;
|
||||
VGMSTREAM* init_vgmstream_aax(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
int loop_flag = 0, channels = 0;
|
||||
int32_t sample_count, loop_start_sample = 0, loop_end_sample = 0;
|
||||
|
||||
segmented_layout_data *data = NULL;
|
||||
segmented_layout_data* data = NULL;
|
||||
int segment_count, loop_segment = 0, is_hca;
|
||||
off_t segment_offset[MAX_SEGMENTS];
|
||||
size_t segment_size[MAX_SEGMENTS];
|
||||
int i;
|
||||
utf_context *utf = NULL;
|
||||
utf_context* utf = NULL;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!is_id32be(0x00,sf, "@UTF"))
|
||||
goto fail;
|
||||
|
||||
/* .aax: often with extension (with either HCA or AAX tables)
|
||||
* (extensionless): sometimes without [PES 2013 (PC)] */
|
||||
if (!check_extensions(streamFile, "aax,"))
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x40555446) /* "@UTF" */
|
||||
if (!check_extensions(sf, "aax,"))
|
||||
goto fail;
|
||||
|
||||
/* .aax contains a simple UTF table, each row being a segment pointing to a CRI audio format */
|
||||
@ -35,7 +36,7 @@ VGMSTREAM * init_vgmstream_aax(STREAMFILE *streamFile) {
|
||||
uint32_t table_offset = 0x00;
|
||||
|
||||
|
||||
utf = utf_open(streamFile, table_offset, &rows, &name);
|
||||
utf = utf_open(sf, table_offset, &rows, &name);
|
||||
if (!utf) goto fail;
|
||||
|
||||
if (strcmp(name, "AAX") == 0)
|
||||
@ -74,7 +75,7 @@ VGMSTREAM * init_vgmstream_aax(STREAMFILE *streamFile) {
|
||||
|
||||
/* open each segment subfile */
|
||||
for (i = 0; i < segment_count; i++) {
|
||||
STREAMFILE* temp_sf = setup_subfile_streamfile(streamFile, segment_offset[i],segment_size[i], (is_hca ? "hca" : "adx"));
|
||||
STREAMFILE* temp_sf = setup_subfile_streamfile(sf, segment_offset[i],segment_size[i], (is_hca ? "hca" : "adx"));
|
||||
if (!temp_sf) goto fail;
|
||||
|
||||
data->segments[i] = is_hca ?
|
||||
@ -105,11 +106,11 @@ VGMSTREAM * init_vgmstream_aax(STREAMFILE *streamFile) {
|
||||
}
|
||||
}
|
||||
|
||||
channel_count = data->output_channels;
|
||||
channels = data->output_channels;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = data->segments[0]->sample_rate;
|
||||
@ -135,21 +136,22 @@ fail:
|
||||
|
||||
|
||||
/* CRI's UTF wrapper around DSP [Sonic Colors sfx (Wii), NiGHTS: Journey of Dreams sfx (Wii)] */
|
||||
VGMSTREAM * init_vgmstream_utf_dsp(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
VGMSTREAM* init_vgmstream_utf_dsp(STREAMFILE* sf) {
|
||||
VGMSTREAM* vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
uint8_t loop_flag = 0, channel_count;
|
||||
uint8_t loop_flag = 0, channels;
|
||||
uint32_t sample_rate, num_samples, loop_start, loop_end, interleave;
|
||||
uint32_t data_offset, data_size, header_offset, header_size;
|
||||
utf_context *utf = NULL;
|
||||
utf_context* utf = NULL;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!is_id32be(0x00,sf, "@UTF"))
|
||||
goto fail;
|
||||
|
||||
/* .aax: assumed
|
||||
* (extensionless): extracted names inside csb/cpk often don't have extensions */
|
||||
if (!check_extensions(streamFile, "aax,"))
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x40555446) /* "@UTF" */
|
||||
if (!check_extensions(sf, "aax,"))
|
||||
goto fail;
|
||||
|
||||
/* .aax contains a simple UTF table with one row and various columns being header info */
|
||||
@ -159,7 +161,7 @@ VGMSTREAM * init_vgmstream_utf_dsp(STREAMFILE *streamFile) {
|
||||
uint32_t table_offset = 0x00;
|
||||
|
||||
|
||||
utf = utf_open(streamFile, table_offset, &rows, &name);
|
||||
utf = utf_open(sf, table_offset, &rows, &name);
|
||||
if (!utf) goto fail;
|
||||
|
||||
if (strcmp(name, "ADPCM_WII") != 0)
|
||||
@ -172,7 +174,7 @@ VGMSTREAM * init_vgmstream_utf_dsp(STREAMFILE *streamFile) {
|
||||
goto fail;
|
||||
if (!utf_query_u32(utf, 0, "nsmpl", &num_samples))
|
||||
goto fail;
|
||||
if (!utf_query_u8(utf, 0, "nch", &channel_count))
|
||||
if (!utf_query_u8(utf, 0, "nch", &channels))
|
||||
goto fail;
|
||||
if (!utf_query_u8(utf, 0, "lpflg", &loop_flag)) /* full loops */
|
||||
goto fail;
|
||||
@ -182,21 +184,21 @@ VGMSTREAM * init_vgmstream_utf_dsp(STREAMFILE *streamFile) {
|
||||
if (!utf_query_data(utf, 0, "header", &header_offset, &header_size))
|
||||
goto fail;
|
||||
|
||||
if (channel_count < 1 || channel_count > 2)
|
||||
if (channels < 1 || channels > 2)
|
||||
goto fail;
|
||||
if (header_size != channel_count * 0x60)
|
||||
if (header_size != channels * 0x60)
|
||||
goto fail;
|
||||
|
||||
start_offset = data_offset;
|
||||
interleave = (data_size+7) / 8 * 8 / channel_count;
|
||||
interleave = (data_size+7) / 8 * 8 / channels;
|
||||
|
||||
loop_start = read_32bitBE(header_offset + 0x10, streamFile);
|
||||
loop_end = read_32bitBE(header_offset + 0x14, streamFile);
|
||||
loop_start = read_32bitBE(header_offset + 0x10, sf);
|
||||
loop_end = read_32bitBE(header_offset + 0x14, sf);
|
||||
}
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count, loop_flag);
|
||||
vgmstream = allocate_vgmstream(channels, loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
@ -209,9 +211,9 @@ VGMSTREAM * init_vgmstream_utf_dsp(STREAMFILE *streamFile) {
|
||||
vgmstream->interleave_block_size = interleave;
|
||||
vgmstream->meta_type = meta_UTF_DSP;
|
||||
|
||||
dsp_read_coefs_be(vgmstream, streamFile, header_offset+0x1c, 0x60);
|
||||
dsp_read_coefs_be(vgmstream, sf, header_offset+0x1c, 0x60);
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
|
||||
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
#include "cri_utf.h"
|
||||
#include "../util/cri_utf.h"
|
||||
|
||||
|
||||
/* ACB (Atom Cue sheet Binary) - CRI container of memory audio, often together with a .awb wave bank */
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
#include "cri_utf.h"
|
||||
#include "../util/cri_utf.h"
|
||||
|
||||
|
||||
typedef enum { HCA, CWAV, ADX } cpk_type_t;
|
||||
@ -26,10 +26,11 @@ VGMSTREAM* init_vgmstream_cpk_memory(STREAMFILE* sf, STREAMFILE* sf_acb) {
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(sf, "awb"))
|
||||
goto fail;
|
||||
if (!is_id32be(0x00,sf, "CPK "))
|
||||
goto fail;
|
||||
if (!check_extensions(sf, "awb"))
|
||||
goto fail;
|
||||
|
||||
if (!is_id32be(0x10,sf, "@UTF"))
|
||||
goto fail;
|
||||
/* 04: 0xFF? */
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
#include "cri_utf.h"
|
||||
#include "../util/cri_utf.h"
|
||||
|
||||
|
||||
/* CSB (Cue Sheet Binary?) - CRI container of memory audio, often together with a .cpk wave bank */
|
||||
@ -9,8 +9,8 @@ VGMSTREAM* init_vgmstream_csb(STREAMFILE* sf) {
|
||||
STREAMFILE* temp_sf = NULL;
|
||||
off_t subfile_offset;
|
||||
size_t subfile_size;
|
||||
utf_context *utf = NULL;
|
||||
utf_context *utf_sdl = NULL;
|
||||
utf_context* utf = NULL;
|
||||
utf_context* utf_sdl = NULL;
|
||||
int total_subsongs, target_subsong = sf->stream_index;
|
||||
uint8_t fmt = 0;
|
||||
const char* stream_name = NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "cri_utf.h"
|
||||
#include "../util/log.h"
|
||||
#include "log.h"
|
||||
|
||||
#define UTF_MAX_SCHEMA_SIZE 0x8000 /* arbitrary max */
|
||||
#define COLUMN_BITMASK_FLAG 0xf0
|
Loading…
x
Reference in New Issue
Block a user