mirror of
https://github.com/citra-emu/citra-nightly.git
synced 2025-10-04 22:57:08 +00:00
Fixes
This commit is contained in:
parent
dc16827dc4
commit
0f87d25f47
|
@ -44,6 +44,7 @@
|
||||||
#include "citra_qt/util/clickable_label.h"
|
#include "citra_qt/util/clickable_label.h"
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
#include "common/detached_tasks.h"
|
#include "common/detached_tasks.h"
|
||||||
|
#include "common/file_util.h"
|
||||||
#include "common/logging/backend.h"
|
#include "common/logging/backend.h"
|
||||||
#include "common/logging/filter.h"
|
#include "common/logging/filter.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
@ -1278,7 +1279,10 @@ void GMainWindow::OnLoadAmiibo() {
|
||||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||||
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
|
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
|
||||||
if (nfc != nullptr) {
|
if (nfc != nullptr) {
|
||||||
nfc->LoadAmiibo(filename.toStdString());
|
Service::NFC::AmiiboData amiibo_data{};
|
||||||
|
auto nfc_file = FileUtil::IOFile(filename.toStdString(), "rb");
|
||||||
|
nfc_file.ReadBytes(&amiibo_data, sizeof(Service::NFC::AmiiboData));
|
||||||
|
nfc->LoadAmiibo(amiibo_data);
|
||||||
ui.action_Remove_Amiibo->setEnabled(true);
|
ui.action_Remove_Amiibo->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,11 +97,12 @@ void Module::Interface::StartTagScanning(Kernel::HLERequestContext& ctx) {
|
||||||
void Module::Interface::GetTagInfo(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetTagInfo(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp(ctx, 0x11, 0, 0);
|
IPC::RequestParser rp(ctx, 0x11, 0, 0);
|
||||||
|
|
||||||
ResultCode result = RESULT_SUCCESS;
|
|
||||||
if (nfc->nfc_tag_state != TagState::TagInRange &&
|
if (nfc->nfc_tag_state != TagState::TagInRange &&
|
||||||
nfc->nfc_tag_state != TagState::TagDataLoaded && nfc->nfc_tag_state != TagState::Unknown6) {
|
nfc->nfc_tag_state != TagState::TagDataLoaded && nfc->nfc_tag_state != TagState::Unknown6) {
|
||||||
result = ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
ErrorSummary::InvalidState, ErrorLevel::Status);
|
rb.Push(ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
||||||
|
ErrorSummary::InvalidState, ErrorLevel::Status));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TagInfo tag_info{};
|
TagInfo tag_info{};
|
||||||
|
@ -113,7 +114,7 @@ void Module::Interface::GetTagInfo(Kernel::HLERequestContext& ctx) {
|
||||||
tag_info.unk2 = 0x2;
|
tag_info.unk2 = 0x2;
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(12, 0);
|
IPC::RequestBuilder rb = rp.MakeBuilder(12, 0);
|
||||||
rb.Push(result);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushRaw<TagInfo>(tag_info);
|
rb.PushRaw<TagInfo>(tag_info);
|
||||||
LOG_WARNING(Service_NFC, "(STUBBED) called");
|
LOG_WARNING(Service_NFC, "(STUBBED) called");
|
||||||
}
|
}
|
||||||
|
@ -202,26 +203,28 @@ void Module::Interface::CommunicationGetStatus(Kernel::HLERequestContext& ctx) {
|
||||||
void Module::Interface::Unknown0x1A(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::Unknown0x1A(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp(ctx, 0x1A, 0, 0);
|
IPC::RequestParser rp(ctx, 0x1A, 0, 0);
|
||||||
|
|
||||||
ResultCode result = RESULT_SUCCESS;
|
|
||||||
if (nfc->nfc_tag_state != TagState::TagInRange) {
|
if (nfc->nfc_tag_state != TagState::TagInRange) {
|
||||||
result = ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
ErrorSummary::InvalidState, ErrorLevel::Status);
|
rb.Push(ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
||||||
} else {
|
ErrorSummary::InvalidState, ErrorLevel::Status));
|
||||||
nfc->nfc_tag_state = TagState::Unknown6;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nfc->nfc_tag_state = TagState::Unknown6;
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
rb.Push(result);
|
rb.Push(RESULT_SUCCESS);
|
||||||
LOG_DEBUG(Service_NFC, "called");
|
LOG_DEBUG(Service_NFC, "called");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::Interface::GetIdentificationBlock(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetIdentificationBlock(Kernel::HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp(ctx, 0x1B, 0, 0);
|
IPC::RequestParser rp(ctx, 0x1B, 0, 0);
|
||||||
|
|
||||||
ResultCode result = RESULT_SUCCESS;
|
|
||||||
if (nfc->nfc_tag_state != TagState::TagDataLoaded && nfc->nfc_tag_state != TagState::Unknown6) {
|
if (nfc->nfc_tag_state != TagState::TagDataLoaded && nfc->nfc_tag_state != TagState::Unknown6) {
|
||||||
result = ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
ErrorSummary::InvalidState, ErrorLevel::Status);
|
rb.Push(ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC,
|
||||||
|
ErrorSummary::InvalidState, ErrorLevel::Status));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentificationBlockReply identification_block_reply{};
|
IdentificationBlockReply identification_block_reply{};
|
||||||
|
@ -234,7 +237,7 @@ void Module::Interface::GetIdentificationBlock(Kernel::HLERequestContext& ctx) {
|
||||||
nfc->amiibo_data_mutex.unlock();
|
nfc->amiibo_data_mutex.unlock();
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(0x1F, 0);
|
IPC::RequestBuilder rb = rp.MakeBuilder(0x1F, 0);
|
||||||
rb.Push(result);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushRaw<IdentificationBlockReply>(identification_block_reply);
|
rb.PushRaw<IdentificationBlockReply>(identification_block_reply);
|
||||||
LOG_DEBUG(Service_NFC, "called");
|
LOG_DEBUG(Service_NFC, "called");
|
||||||
}
|
}
|
||||||
|
@ -248,10 +251,9 @@ std::shared_ptr<Module> Module::Interface::GetModule() const {
|
||||||
return nfc;
|
return nfc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::Interface::LoadAmiibo(const std::string& filename) {
|
void Module::Interface::LoadAmiibo(const AmiiboData& amiibo_data) {
|
||||||
auto nfc_file = FileUtil::IOFile(filename, "rb");
|
|
||||||
nfc->amiibo_data_mutex.lock();
|
nfc->amiibo_data_mutex.lock();
|
||||||
nfc_file.ReadBytes(&nfc->amiibo_data, sizeof(AmiiboData));
|
nfc->amiibo_data = amiibo_data;
|
||||||
nfc->amiibo_data_mutex.unlock();
|
nfc->amiibo_data_mutex.unlock();
|
||||||
nfc->nfc_tag_state = Service::NFC::TagState::TagInRange;
|
nfc->nfc_tag_state = Service::NFC::TagState::TagInRange;
|
||||||
nfc->tag_in_range_event->Signal();
|
nfc->tag_in_range_event->Signal();
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
|
|
||||||
std::shared_ptr<Module> GetModule() const;
|
std::shared_ptr<Module> GetModule() const;
|
||||||
|
|
||||||
void LoadAmiibo(const std::string& filename);
|
void LoadAmiibo(const AmiiboData& amiibo_data);
|
||||||
|
|
||||||
void RemoveAmiibo();
|
void RemoveAmiibo();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue