mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
doc/util
This commit is contained in:
parent
71dcefc890
commit
5005788fb5
@ -18,7 +18,7 @@ static size_t deblock_io_read(STREAMFILE* sf, uint8_t* dest, off_t offset, size_
|
|||||||
|
|
||||||
/* re-start when previous offset (can't map logical<>physical offsets) */
|
/* re-start when previous offset (can't map logical<>physical offsets) */
|
||||||
if (data->logical_offset < 0 || offset < data->logical_offset) {
|
if (data->logical_offset < 0 || offset < data->logical_offset) {
|
||||||
;VGM_LOG("DEBLOCK: restart offset=%lx + %x, po=%lx, lo=%lx\n", offset, length, data->physical_offset, data->logical_offset);
|
//;VGM_LOG("DEBLOCK: restart offset=%lx + %x, po=%lx, lo=%lx\n", offset, length, data->physical_offset, data->logical_offset);
|
||||||
data->physical_offset = data->cfg.stream_start;
|
data->physical_offset = data->cfg.stream_start;
|
||||||
data->logical_offset = 0x00;
|
data->logical_offset = 0x00;
|
||||||
data->block_size = 0;
|
data->block_size = 0;
|
||||||
|
@ -1002,7 +1002,6 @@ STREAMFILE* reopen_streamfile(STREAMFILE* sf, size_t buffer_size) {
|
|||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
/* debug util, mainly for custom IO testing */
|
|
||||||
void dump_streamfile(STREAMFILE* sf, int num) {
|
void dump_streamfile(STREAMFILE* sf, int num) {
|
||||||
#ifdef VGM_DEBUG_OUTPUT
|
#ifdef VGM_DEBUG_OUTPUT
|
||||||
offv_t offset = 0;
|
offv_t offset = 0;
|
||||||
@ -1019,7 +1018,7 @@ void dump_streamfile(STREAMFILE* sf, int num) {
|
|||||||
if (!f) return;
|
if (!f) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VGM_LOG("dump streamfile: size %x\n", get_streamfile_size(sf));
|
VGM_LOG("dump streamfile %i: size %x\n", num, get_streamfile_size(sf));
|
||||||
while (offset < get_streamfile_size(sf)) {
|
while (offset < get_streamfile_size(sf)) {
|
||||||
uint8_t buf[0x8000];
|
uint8_t buf[0x8000];
|
||||||
size_t bytes;
|
size_t bytes;
|
||||||
@ -1032,8 +1031,9 @@ void dump_streamfile(STREAMFILE* sf, int num) {
|
|||||||
|
|
||||||
if (f)
|
if (f)
|
||||||
fwrite(buf, sizeof(uint8_t), bytes, f);
|
fwrite(buf, sizeof(uint8_t), bytes, f);
|
||||||
else
|
else if (num == -1)
|
||||||
VGM_LOGB(buf, bytes, 0);
|
VGM_LOGB(buf, bytes, 0);
|
||||||
|
//else: don't do anything (read test)
|
||||||
offset += bytes;
|
offset += bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ static inline size_t get_streamfile_size(STREAMFILE* sf) {
|
|||||||
return sf->get_size(sf);
|
return sf->get_size(sf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* debug util, mainly for custom IO testing (num = writes file N, -1 = printfs, -2 = only reads) */
|
||||||
void dump_streamfile(STREAMFILE* sf, int num);
|
void dump_streamfile(STREAMFILE* sf, int num);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user