Serialize QTM, Y2R services

This commit is contained in:
Hamish Milne 2020-01-01 22:57:21 +00:00 committed by zhupengfei
parent 92857efca4
commit ef2e503281
11 changed files with 97 additions and 2 deletions

4
TODO
View file

@ -105,7 +105,7 @@
✔ PS @done(20-01-01 00:54)
✔ PTM @done(20-01-01 22:36)
✔ PXI @done(20-01-01 00:53)
☐ QTM
✔ QTM @done(20-01-01 22:41)
✔ SOC @done(20-01-01 00:51)
✔ SSL @done(20-01-01 00:48)
☐ Y2R
✔ Y2R @done(20-01-01 22:56)

View file

@ -2,9 +2,12 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/qtm/qtm_c.h"
SERIALIZE_EXPORT_IMPL(Service::QTM::QTM_C)
namespace Service::QTM {
QTM_C::QTM_C() : ServiceFramework("qtm:c", 2) {

View file

@ -15,3 +15,5 @@ public:
};
} // namespace Service::QTM
BOOST_CLASS_EXPORT_KEY(Service::QTM::QTM_C)

View file

@ -2,9 +2,12 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/qtm/qtm_s.h"
SERIALIZE_EXPORT_IMPL(Service::QTM::QTM_S)
namespace Service::QTM {
QTM_S::QTM_S() : ServiceFramework("qtm:s", 2) {

View file

@ -15,3 +15,5 @@ public:
};
} // namespace Service::QTM
BOOST_CLASS_EXPORT_KEY(Service::QTM::QTM_S)

View file

@ -2,9 +2,12 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/qtm/qtm_sp.h"
SERIALIZE_EXPORT_IMPL(Service::QTM::QTM_SP)
namespace Service::QTM {
QTM_SP::QTM_SP() : ServiceFramework("qtm:sp", 2) {

View file

@ -15,3 +15,5 @@ public:
};
} // namespace Service::QTM
BOOST_CLASS_EXPORT_KEY(Service::QTM::QTM_SP)

View file

@ -2,9 +2,12 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/qtm/qtm_u.h"
SERIALIZE_EXPORT_IMPL(Service::QTM::QTM_U)
namespace Service::QTM {
QTM_U::QTM_U() : ServiceFramework("qtm:u", 2) {

View file

@ -15,3 +15,5 @@ public:
};
} // namespace Service::QTM
BOOST_CLASS_EXPORT_KEY(Service::QTM::QTM_U)

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cstring>
#include "common/archives.h"
#include "common/common_funcs.h"
#include "common/logging/log.h"
#include "core/core.h"
@ -12,8 +13,22 @@
#include "core/hle/service/y2r_u.h"
#include "core/hw/y2r.h"
SERVICE_CONSTRUCT_IMPL(Service::Y2R::Y2R_U)
SERIALIZE_EXPORT_IMPL(Service::Y2R::Y2R_U)
namespace Service::Y2R {
template <class Archive>
void Y2R_U::serialize(Archive& ar, const unsigned int) {
ar& completion_event;
ar& conversion;
ar& dithering_weight_params;
ar& temporal_dithering_enabled;
ar& transfer_end_interrupt_enabled;
ar& spacial_dithering_enabled;
}
SERIALIZE_IMPL(Y2R_U)
static const CoefficientSet standard_coefficients[4] = {
{{0x100, 0x166, 0xB6, 0x58, 0x1C5, -0x166F, 0x10EE, -0x1C5B}}, // ITU_Rec601
{{0x100, 0x193, 0x77, 0x2F, 0x1DB, -0x1933, 0xA7C, -0x1D51}}, // ITU_Rec709

View file

@ -7,6 +7,7 @@
#include <array>
#include <memory>
#include <string>
#include <boost/serialization/array.hpp>
#include "common/common_types.h"
#include "core/hle/result.h"
#include "core/hle/service/service.h"
@ -91,6 +92,16 @@ struct ConversionBuffer {
u16 transfer_unit;
/// Amount of bytes to be skipped between copying each `transfer_unit` bytes.
u16 gap;
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& address;
ar& image_size;
ar& transfer_unit;
ar& gap;
}
friend class boost::serialization::access;
};
struct ConversionConfiguration {
@ -112,6 +123,26 @@ struct ConversionConfiguration {
ResultCode SetInputLineWidth(u16 width);
ResultCode SetInputLines(u16 lines);
ResultCode SetStandardCoefficient(StandardCoefficient standard_coefficient);
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& input_format;
ar& output_format;
ar& rotation;
ar& block_alignment;
ar& input_line_width;
ar& input_lines;
ar& coefficients;
ar& padding;
ar& alpha;
ar& src_Y;
ar& src_U;
ar& src_V;
ar& src_YUYV;
ar& dst;
}
friend class boost::serialization::access;
};
struct DitheringWeightParams {
@ -131,6 +162,28 @@ struct DitheringWeightParams {
u16 w3_xOdd_yEven;
u16 w3_xEven_yOdd;
u16 w3_xOdd_yOdd;
private:
template <class Archive>
void serialize(Archive& ar, const unsigned int) {
ar& w0_xEven_yEven;
ar& w0_xOdd_yEven;
ar& w0_xEven_yOdd;
ar& w0_xOdd_yOdd;
ar& w1_xEven_yEven;
ar& w1_xOdd_yEven;
ar& w1_xEven_yOdd;
ar& w1_xOdd_yOdd;
ar& w2_xEven_yEven;
ar& w2_xOdd_yEven;
ar& w2_xEven_yOdd;
ar& w2_xOdd_yOdd;
ar& w3_xEven_yEven;
ar& w3_xOdd_yEven;
ar& w3_xEven_yOdd;
ar& w3_xOdd_yOdd;
}
friend class boost::serialization::access;
};
struct ConversionParameters {
@ -301,8 +354,15 @@ private:
bool temporal_dithering_enabled = false;
bool transfer_end_interrupt_enabled = false;
bool spacial_dithering_enabled = false;
template <class Archive>
void serialize(Archive& ar, const unsigned int);
friend class boost::serialization::access;
};
void InstallInterfaces(Core::System& system);
} // namespace Service::Y2R
SERVICE_CONSTRUCT(Service::Y2R::Y2R_U)
BOOST_CLASS_EXPORT_KEY(Service::Y2R::Y2R_U)