mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-11 13:20:04 +00:00
core: De-globalize movie (#6659)
This commit is contained in:
parent
a955f02771
commit
f8b8b6e53c
51 changed files with 182 additions and 104 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/service/act/act.h"
|
||||
#include "core/hle/service/act/act_a.h"
|
||||
#include "core/hle/service/act/act_u.h"
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/archives.h"
|
||||
#include "common/file_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/input.h"
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "core/hle/service/service.h"
|
||||
#include "core/hw/aes/ccm.h"
|
||||
#include "core/hw/aes/key.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "core/telemetry_session.h"
|
||||
|
||||
SERVICE_CONSTRUCT_IMPL(Service::APT::Module)
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#include <array>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include "common/archives.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
|
|
|
@ -150,7 +150,7 @@ void Module::UpdatePadCallback(std::uintptr_t user_data, s64 cycles_late) {
|
|||
circle_pad_old_y.erase(circle_pad_old_y.begin());
|
||||
circle_pad_old_y.push_back(circle_pad_new_y);
|
||||
|
||||
Core::Movie::GetInstance().HandlePadAndCircleStatus(state, circle_pad_x, circle_pad_y);
|
||||
system.Movie().HandlePadAndCircleStatus(state, circle_pad_x, circle_pad_y);
|
||||
|
||||
const DirectionState direction = GetStickDirectionState(circle_pad_x, circle_pad_y);
|
||||
state.circle_up.Assign(direction.up);
|
||||
|
@ -200,7 +200,7 @@ void Module::UpdatePadCallback(std::uintptr_t user_data, s64 cycles_late) {
|
|||
touch_entry.y = static_cast<u16>(y * Core::kScreenBottomHeight);
|
||||
touch_entry.valid.Assign(pressed ? 1 : 0);
|
||||
|
||||
Core::Movie::GetInstance().HandleTouchStatus(touch_entry);
|
||||
system.Movie().HandleTouchStatus(touch_entry);
|
||||
|
||||
// TODO(bunnei): We're not doing anything with offset 0xA8 + 0x18 of HID SharedMemory, which
|
||||
// supposedly is "Touch-screen entry, which contains the raw coordinate data prior to being
|
||||
|
@ -246,7 +246,7 @@ void Module::UpdateAccelerometerCallback(std::uintptr_t user_data, s64 cycles_la
|
|||
accelerometer_entry.y = static_cast<s16>(accel.y);
|
||||
accelerometer_entry.z = static_cast<s16>(accel.z);
|
||||
|
||||
Core::Movie::GetInstance().HandleAccelerometerStatus(accelerometer_entry);
|
||||
system.Movie().HandleAccelerometerStatus(accelerometer_entry);
|
||||
|
||||
// Make up "raw" entry
|
||||
// TODO(wwylele):
|
||||
|
@ -287,7 +287,7 @@ void Module::UpdateGyroscopeCallback(std::uintptr_t user_data, s64 cycles_late)
|
|||
gyroscope_entry.y = static_cast<s16>(gyro.y);
|
||||
gyroscope_entry.z = static_cast<s16>(gyro.z);
|
||||
|
||||
Core::Movie::GetInstance().HandleGyroscopeStatus(gyroscope_entry);
|
||||
system.Movie().HandleGyroscopeStatus(gyroscope_entry);
|
||||
|
||||
// Make up "raw" entry
|
||||
mem->gyroscope.raw_entry.x = gyroscope_entry.x;
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include <fmt/format.h>
|
||||
#include "common/alignment.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/service/ir/extra_hid.h"
|
||||
#include "core/movie.h"
|
||||
|
@ -65,7 +63,8 @@ enum class ResponseID : u8 {
|
|||
ReadCalibrationData = 0x11,
|
||||
};
|
||||
|
||||
ExtraHID::ExtraHID(SendFunc send_func, Core::Timing& timing) : IRDevice(send_func), timing(timing) {
|
||||
ExtraHID::ExtraHID(SendFunc send_func, Core::Timing& timing_, Core::Movie& movie_)
|
||||
: IRDevice(send_func), timing{timing_}, movie{movie_} {
|
||||
LoadInputDevices();
|
||||
|
||||
// The data below was retrieved from a New 3DS
|
||||
|
@ -249,7 +248,7 @@ void ExtraHID::SendHIDStatus() {
|
|||
response.buttons.r_not_held.Assign(1);
|
||||
response.unknown = 0;
|
||||
|
||||
Core::Movie::GetInstance().HandleExtraHidResponse(response);
|
||||
movie.HandleExtraHidResponse(response);
|
||||
|
||||
std::vector<u8> response_buffer(sizeof(response));
|
||||
memcpy(response_buffer.data(), &response, sizeof(response));
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
namespace Core {
|
||||
struct TimingEventType;
|
||||
class Timing;
|
||||
class Movie;
|
||||
} // namespace Core
|
||||
|
||||
namespace Service::IR {
|
||||
|
@ -43,7 +44,7 @@ static_assert(sizeof(ExtraHIDResponse) == 6, "HID status response has wrong size
|
|||
*/
|
||||
class ExtraHID final : public IRDevice {
|
||||
public:
|
||||
explicit ExtraHID(SendFunc send_func, Core::Timing& timing);
|
||||
explicit ExtraHID(SendFunc send_func, Core::Timing& timing, Core::Movie& movie);
|
||||
~ExtraHID();
|
||||
|
||||
void OnConnect() override;
|
||||
|
@ -60,6 +61,7 @@ private:
|
|||
void LoadInputDevices();
|
||||
|
||||
Core::Timing& timing;
|
||||
Core::Movie& movie;
|
||||
u8 hid_period;
|
||||
Core::TimingEventType* hid_polling_callback_id;
|
||||
std::array<u8, 0x40> calibration_data;
|
||||
|
|
|
@ -83,7 +83,7 @@ void IR_RST::UpdateCallback(std::uintptr_t user_data, s64 cycles_late) {
|
|||
s16 c_stick_x = static_cast<s16>(c_stick_x_f * MAX_CSTICK_RADIUS);
|
||||
s16 c_stick_y = static_cast<s16>(c_stick_y_f * MAX_CSTICK_RADIUS);
|
||||
|
||||
Core::Movie::GetInstance().HandleIrRst(state, c_stick_x, c_stick_y);
|
||||
system.Movie().HandleIrRst(state, c_stick_x, c_stick_y);
|
||||
|
||||
if (!raw_c_stick) {
|
||||
const HID::DirectionState direction = HID::GetStickDirectionState(c_stick_x, c_stick_y);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/unique_ptr.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include "common/string_util.h"
|
||||
#include "common/archives.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
|
@ -467,7 +467,7 @@ IR_USER::IR_USER(Core::System& system) : ServiceFramework("ir:USER", 1) {
|
|||
receive_event = system.Kernel().CreateEvent(ResetType::OneShot, "IR:ReceiveEvent");
|
||||
|
||||
extra_hid = std::make_unique<ExtraHID>([this](std::span<const u8> data) { PutToReceive(data); },
|
||||
system.CoreTiming());
|
||||
system.CoreTiming(), system.Movie());
|
||||
}
|
||||
|
||||
IR_USER::~IR_USER() {
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
#include <boost/crc.hpp>
|
||||
#include <cryptopp/osrng.h>
|
||||
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/shared_page.h"
|
||||
#include "core/hle/service/nfc/amiibo_crypto.h"
|
||||
#include "core/hle/service/nfc/nfc_device.h"
|
||||
#include "core/hw/aes/key.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
SERVICE_CONSTRUCT_IMPL(Service::NFC::NfcDevice)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/nim/nim_u.h"
|
||||
|
||||
SERVICE_CONSTRUCT_IMPL(Service::NIM::NIM_U)
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "core/hle/service/soc_u.h"
|
||||
#include "core/hle/service/ssl_c.h"
|
||||
#include "core/hle/service/y2r_u.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
namespace Service {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue