2020-05-24 15:50:41 +02:00
|
|
|
#include "meta.h"
|
|
|
|
#include "../coding/coding.h"
|
|
|
|
#include "mups_streamfile.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* MUPS - from Watermelon/HUCARD games (same programmer) [Pier Solar and the Great Architects (PC), Ghost Blade HD (PC/Switch)] */
|
|
|
|
VGMSTREAM* init_vgmstream_mups(STREAMFILE* sf) {
|
|
|
|
VGMSTREAM* vgmstream = NULL;
|
2021-09-27 00:10:28 +02:00
|
|
|
STREAMFILE* temp_sf = NULL;
|
2020-05-24 15:50:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* checks */
|
2021-09-27 00:10:28 +02:00
|
|
|
if (!is_id32be(0x00,sf, "MUPS"))
|
|
|
|
goto fail;
|
|
|
|
|
2020-05-24 15:50:41 +02:00
|
|
|
/* mups: header id?
|
|
|
|
* (extensionless): default? */
|
|
|
|
if (!check_extensions(sf, "mups,"))
|
|
|
|
goto fail;
|
|
|
|
|
2021-09-27 00:10:28 +02:00
|
|
|
if (!is_id32be(0x08,sf, "PssH"))
|
2020-05-24 15:50:41 +02:00
|
|
|
goto fail;
|
|
|
|
|
|
|
|
/* just an Ogg with changed OggS/vorbis words (see streamfile) */
|
|
|
|
temp_sf = setup_mups_streamfile(sf, 0x08);
|
|
|
|
if (!temp_sf) goto fail;
|
|
|
|
|
|
|
|
vgmstream = init_vgmstream_ogg_vorbis(temp_sf);
|
|
|
|
if (!vgmstream) goto fail;
|
|
|
|
|
|
|
|
close_streamfile(temp_sf);
|
|
|
|
|
|
|
|
return vgmstream;
|
|
|
|
|
|
|
|
fail:
|
|
|
|
close_streamfile(temp_sf);
|
|
|
|
close_vgmstream(vgmstream);
|
|
|
|
return NULL;
|
|
|
|
}
|