mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
HLE DSP: Stub AAC
This commit is contained in:
parent
fb8130a868
commit
0490c6753f
4 changed files with 119 additions and 3 deletions
71
include/audio/aac.hpp
Normal file
71
include/audio/aac.hpp
Normal file
|
@ -0,0 +1,71 @@
|
|||
#pragma once
|
||||
#include <array>
|
||||
#include <type_traits>
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "swap.hpp"
|
||||
|
||||
namespace Audio::AAC {
|
||||
namespace ResultCode {
|
||||
enum : u32 {
|
||||
Success = 0,
|
||||
};
|
||||
}
|
||||
|
||||
// Enum values from Citra and struct definitions based off Citra
|
||||
namespace Command {
|
||||
enum : u16 {
|
||||
Init = 0, // Initialize encoder/decoder
|
||||
EncodeDecode = 1, // Encode/Decode AAC
|
||||
Shutdown = 2, // Shutdown encoder/decoder
|
||||
LoadState = 3,
|
||||
SaveState = 4,
|
||||
};
|
||||
}
|
||||
|
||||
namespace SampleRate {
|
||||
enum : u32 {
|
||||
Rate48000 = 0,
|
||||
Rate44100 = 1,
|
||||
Rate32000 = 2,
|
||||
Rate24000 = 3,
|
||||
Rate22050 = 4,
|
||||
Rate16000 = 5,
|
||||
Rate12000 = 6,
|
||||
Rate11025 = 7,
|
||||
Rate8000 = 8,
|
||||
};
|
||||
}
|
||||
|
||||
namespace Mode {
|
||||
enum : u16 {
|
||||
None = 0,
|
||||
Decode = 1,
|
||||
Encode = 2,
|
||||
};
|
||||
}
|
||||
|
||||
struct DecodeResponse {
|
||||
u32_le sampleRate = SampleRate::Rate48000;
|
||||
u32_le channelCount = 0;
|
||||
u32_le size = 0;
|
||||
u32_le unknown1 = 0;
|
||||
u32_le unknown2 = 0;
|
||||
u32_le sampleCount = 0;
|
||||
};
|
||||
|
||||
struct Message {
|
||||
u16_le mode = Mode::None; // Encode or decode AAC?
|
||||
u16_le command = Command::Init;
|
||||
u32_le resultCode = ResultCode::Success;
|
||||
|
||||
// Info on the AAC request
|
||||
union {
|
||||
std::array<u8, 24> commandData = {};
|
||||
DecodeResponse decodeResponse;
|
||||
};
|
||||
};
|
||||
|
||||
static_assert(sizeof(Message) == 32);
|
||||
static_assert(std::is_trivially_copyable<Message>());
|
||||
} // namespace Audio::AAC
|
|
@ -5,6 +5,7 @@
|
|||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
#include "audio/aac.hpp"
|
||||
#include "audio/dsp_core.hpp"
|
||||
#include "audio/dsp_shared_mem.hpp"
|
||||
#include "memory.hpp"
|
||||
|
@ -166,6 +167,7 @@ namespace Audio {
|
|||
}
|
||||
}
|
||||
|
||||
void handleAACRequest(const AAC::Message& request);
|
||||
void updateSourceConfig(Source& source, HLE::SourceConfiguration::Configuration& config, s16_le* adpcmCoefficients);
|
||||
void generateFrame(StereoFrame<s16>& frame);
|
||||
void generateFrame(DSPSource& source);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue