mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-11 22:44:02 +00:00
MusyX 1 compatibility fixes, Rogue Squadron N64 decoding confirmed
This commit is contained in:
@@ -10,7 +10,6 @@ namespace amuse
|
||||
class AudioGroupData
|
||||
{
|
||||
friend class Engine;
|
||||
friend class AudioGroupProject;
|
||||
protected:
|
||||
unsigned char* m_proj;
|
||||
unsigned char* m_pool;
|
||||
@@ -41,6 +40,8 @@ public:
|
||||
{
|
||||
return m_proj != nullptr && m_pool != nullptr && m_sdir != nullptr && m_samp != nullptr;
|
||||
}
|
||||
|
||||
DataFormat getDataFormat() const {return m_fmt;}
|
||||
};
|
||||
|
||||
/** A buffer-owning version of AudioGroupData */
|
||||
|
||||
@@ -26,21 +26,29 @@ public:
|
||||
uint32_t m_adpcmParmOffset;
|
||||
void swapBig();
|
||||
};
|
||||
struct ADPCMParms
|
||||
union ADPCMParms
|
||||
{
|
||||
uint16_t m_bytesPerFrame;
|
||||
uint8_t m_ps;
|
||||
uint8_t m_lps;
|
||||
int16_t m_hist2;
|
||||
int16_t m_hist1;
|
||||
int16_t m_coefs[8][2];
|
||||
void swapBig();
|
||||
struct DSPParms
|
||||
{
|
||||
uint16_t m_bytesPerFrame;
|
||||
uint8_t m_ps;
|
||||
uint8_t m_lps;
|
||||
int16_t m_hist2;
|
||||
int16_t m_hist1;
|
||||
int16_t m_coefs[8][2];
|
||||
} dsp;
|
||||
struct VADPCMParms
|
||||
{
|
||||
int16_t m_coefs[8][2][8];
|
||||
} vadpcm;
|
||||
void swapBigDSP();
|
||||
void swapBigVADPCM();
|
||||
};
|
||||
private:
|
||||
std::unordered_map<uint16_t, std::pair<Entry, ADPCMParms>> m_entries;
|
||||
public:
|
||||
AudioGroupSampleDirectory(const unsigned char* data, GCNDataTag);
|
||||
AudioGroupSampleDirectory(const unsigned char* data, N64DataTag);
|
||||
AudioGroupSampleDirectory(const unsigned char* data, const unsigned char* sampData, N64DataTag);
|
||||
AudioGroupSampleDirectory(const unsigned char* data, PCDataTag);
|
||||
};
|
||||
|
||||
|
||||
@@ -48,10 +48,11 @@ class Voice : public Entity
|
||||
|
||||
enum class SampleFormat : uint8_t
|
||||
{
|
||||
DSP,
|
||||
IMA,
|
||||
PCM,
|
||||
N64
|
||||
DSP, /**< GCN DSP-ucode ADPCM (very common for GameCube games) */
|
||||
IMA, /**< IMA-ADPCM (rarely used within MusyX itself) */
|
||||
PCM, /**< Big-endian PCM found in MusyX2 demo GM instruments */
|
||||
N64, /**< 2-stage VADPCM coding with SAMP-embedded codebooks */
|
||||
PCM_PC /**< Little-endian PCM found in PC Rogue Squadron (actually enum 0 which conflicts with DSP-ADPCM) */
|
||||
};
|
||||
const Sample* m_curSample = nullptr; /**< Current sample entry playing */
|
||||
const unsigned char* m_curSampleData = nullptr; /**< Current sample data playing */
|
||||
|
||||
Reference in New Issue
Block a user