core: De-globalize HLE lock (#7212)

This commit is contained in:
GPUCode 2023-11-29 00:15:27 +02:00 committed by GitHub
parent 83b329f6e1
commit 6ec079ede8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 66 additions and 92 deletions

View file

@ -5,8 +5,6 @@
#include "common/archives.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
#include "core/hle/lock.h"
#include "core/hle/service/nfc/nfc.h"
#include "core/hle/service/nfc/nfc_m.h"
#include "core/hle/service/nfc/nfc_u.h"
@ -680,26 +678,21 @@ std::shared_ptr<Module> Module::Interface::GetModule() const {
}
bool Module::Interface::IsSearchingForAmiibos() {
std::lock_guard lock(HLE::g_hle_lock);
const auto state = nfc->device->GetCurrentState();
return state == DeviceState::SearchingForTag;
}
bool Module::Interface::IsTagActive() {
std::lock_guard lock(HLE::g_hle_lock);
const auto state = nfc->device->GetCurrentState();
return state == DeviceState::TagFound || state == DeviceState::TagMounted ||
state == DeviceState::TagPartiallyMounted;
}
bool Module::Interface::LoadAmiibo(const std::string& fullpath) {
std::lock_guard lock(HLE::g_hle_lock);
return nfc->device->LoadAmiibo(fullpath);
}
void Module::Interface::RemoveAmiibo() {
std::lock_guard lock(HLE::g_hle_lock);
nfc->device->UnloadAmiibo();
}

View file

@ -4,12 +4,10 @@
#pragma once
#include <atomic>
#include <memory>
#include <boost/serialization/binary_object.hpp>
#include "common/common_types.h"
#include "core/hle/service/nfc/nfc_device.h"
#include "core/hle/service/nfc/nfc_types.h"
#include "core/hle/service/service.h"
namespace Core {