mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Finished archives; remove pod.h
This commit is contained in:
		
							parent
							
								
									2bf5b46460
								
							
						
					
					
						commit
						558e710e17
					
				
					 14 changed files with 72 additions and 48 deletions
				
			
		|  | @ -1,17 +0,0 @@ | |||
| #include "boost/serialization/split_member.hpp" | ||||
| 
 | ||||
| #define SERIALIZE_AS_POD                                                                           \ | ||||
| private:                                                                                           \ | ||||
|     friend class boost::serialization::access;                                                     \ | ||||
|     template <typename Archive>                                                                    \ | ||||
|     void save(Archive& ar, const unsigned int file_version) const {                                \ | ||||
|         ar.save_binary(this, sizeof(*this));                                                       \ | ||||
|     }                                                                                              \ | ||||
|     template <typename Archive>                                                                    \ | ||||
|     void load(Archive& ar, const unsigned int file_version) {                                      \ | ||||
|         ar.load_binary(this, sizeof(*this));                                                       \ | ||||
|     }                                                                                              \ | ||||
|     template <class Archive>                                                                       \ | ||||
|     void serialize(Archive& ar, const unsigned int file_version) {                                 \ | ||||
|         boost::serialization::split_member(ar, *this, file_version);                               \ | ||||
|     } | ||||
|  | @ -172,7 +172,9 @@ protected: | |||
| 
 | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) {} | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& delay_generator; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -30,7 +30,6 @@ | |||
| // FileSys namespace
 | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(FileSys::NCCHArchive) | ||||
| SERIALIZE_EXPORT_IMPL(FileSys::NCCHFile) | ||||
| SERIALIZE_EXPORT_IMPL(FileSys::ArchiveFactory_NCCH) | ||||
| 
 | ||||
| namespace FileSys { | ||||
|  |  | |||
|  | @ -98,13 +98,6 @@ private: | |||
|     NCCHFile() = default; // NOTE: If the public ctor has behaviour, need to replace this with
 | ||||
|                           // *_construct_data
 | ||||
|     std::vector<u8> file_buffer; // TODO: Replace with file ref for serialization
 | ||||
| 
 | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& boost::serialization::base_object<FileBackend>(*this); | ||||
|         ar& file_buffer; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| /// File system interface to the NCCH archive
 | ||||
|  | @ -130,5 +123,4 @@ private: | |||
| } // namespace FileSys
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(FileSys::NCCHArchive) | ||||
| BOOST_CLASS_EXPORT_KEY(FileSys::NCCHFile) | ||||
| BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_NCCH) | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #include <array> | ||||
| #include <cinttypes> | ||||
| #include "common/archives.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/swap.h" | ||||
|  | @ -16,6 +17,8 @@ | |||
| ////////////////////////////////////////////////////////////////////////////////////////////////////
 | ||||
| // FileSys namespace
 | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(FileSys::ArchiveFactory_SelfNCCH) | ||||
| 
 | ||||
| namespace FileSys { | ||||
| 
 | ||||
| enum class SelfNCCHFilePathType : u32 { | ||||
|  |  | |||
|  | @ -8,6 +8,7 @@ | |||
| #include <string> | ||||
| #include <unordered_map> | ||||
| #include <vector> | ||||
| #include <boost/serialization/export.hpp> | ||||
| #include "common/common_types.h" | ||||
| #include "core/file_sys/archive_backend.h" | ||||
| #include "core/hle/result.h" | ||||
|  | @ -44,7 +45,10 @@ public: | |||
| 
 | ||||
| private: | ||||
|     /// Mapping of ProgramId -> NCCHData
 | ||||
|     std::unordered_map<u64, NCCHData> ncch_data; | ||||
|     std::unordered_map<u64, NCCHData> | ||||
|         ncch_data; // TODO: Remove this, or actually set the values here
 | ||||
| }; | ||||
| 
 | ||||
| } // namespace FileSys
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SelfNCCH) | ||||
|  |  | |||
|  | @ -3,8 +3,11 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <algorithm> | ||||
| #include "common/archives.h" | ||||
| #include "core/file_sys/delay_generator.h" | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(FileSys::DefaultDelayGenerator) | ||||
| 
 | ||||
| namespace FileSys { | ||||
| 
 | ||||
| DelayGenerator::~DelayGenerator() = default; | ||||
|  |  | |||
|  | @ -5,6 +5,8 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <cstddef> | ||||
| #include <boost/serialization/access.hpp> | ||||
| #include <boost/serialization/export.hpp> | ||||
| #include "common/common_types.h" | ||||
| 
 | ||||
| namespace FileSys { | ||||
|  | @ -16,6 +18,10 @@ public: | |||
|     virtual u64 GetOpenDelayNs() = 0; | ||||
| 
 | ||||
|     // TODO (B3N30): Add getter for all other file/directory io operations
 | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) {} | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| class DefaultDelayGenerator : public DelayGenerator { | ||||
|  | @ -25,3 +31,5 @@ public: | |||
| }; | ||||
| 
 | ||||
| } // namespace FileSys
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(FileSys::DefaultDelayGenerator); | ||||
|  |  | |||
|  | @ -89,12 +89,7 @@ public: | |||
|     virtual void Flush() const = 0; | ||||
| 
 | ||||
| protected: | ||||
|     std::unique_ptr<DelayGenerator> delay_generator; // TODO: replace with virtual Get*DelayNs
 | ||||
| 
 | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) {} | ||||
|     friend class boost::serialization::access; | ||||
|     std::unique_ptr<DelayGenerator> delay_generator; | ||||
| }; | ||||
| 
 | ||||
| } // namespace FileSys
 | ||||
|  |  | |||
|  | @ -6,11 +6,11 @@ | |||
| 
 | ||||
| #include <new> | ||||
| #include <utility> | ||||
| #include <boost/serialization/access.hpp> | ||||
| #include "common/assert.h" | ||||
| #include "common/bit_field.h" | ||||
| #include "common/common_funcs.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/pod.h" | ||||
| 
 | ||||
| // All the constants in this file come from http://3dbrew.org/wiki/Error_codes
 | ||||
| 
 | ||||
|  | @ -227,7 +227,12 @@ union ResultCode { | |||
|         return is_error.ExtractValue(raw) == 1; | ||||
|     } | ||||
| 
 | ||||
|     SERIALIZE_AS_POD | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& raw; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| constexpr bool operator==(const ResultCode& a, const ResultCode& b) { | ||||
|  |  | |||
|  | @ -6,11 +6,12 @@ | |||
| 
 | ||||
| #include <cstddef> | ||||
| #include <type_traits> | ||||
| #include <boost/serialization/access.hpp> | ||||
| #include <boost/serialization/binary_object.hpp> | ||||
| #include "common/assert.h" | ||||
| #include "common/bit_field.h" | ||||
| #include "common/common_funcs.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/pod.h" | ||||
| 
 | ||||
| namespace Memory { | ||||
| class MemorySystem; | ||||
|  | @ -298,7 +299,12 @@ private: | |||
|         return register_value * 8; | ||||
|     } | ||||
| 
 | ||||
|     SERIALIZE_AS_POD | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         auto obj = boost::serialization::binary_object(this, sizeof(Regs)); | ||||
|         ar& obj; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| static_assert(std::is_standard_layout<Regs>::value, "Structure does not use standard layout"); | ||||
| 
 | ||||
|  |  | |||
|  | @ -6,10 +6,10 @@ | |||
| 
 | ||||
| #include <cstddef> | ||||
| #include <type_traits> | ||||
| #include <boost/serialization/access.hpp> | ||||
| #include "common/bit_field.h" | ||||
| #include "common/common_funcs.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/pod.h" | ||||
| 
 | ||||
| #define LCD_REG_INDEX(field_name) (offsetof(LCD::Regs, field_name) / sizeof(u32)) | ||||
| 
 | ||||
|  | @ -52,7 +52,15 @@ struct Regs { | |||
|         return content[index]; | ||||
|     } | ||||
| 
 | ||||
|     SERIALIZE_AS_POD | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& color_fill_top.raw; | ||||
|         ar& backlight_top; | ||||
|         ar& color_fill_bottom.raw; | ||||
|         ar& backlight_bottom; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| static_assert(std::is_standard_layout<Regs>::value, "Structure does not use standard layout"); | ||||
| 
 | ||||
|  |  | |||
|  | @ -8,6 +8,7 @@ | |||
| #include <cstddef> | ||||
| #include <functional> | ||||
| #include <type_traits> | ||||
| #include <boost/serialization/access.hpp> | ||||
| #include <boost/serialization/array.hpp> | ||||
| #include <boost/serialization/base_object.hpp> | ||||
| #include <nihstro/shader_bytecode.h> | ||||
|  | @ -15,7 +16,6 @@ | |||
| #include "common/common_funcs.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/hash.h" | ||||
| #include "common/pod.h" | ||||
| #include "common/vector_math.h" | ||||
| #include "video_core/pica_types.h" | ||||
| #include "video_core/regs_rasterizer.h" | ||||
|  | @ -65,7 +65,18 @@ struct OutputVertex { | |||
|     static OutputVertex FromAttributeBuffer(const RasterizerRegs& regs, | ||||
|                                             const AttributeBuffer& output); | ||||
| 
 | ||||
|     SERIALIZE_AS_POD | ||||
| private: | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) { | ||||
|         ar& pos; | ||||
|         ar& quat; | ||||
|         ar& tc0; | ||||
|         ar& tc1; | ||||
|         ar& tc0_w; | ||||
|         ar& view; | ||||
|         ar& tc2; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| #define ASSERT_POS(var, pos)                                                                       \ | ||||
|     static_assert(offsetof(OutputVertex, var) == pos * sizeof(float24), "Semantic at wrong "       \ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue