Savestates: save cellAudioOut

This commit is contained in:
Eladash 2022-07-05 20:09:10 +03:00 committed by Ivan
parent b692108f1e
commit 57671e267d
3 changed files with 24 additions and 1 deletions

View File

@ -178,6 +178,23 @@ audio_out_configuration::audio_out_configuration()
cellSysutil.notice("cellAudioOut: initial secondary output configuration: channels=%d, encoder=%d, downmixer=%d", secondary_output.channels, secondary_output.encoder, secondary_output.downmixer);
}
audio_out_configuration::audio_out_configuration(utils::serial& ar)
: audio_out_configuration()
{
// Load configuartion (ar is reading)
save(ar);
}
void audio_out_configuration::save(utils::serial& ar)
{
USING_SERIALIZATION_VERSION_COND(ar.is_writing(), cellAudioOut);
for (auto& state : out)
{
ar(state.state, state.channels, state.encoder, state.downmixer, state.copy_control, state.sound_modes, state.sound_mode);
}
}
std::pair<AudioChannelCnt, AudioChannelCnt> audio_out_configuration::audio_out::get_channel_count_and_downmixer() const
{
std::pair<AudioChannelCnt, AudioChannelCnt> ret;

View File

@ -135,6 +135,8 @@ struct CellAudioOutSoundMode
u8 fs;
u8 reserved;
be_t<u32> layout;
ENABLE_BITWISE_SERIALIZATION;
};
struct CellAudioOutDeviceInfo
@ -217,5 +219,8 @@ struct audio_out_configuration
std::array<audio_out, 2> out;
SAVESTATE_INIT_POS(8.9); // Is a dependency of cellAudio
audio_out_configuration();
audio_out_configuration(utils::serial& ar);
void save(utils::serial& ar);
};

View File

@ -71,7 +71,7 @@ struct serial_ver_t
std::set<u32> compatible_versions;
};
static std::array<serial_ver_t, 22> s_serial_versions;
static std::array<serial_ver_t, 23> s_serial_versions;
#define SERIALIZATION_VER(name, identifier, ...) \
\
@ -125,6 +125,7 @@ SERIALIZATION_VER(cellVoice, 18, 1)
SERIALIZATION_VER(cellGcm, 19, 1)
SERIALIZATION_VER(sysPrxForUser, 20, 1)
SERIALIZATION_VER(cellSaveData, 21, 1)
SERIALIZATION_VER(cellAudioOut, 22, 1)
#undef SERIALIZATION_VER