mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-22 21:15:57 +00:00
fix(runtime): clean amiibo platform portability, default path, and dump validation
This commit is contained in:
1 parent
7d62cbfa85
commit
2bcfc2ef39
13 files changed
+1116
-26
No files matched your search
+7
-5
@@ -357,21 +357,23 @@ static void probe_applet(void) {
|
||||
"AddInternetConnectionStatus");
|
||||
CHECK(CALL("nfp.Initialize", 0) == 0 && (uint32_t)CALL("nfp.GetState", 0) == 1, "nfp initialize");
|
||||
uint8_t handles[64];
|
||||
int32_t count = 7;
|
||||
CHECK((uint32_t)CALL("nfp.ListDevices", U(handles), U(&count), 4) == 0x8073 && count == 0, "nfp ListDevices");
|
||||
int32_t count = 0;
|
||||
CHECK((uint32_t)CALL("nfp.ListDevices", U(handles), U(&count), 4) == 0 && count == 1, "nfp ListDevices");
|
||||
uint64_t ev = U(guest_alloc(0x100));
|
||||
CHECK(CALL("nfp.AttachAvailabilityChangeEvent", ev) == 0, "AttachAvailabilityChangeEvent");
|
||||
int nfp_event = event_works(ev, 0);
|
||||
CHECK(nfp_event, "the nfp availability event does not work as a manual-clear system event");
|
||||
CHECK((uint32_t)CALL("nfp.GetDeviceState", U(handles)) == 0, "nfp device state");
|
||||
static const char *const none[] = {"nfp.Mount", "nfp.GetNpadId", "nfp.AttachActivateEvent", "nfp.AttachDeactivateEvent",
|
||||
"nfp.StartDetection", "nfp.StopDetection", "nfp.GetTagInfo", "nfp.GetModelInfo"};
|
||||
static const char *const none[] = {"nfp.Mount", "nfp.GetTagInfo", "nfp.GetModelInfo"};
|
||||
uint8_t out[0x100];
|
||||
for (size_t i = 0; i < sizeof none / sizeof *none; i++) {
|
||||
int first_is_handle = !strcmp(none[i], "nfp.Mount") || strstr(none[i], "Detection");
|
||||
int first_is_handle = !strcmp(none[i], "nfp.Mount");
|
||||
uint64_t r = first_is_handle ? CALL(none[i], U(handles), 0, 0) : CALL(none[i], U(out), U(handles));
|
||||
CHECK((uint32_t)r == 0x8073, "%s: %#x, not device-not-found", none[i], (uint32_t)r);
|
||||
}
|
||||
CHECK((uint32_t)CALL("nfp.GetNpadId", U(out), U(handles)) == 0, "nfp GetNpadId");
|
||||
CHECK((uint32_t)CALL("nfp.StartDetection", U(handles)) == 0, "nfp StartDetection");
|
||||
CHECK((uint32_t)CALL("nfp.StopDetection", U(handles)) == 0, "nfp StopDetection");
|
||||
CHECK(CALL("nfp.Finalize", 0) == 0 && (uint32_t)CALL("nfp.GetState", 0) == 0, "nfp finalize");
|
||||
CALL("err.ShowError", 0x2a8);
|
||||
CALL("nndiagStartup", 0);
|
||||
|
||||
Reference in new issue
Block a user