Code review actions (plus hopefully fix the linux CI)
This commit is contained in:
parent
9bd189a155
commit
92640fc29c
46 changed files with 155 additions and 109 deletions
|
@ -31,8 +31,10 @@ if (MSVC)
|
|||
# /Zc:externConstexpr - Allow extern constexpr variables to have external linkage, like the standard mandates
|
||||
# /Zc:inline - Let codegen omit inline functions in object files
|
||||
# /Zc:throwingNew - Let codegen assume `operator new` (without std::nothrow) will never return null
|
||||
# /external:* - Suppress warnings from external headers
|
||||
add_compile_options(
|
||||
/W3
|
||||
/MP
|
||||
/Zi
|
||||
/Zo
|
||||
/permissive-
|
||||
|
@ -40,17 +42,12 @@ if (MSVC)
|
|||
/volatile:iso
|
||||
/Zc:externConstexpr
|
||||
/Zc:inline
|
||||
/Zc:throwingNew
|
||||
/experimental:external
|
||||
/external:I "${CMAKE_SOURCE_DIR}/externals"
|
||||
/external:anglebrackets
|
||||
/external:W0
|
||||
)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
add_compile_options(
|
||||
/MP
|
||||
/Zc:throwingNew
|
||||
/experimental:external
|
||||
/external:I "${CMAKE_SOURCE_DIR}/externals"
|
||||
/external:anglebrackets
|
||||
/external:W0
|
||||
)
|
||||
endif()
|
||||
|
||||
# /GS- - No stack buffer overflow checks
|
||||
add_compile_options("$<$<CONFIG:Release>:/GS->")
|
||||
|
|
|
@ -45,6 +45,7 @@ void DspHle::serialize(Archive& ar, const unsigned int) {
|
|||
ar& boost::serialization::base_object<DspInterface>(*this);
|
||||
ar&* impl.get();
|
||||
}
|
||||
SERIALIZE_IMPL(DspHle)
|
||||
|
||||
static constexpr u64 audio_frame_ticks = 1310252ull; ///< Units: ARM11 cycles
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <boost/archive/binary_iarchive.hpp>
|
||||
#include "boost/archive/binary_oarchive.hpp"
|
||||
#include "boost/serialization/export.hpp"
|
||||
#include <boost/archive/binary_oarchive.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
|
||||
using iarchive = boost::archive::binary_iarchive;
|
||||
using oarchive = boost::archive::binary_oarchive;
|
||||
|
|
|
@ -41,13 +41,17 @@ public:
|
|||
}
|
||||
|
||||
std::size_t GetSize() const override {
|
||||
return static_cast<u32>(data.size());
|
||||
return data.size();
|
||||
}
|
||||
|
||||
std::vector<u8>& Vector() {
|
||||
return data;
|
||||
}
|
||||
|
||||
const std::vector<u8>& Vector() const {
|
||||
return data;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<u8> data;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include <boost/icl/discrete_interval.hpp>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace boost::serialization {
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void save(Archive& ar, const boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void save(Archive& ar, const boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
ar << obj.lower();
|
||||
ar << obj.upper();
|
||||
ar << obj.bounds()._bits;
|
||||
}
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void load(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void load(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
DomainT upper, lower;
|
||||
boost::icl::bound_type bounds;
|
||||
ar >> upper;
|
||||
ar >> lower;
|
||||
ar >> upper;
|
||||
ar >> bounds;
|
||||
obj = boost::icl::discrete_interval(upper, lower, boost::icl::interval_bounds(bounds));
|
||||
}
|
||||
|
||||
template <class Archive, class DomainT, ICL_COMPARE Compare>
|
||||
void serialize(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj, const unsigned int file_version)
|
||||
{
|
||||
void serialize(Archive& ar, boost::icl::discrete_interval<DomainT, Compare>& obj,
|
||||
const unsigned int file_version) {
|
||||
boost::serialization::split_free(ar, obj, file_version);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace boost::serialization
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
|
20
src/common/serialization/boost_interval_set.hpp
Normal file
20
src/common/serialization/boost_interval_set.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2020 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include "common/serialization/boost_discrete_interval.hpp"
|
||||
|
||||
namespace boost::serialization {
|
||||
|
||||
template <class Archive, class T>
|
||||
void serialize(Archive& ar, boost::icl::interval_set<T>& obj, const unsigned int file_version) {
|
||||
using IntervalSet = boost::icl::interval_set<T>;
|
||||
// This works because interval_set has exactly one member of type ImplSetT
|
||||
static_assert(std::is_standard_layout_v<IntervalSet>);
|
||||
ar&*(reinterpret_cast<typename IntervalSet::ImplSetT*>(&obj));
|
||||
}
|
||||
|
||||
} // namespace boost::serialization
|
|
@ -186,7 +186,7 @@ private:
|
|||
void save(Archive& ar, const unsigned int file_version) const {
|
||||
const s64 idx = ToIndex(first);
|
||||
ar << idx;
|
||||
for (size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
for (std::size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
const s64 idx1 = ToIndex(queues[i].next_nonempty);
|
||||
ar << idx1;
|
||||
ar << queues[i].data;
|
||||
|
@ -198,7 +198,7 @@ private:
|
|||
s64 idx;
|
||||
ar >> idx;
|
||||
first = ToPointer(idx);
|
||||
for (auto i = 0; i < NUM_QUEUES; i++) {
|
||||
for (std::size_t i = 0; i < NUM_QUEUES; i++) {
|
||||
ar >> idx;
|
||||
queues[i].next_nonempty = ToPointer(idx);
|
||||
ar >> queues[i].data;
|
||||
|
|
|
@ -6,15 +6,13 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/arm/skyeye_common/arm_regformat.h"
|
||||
#include "core/arm/skyeye_common/vfp/asm_vfp.h"
|
||||
#include "core/core_timing.h"
|
||||
|
||||
namespace Memory {
|
||||
struct PageTable;
|
||||
}
|
||||
#include "core/memory.h"
|
||||
|
||||
/// Generic ARM11 CPU interface
|
||||
class ARM_Interface : NonCopyable {
|
||||
|
@ -28,11 +26,11 @@ public:
|
|||
|
||||
template <class Archive>
|
||||
void save(Archive& ar, const unsigned int file_version) const {
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
for (std::size_t i = 0; i < 16; i++) {
|
||||
const auto r = GetCpuRegister(i);
|
||||
ar << r;
|
||||
}
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
for (std::size_t i = 0; i < 16; i++) {
|
||||
const auto r = GetFpuRegister(i);
|
||||
ar << r;
|
||||
}
|
||||
|
@ -47,11 +45,11 @@ public:
|
|||
template <class Archive>
|
||||
void load(Archive& ar, const unsigned int file_version) {
|
||||
u32 r;
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
for (std::size_t i = 0; i < 16; i++) {
|
||||
ar >> r;
|
||||
SetCpuRegister(i, r);
|
||||
}
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
for (std::size_t i = 0; i < 16; i++) {
|
||||
ar >> r;
|
||||
SetFpuRegister(i, r);
|
||||
}
|
||||
|
@ -120,8 +118,6 @@ public:
|
|||
/// Notify CPU emulation that page tables have changed
|
||||
virtual void SetPageTable(const std::shared_ptr<Memory::PageTable>& page_table) = 0;
|
||||
|
||||
virtual std::shared_ptr<Memory::PageTable> GetPageTable() const = 0;
|
||||
|
||||
/**
|
||||
* Set the Program Counter to an address
|
||||
* @param addr Address to set PC to
|
||||
|
@ -234,6 +230,9 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
// This us used for serialization. Returning nullptr is valid if page tables are not used.
|
||||
virtual std::shared_ptr<Memory::PageTable> GetPageTable() const = 0;
|
||||
|
||||
std::shared_ptr<Core::Timing::Timer> timer;
|
||||
|
||||
private:
|
||||
|
@ -259,11 +258,11 @@ private:
|
|||
const auto r = GetVFPReg(i);
|
||||
ar << r;
|
||||
}
|
||||
for (size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) {
|
||||
for (std::size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) {
|
||||
const auto r = GetVFPSystemReg(static_cast<VFPSystemRegister>(i));
|
||||
ar << r;
|
||||
}
|
||||
for (size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) {
|
||||
for (std::size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) {
|
||||
const auto r = GetCP15Register(static_cast<CP15Register>(i));
|
||||
ar << r;
|
||||
}
|
||||
|
@ -290,11 +289,11 @@ private:
|
|||
ar >> r;
|
||||
SetVFPReg(i, r);
|
||||
}
|
||||
for (size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) {
|
||||
for (std::size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) {
|
||||
ar >> r;
|
||||
SetVFPSystemReg(static_cast<VFPSystemRegister>(i), r);
|
||||
}
|
||||
for (size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) {
|
||||
for (std::size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) {
|
||||
ar >> r;
|
||||
SetCP15Register(static_cast<CP15Register>(i), r);
|
||||
}
|
||||
|
|
|
@ -53,9 +53,11 @@ public:
|
|||
void ClearInstructionCache() override;
|
||||
void InvalidateCacheRange(u32 start_address, std::size_t length) override;
|
||||
void SetPageTable(const std::shared_ptr<Memory::PageTable>& page_table) override;
|
||||
std::shared_ptr<Memory::PageTable> GetPageTable() const override;
|
||||
void PurgeState() override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Memory::PageTable> GetPageTable() const override;
|
||||
|
||||
private:
|
||||
friend class DynarmicUserCallbacks;
|
||||
Core::System& system;
|
||||
|
|
|
@ -49,10 +49,12 @@ public:
|
|||
void LoadContext(const std::unique_ptr<ThreadContext>& arg) override;
|
||||
|
||||
void SetPageTable(const std::shared_ptr<Memory::PageTable>& page_table) override;
|
||||
std::shared_ptr<Memory::PageTable> GetPageTable() const override;
|
||||
void PrepareReschedule() override;
|
||||
void PurgeState() override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Memory::PageTable> GetPageTable() const override;
|
||||
|
||||
private:
|
||||
void ExecuteInstructions(u64 num_instructions);
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#pragma optimize("", off)
|
||||
// Copyright 2014 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
@ -184,12 +183,14 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
|
|||
LOG_INFO(Core, "Begin load");
|
||||
System::LoadState(param);
|
||||
LOG_INFO(Core, "Load completed");
|
||||
} break;
|
||||
break;
|
||||
}
|
||||
case Signal::Save: {
|
||||
LOG_INFO(Core, "Begin save");
|
||||
System::SaveState(param);
|
||||
LOG_INFO(Core, "Save completed");
|
||||
} break;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -551,19 +552,11 @@ void System::serialize(Archive& ar, const unsigned int file_version) {
|
|||
|
||||
// NOTE: DSP doesn't like being destroyed and recreated. So instead we do an inline
|
||||
// serialization; this means that the DSP Settings need to match for loading to work.
|
||||
bool dsp_type = Settings::values.enable_dsp_lle;
|
||||
ar& dsp_type;
|
||||
if (dsp_type != Settings::values.enable_dsp_lle) {
|
||||
throw std::runtime_error(
|
||||
"Incorrect DSP type - please change this in Settings before loading");
|
||||
}
|
||||
auto dsp_hle = dynamic_cast<AudioCore::DspHle*>(dsp_core.get());
|
||||
if (dsp_hle) {
|
||||
ar&* dsp_hle;
|
||||
}
|
||||
auto dsp_lle = dynamic_cast<AudioCore::DspLle*>(dsp_core.get());
|
||||
if (dsp_lle) {
|
||||
ar&* dsp_lle;
|
||||
} else {
|
||||
throw std::runtime_error("LLE audio not supported for save states");
|
||||
}
|
||||
|
||||
ar&* memory.get();
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include "boost/serialization/access.hpp"
|
||||
#include "common/common_types.h"
|
||||
#include "core/custom_tex_cache.h"
|
||||
#include "core/frontend/applets/mii_selector.h"
|
||||
|
|
|
@ -183,11 +183,10 @@ void Timing::Timer::Advance(s64 max_slice_length) {
|
|||
Event evt = std::move(event_queue.front());
|
||||
std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
event_queue.pop_back();
|
||||
if (evt.type->callback == nullptr) {
|
||||
LOG_ERROR(Core, "Event '{}' has no callback", *evt.type->name);
|
||||
}
|
||||
if (evt.type->callback != nullptr) {
|
||||
evt.type->callback(evt.userdata, executed_ticks - evt.time);
|
||||
} else {
|
||||
LOG_ERROR(Core, "Event '{}' has no callback", *evt.type->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/kernel/server_port.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/result.h"
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/kernel/wait_object.h"
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/unordered_map.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/archives.h"
|
||||
#include "common/serialization/atomic.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/unordered_map.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/result.h"
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
#include <boost/icl/interval_set.hpp>
|
||||
#include <boost/serialization/set.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/serialization/boost_discrete_interval.hpp"
|
||||
#include "common/serialization/boost_interval_set.hpp"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -70,8 +71,7 @@ private:
|
|||
ar& base;
|
||||
ar& size;
|
||||
ar& used;
|
||||
// This works because interval_set has exactly one member of type ImplSetT
|
||||
ar&*(reinterpret_cast<IntervalSet::ImplSetT*>(&free_blocks));
|
||||
ar& free_blocks;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/wait_object.h"
|
||||
|
|
|
@ -104,7 +104,7 @@ BOOST_SERIALIZATION_ASSUME_ABSTRACT(Kernel::Object)
|
|||
#define CONSTRUCT_KERNEL_OBJECT(T) \
|
||||
namespace boost::serialization { \
|
||||
template <class Archive> \
|
||||
inline void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
|
||||
void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
|
||||
::new (t) T(Core::Global<Kernel::KernelSystem>()); \
|
||||
} \
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
#include <array>
|
||||
#include <memory>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <queue>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include <tuple>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/archives.h"
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
|
|
|
@ -7,10 +7,7 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/kernel/server_session.h"
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include <tuple>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/archives.h"
|
||||
#include "core/global.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
|
@ -16,6 +18,18 @@ SERIALIZE_EXPORT_IMPL(Kernel::ServerSession)
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
template <class Archive>
|
||||
void ServerSession::serialize(Archive& ar, const unsigned int file_version) {
|
||||
ar& boost::serialization::base_object<WaitObject>(*this);
|
||||
ar& name;
|
||||
ar& parent;
|
||||
ar& hle_handler;
|
||||
ar& pending_requesting_threads;
|
||||
ar& currently_handling;
|
||||
ar& mapped_buffer_context;
|
||||
}
|
||||
SERIALIZE_IMPL(ServerSession)
|
||||
|
||||
ServerSession::ServerSession(KernelSystem& kernel) : WaitObject(kernel), kernel(kernel) {}
|
||||
ServerSession::~ServerSession() {
|
||||
// This destructor will be called automatically when the last ServerSession handle is closed by
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/ipc.h"
|
||||
|
@ -110,15 +108,7 @@ private:
|
|||
|
||||
friend class boost::serialization::access;
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int file_version) {
|
||||
ar& boost::serialization::base_object<WaitObject>(*this);
|
||||
ar& name;
|
||||
ar& parent;
|
||||
ar& hle_handler;
|
||||
ar& pending_requesting_threads;
|
||||
ar& currently_handling;
|
||||
ar& mapped_buffer_context;
|
||||
}
|
||||
void serialize(Archive& ar, const unsigned int file_version);
|
||||
};
|
||||
|
||||
} // namespace Kernel
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "common/archives.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/server_session.h"
|
||||
#include "core/hle/kernel/session.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <cstring>
|
||||
#include "common/archives.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/global.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/memory_ref.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
|
@ -118,7 +120,7 @@ private:
|
|||
ar& owner_process;
|
||||
ar& base_address;
|
||||
ar& name;
|
||||
ar&*(reinterpret_cast<MemoryRegionInfo::IntervalSet::ImplSetT*>(&holding_memory));
|
||||
ar& holding_memory;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <memory>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/binary_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include "common/bit_field.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <list>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include "common/archives.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
|
@ -15,7 +16,6 @@
|
|||
#include "core/arm/arm_interface.h"
|
||||
#include "core/arm/skyeye_common/armstate.h"
|
||||
#include "core/core.h"
|
||||
#include "core/global.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/global.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/object.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/serialization/unordered_map.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/core_timing.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
#include <boost/serialization/map.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/memory_ref.h"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include "common/archives.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
|
@ -16,6 +17,15 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
template <class Archive>
|
||||
void WaitObject::serialize(Archive& ar, const unsigned int file_version) {
|
||||
ar& boost::serialization::base_object<Object>(*this);
|
||||
ar& waiting_threads;
|
||||
// NB: hle_notifier *not* serialized since it's a callback!
|
||||
// Fortunately it's only used in one place (DSP) so we can reconstruct it there
|
||||
}
|
||||
SERIALIZE_IMPL(WaitObject)
|
||||
|
||||
void WaitObject::AddWaitingThread(std::shared_ptr<Thread> thread) {
|
||||
auto itr = std::find(waiting_threads.begin(), waiting_threads.end(), thread);
|
||||
if (itr == waiting_threads.end())
|
||||
|
|
|
@ -69,12 +69,7 @@ private:
|
|||
private:
|
||||
friend class boost::serialization::access;
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int file_version) {
|
||||
ar& boost::serialization::base_object<Object>(*this);
|
||||
ar& waiting_threads;
|
||||
// NB: hle_notifier *not* serialized since it's a callback!
|
||||
// Fortunately it's only used in one place (DSP) so we can reconstruct it there
|
||||
}
|
||||
void serialize(Archive& ar, const unsigned int file_version);
|
||||
};
|
||||
|
||||
// Specialization of DynamicObjectCast for WaitObjects
|
||||
|
|
|
@ -210,10 +210,6 @@ void Module::UpdateAccelerometerCallback(u64 userdata, s64 cycles_late) {
|
|||
next_accelerometer_index = (next_accelerometer_index + 1) % mem->accelerometer.entries.size();
|
||||
|
||||
Common::Vec3<float> accel;
|
||||
if (!motion_device) {
|
||||
is_device_reload_pending.store(true);
|
||||
return;
|
||||
}
|
||||
std::tie(accel, std::ignore) = motion_device->GetStatus();
|
||||
accel *= accelerometer_coef;
|
||||
// TODO(wwylele): do a time stretch like the one in UpdateGyroscopeCallback
|
||||
|
@ -261,10 +257,6 @@ void Module::UpdateGyroscopeCallback(u64 userdata, s64 cycles_late) {
|
|||
GyroscopeDataEntry& gyroscope_entry = mem->gyroscope.entries[mem->gyroscope.index];
|
||||
|
||||
Common::Vec3<float> gyro;
|
||||
if (!motion_device) {
|
||||
is_device_reload_pending.store(true);
|
||||
return;
|
||||
}
|
||||
std::tie(std::ignore, gyro) = motion_device->GetStatus();
|
||||
double stretch = system.perf_stats->GetLastFrameTimeScale();
|
||||
gyro *= gyroscope_coef * static_cast<float>(stretch);
|
||||
|
|
|
@ -71,7 +71,9 @@ private:
|
|||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& hid_period;
|
||||
ar& calibration_data; // This isn't writeable for now, but might be in future
|
||||
RequestInputDevicesReload(); // zl, zr, c_stick are loaded here
|
||||
if (Archive::is_loading::value) {
|
||||
LoadInputDevices(); // zl, zr, c_stick are loaded here
|
||||
}
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/binary_object.hpp>
|
||||
#include "audio_core/dsp_interface.h"
|
||||
#include "boost/serialization/array.hpp"
|
||||
#include "boost/serialization/binary_object.hpp"
|
||||
#include "common/archives.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/serialization/access.hpp>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include "common/common_types.h"
|
||||
|
@ -86,12 +85,12 @@ struct PageTable {
|
|||
struct Entry {
|
||||
Entry(Pointers& pointers_, VAddr idx_) : pointers(pointers_), idx(idx_) {}
|
||||
|
||||
inline void operator=(MemoryRef value) {
|
||||
void operator=(MemoryRef value) {
|
||||
pointers.refs[idx] = value;
|
||||
pointers.raw[idx] = value.GetPtr();
|
||||
}
|
||||
|
||||
inline operator u8*() {
|
||||
operator u8*() {
|
||||
return pointers.raw[idx];
|
||||
}
|
||||
|
||||
|
@ -100,15 +99,15 @@ struct PageTable {
|
|||
VAddr idx;
|
||||
};
|
||||
|
||||
inline Entry operator[](VAddr idx) {
|
||||
Entry operator[](VAddr idx) {
|
||||
return Entry(*this, idx);
|
||||
}
|
||||
|
||||
inline u8* operator[](VAddr idx) const {
|
||||
u8* operator[](VAddr idx) const {
|
||||
return raw[idx];
|
||||
}
|
||||
|
||||
inline Entry operator[](std::size_t idx) {
|
||||
Entry operator[](std::size_t idx) {
|
||||
return Entry(*this, static_cast<VAddr>(idx));
|
||||
}
|
||||
|
||||
|
@ -133,7 +132,7 @@ struct PageTable {
|
|||
*/
|
||||
std::array<PageType, PAGE_TABLE_NUM_ENTRIES> attributes;
|
||||
|
||||
inline std::array<u8*, PAGE_TABLE_NUM_ENTRIES>& GetPointerArray() {
|
||||
std::array<u8*, PAGE_TABLE_NUM_ENTRIES>& GetPointerArray() {
|
||||
return pointers.raw;
|
||||
}
|
||||
|
||||
|
|
|
@ -385,7 +385,6 @@ void GeometryPipeline::serialize(Archive& ar, const unsigned int version) {
|
|||
|
||||
} // namespace Pica
|
||||
|
||||
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Pica::GeometryPipelineBackend)
|
||||
SERIALIZE_EXPORT_IMPL(Pica::GeometryPipeline_Point)
|
||||
SERIALIZE_EXPORT_IMPL(Pica::GeometryPipeline_VariablePrimitive)
|
||||
SERIALIZE_EXPORT_IMPL(Pica::GeometryPipeline_FixedPrimitive)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_types.h"
|
||||
|
|
Loading…
Reference in a new issue