|
|
|
@ -5,6 +5,8 @@
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <boost/serialization/array.hpp>
|
|
|
|
|
#include <boost/serialization/shared_ptr.hpp>
|
|
|
|
|
#include "core/hle/kernel/mutex.h"
|
|
|
|
|
#include "core/hle/kernel/shared_memory.h"
|
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
@ -33,6 +35,15 @@ enum class LoopMode : u8 {
|
|
|
|
|
struct AdpcmState {
|
|
|
|
|
s16 predictor = 0;
|
|
|
|
|
u8 step_index = 0;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
template <class Archive>
|
|
|
|
|
void serialize(Archive& ar, const unsigned int)
|
|
|
|
|
{
|
|
|
|
|
ar & predictor;
|
|
|
|
|
ar & step_index;
|
|
|
|
|
}
|
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Channel {
|
|
|
|
@ -52,6 +63,29 @@ struct Channel {
|
|
|
|
|
LoopMode loop_mode = LoopMode::Manual;
|
|
|
|
|
Encoding encoding = Encoding::Pcm8;
|
|
|
|
|
u8 psg_duty = 0;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
template <class Archive>
|
|
|
|
|
void serialize(Archive& ar, const unsigned int)
|
|
|
|
|
{
|
|
|
|
|
ar & block1_address;
|
|
|
|
|
ar & block2_address;
|
|
|
|
|
ar & block1_size;
|
|
|
|
|
ar & block2_size;
|
|
|
|
|
ar & block1_adpcm_state;
|
|
|
|
|
ar & block2_adpcm_state;
|
|
|
|
|
ar & block2_adpcm_reload;
|
|
|
|
|
ar & left_channel_volume;
|
|
|
|
|
ar & right_channel_volume;
|
|
|
|
|
ar & left_capture_volume;
|
|
|
|
|
ar & right_capture_volume;
|
|
|
|
|
ar & sample_rate;
|
|
|
|
|
ar & linear_interpolation;
|
|
|
|
|
ar & loop_mode;
|
|
|
|
|
ar & encoding;
|
|
|
|
|
ar & psg_duty;
|
|
|
|
|
}
|
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class CSND_SND final : public ServiceFramework<CSND_SND> {
|
|
|
|
@ -222,9 +256,31 @@ private:
|
|
|
|
|
u32 type1_command_offset = 0;
|
|
|
|
|
|
|
|
|
|
u32 acquired_channel_mask = 0;
|
|
|
|
|
|
|
|
|
|
template <class Archive>
|
|
|
|
|
void serialize(Archive& ar, const unsigned int)
|
|
|
|
|
{
|
|
|
|
|
ar & mutex;
|
|
|
|
|
ar & shared_memory;
|
|
|
|
|
ar & capture_units;
|
|
|
|
|
ar & channels;
|
|
|
|
|
ar & master_state_offset;
|
|
|
|
|
ar & channel_state_offset;
|
|
|
|
|
ar & capture_state_offset;
|
|
|
|
|
ar & type1_command_offset;
|
|
|
|
|
ar & acquired_channel_mask;
|
|
|
|
|
}
|
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// Initializes the CSND_SND Service
|
|
|
|
|
void InstallInterfaces(Core::System& system);
|
|
|
|
|
|
|
|
|
|
} // namespace Service::CSND
|
|
|
|
|
|
|
|
|
|
BOOST_CLASS_EXPORT_KEY(Service::CSND::CSND_SND)
|
|
|
|
|
|
|
|
|
|
namespace boost::serialization {
|
|
|
|
|
template <class Archive>
|
|
|
|
|
void load_construct_data(Archive& ar, Service::CSND::CSND_SND* t, const unsigned int);
|
|
|
|
|
}
|
|
|
|
|