mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
Add amiibo loading interface
This commit is contained in:
parent
f52337f90c
commit
3110da1fd6
5 changed files with 22 additions and 2 deletions
|
@ -43,6 +43,8 @@ void NFCService::handleSyncRequest(u32 messagePointer) {
|
|||
}
|
||||
}
|
||||
|
||||
bool NFCService::loadAmiibo(const std::filesystem::path& path) { return true; }
|
||||
|
||||
void NFCService::initialize(u32 messagePointer) {
|
||||
const u8 type = mem.read8(messagePointer + 4);
|
||||
log("NFC::Initialize (type = %d)\n", type);
|
||||
|
|
|
@ -353,7 +353,14 @@ void Emulator::run() {
|
|||
char* droppedDir = event.drop.file;
|
||||
|
||||
if (droppedDir) {
|
||||
loadROM(droppedDir);
|
||||
const std::filesystem::path path(droppedDir);
|
||||
|
||||
if (path.extension() == ".amiibo") {
|
||||
loadAmiibo(path);
|
||||
} else {
|
||||
loadROM(path);
|
||||
}
|
||||
|
||||
SDL_free(droppedDir);
|
||||
}
|
||||
break;
|
||||
|
@ -478,6 +485,11 @@ bool Emulator::loadROM(const std::filesystem::path& path) {
|
|||
return success;
|
||||
}
|
||||
|
||||
bool Emulator::loadAmiibo(const std::filesystem::path& path) {
|
||||
NFCService& nfc = kernel.getServiceManager().getNFC();
|
||||
return nfc.loadAmiibo(path);
|
||||
}
|
||||
|
||||
// Used for loading both CXI and NCSD files since they are both so similar and use the same interface
|
||||
// (We promote CXI files to NCSD internally for ease)
|
||||
bool Emulator::loadNCSD(const std::filesystem::path& path, ROMType type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue