mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
Handle Amiibo tag events better
This commit is contained in:
parent
cf54fd6d1d
commit
5930a3d843
2 changed files with 17 additions and 1 deletions
|
@ -72,7 +72,15 @@ public:
|
||||||
|
|
||||||
// Signals an event, returns true on success or false if the event does not exist
|
// Signals an event, returns true on success or false if the event does not exist
|
||||||
bool signalEvent(Handle e);
|
bool signalEvent(Handle e);
|
||||||
private:
|
|
||||||
|
void clearEvent(Handle e) {
|
||||||
|
KernelObject* object = getObject(e, KernelObjectType::Event);
|
||||||
|
if (object != nullptr) {
|
||||||
|
object->getData<Event>()->fired = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
void signalArbiter(u32 waitingAddress, s32 threadCount);
|
void signalArbiter(u32 waitingAddress, s32 threadCount);
|
||||||
void sleepThread(s64 ns);
|
void sleepThread(s64 ns);
|
||||||
void sleepThreadOnArbiter(u32 waitingAddress);
|
void sleepThreadOnArbiter(u32 waitingAddress);
|
||||||
|
|
|
@ -70,6 +70,14 @@ bool NFCService::loadAmiibo(const std::filesystem::path& path) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tagOutOfRangeEvent.has_value()) {
|
||||||
|
kernel.clearEvent(tagOutOfRangeEvent.value());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tagInRangeEvent.has_value()) {
|
||||||
|
kernel.signalEvent(tagInRangeEvent.value());
|
||||||
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue