mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 23:01:56 -04:00
d3cc739e43
This attempts to get into master whatever work was done in this PR / it's earlier PR https://github.com/open-goal/jak-project/pull/3965 I don't want this work to be lost / floating around in massive PRs. However the changes are: - switch to ntsc_v1 instead of PAL as the development target, as we have done for all other games - remove most of the copied-from-jak2/3 changes as they need to be confirmed during the decompilation process not just assumed - avoids committing any changes to `game/kernel/common` as it was not clear to me if these were changes made in jak x's kernel that were not properly broken out into it's own functions. We don't want to accidentally introduce bugs into jak1-3's kernel code. - in other words, if the change in the kernel only happens in jak x...it should likely be specific to jak x's kernel, not common. --------- Co-authored-by: VodBox <dillon@vodbox.io> Co-authored-by: yodah <greenboyyodah@gmail.com>
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "common/common_types.h"
|
|
#include "common/util/BinaryReader.h"
|
|
#include "common/util/FileUtil.h"
|
|
|
|
// The header data for a simple wave file
|
|
struct WaveFileHeader {
|
|
// wave file header
|
|
char chunk_id[4];
|
|
s32 chunk_size;
|
|
char format[4];
|
|
|
|
// format chunk
|
|
char subchunk1_id[4];
|
|
s32 subchunk1_size;
|
|
s16 aud_format;
|
|
s16 num_channels;
|
|
s32 sample_rate;
|
|
s32 byte_rate;
|
|
s16 block_align;
|
|
s16 bits_per_sample;
|
|
|
|
// data chunk
|
|
char subchunk2_id[4];
|
|
s32 subchunk2_size;
|
|
};
|
|
|
|
void write_wave_file(const std::vector<s16>& left_samples,
|
|
const std::vector<s16>& right_samples,
|
|
s32 sample_rate,
|
|
const fs::path& name);
|
|
|
|
std::pair<std::vector<s16>, std::vector<s16>> decode_adpcm(BinaryReader& reader,
|
|
const bool mono,
|
|
const u32 version);
|
|
|
|
std::vector<u8> encode_adpcm(const std::vector<s16>& samples);
|