System: Remove BIOS from save state

Makes the states smaller, as well as not creating potential piracy
issues when sending across the wire.
This commit is contained in:
Stenzek
2023-03-16 19:33:59 +10:00
parent 1fcf16fc81
commit 33f5d9cb9c
5 changed files with 38 additions and 3 deletions

View File

@ -29,6 +29,17 @@ void StateWrapper::DoBytes(void* data, size_t length)
}
}
void StateWrapper::DoBytesEx(void* data, size_t length, u32 version_introduced, const void* default_value)
{
if (m_mode == Mode::Read && m_version < version_introduced)
{
std::memcpy(data, default_value, length);
return;
}
DoBytes(data, length);
}
void StateWrapper::Do(bool* value_ptr)
{
if (m_mode == Mode::Read)

View File

@ -104,6 +104,7 @@ public:
}
void DoBytes(void* data, size_t length);
void DoBytesEx(void* data, size_t length, u32 version_introduced, const void* default_value);
void Do(bool* value_ptr);
void Do(std::string* value_ptr);
@ -182,7 +183,7 @@ public:
template<typename T>
void DoEx(T* data, u32 version_introduced, T default_value)
{
if (m_version < version_introduced)
if (m_mode == Mode::Read && m_version < version_introduced)
{
*data = std::move(default_value);
return;