diff --git a/Runtime/CMemoryCardSys.cpp b/Runtime/CMemoryCardSys.cpp index 3ffc92acf..c8fdd042f 100644 --- a/Runtime/CMemoryCardSys.cpp +++ b/Runtime/CMemoryCardSys.cpp @@ -354,6 +354,19 @@ ECardResult CMemoryCardSys::MountCard(kabufuda::ECardSlot port) return result; } +ECardResult CMemoryCardSys::UnmountCard(kabufuda::ECardSlot port) +{ + kabufuda::Card& card = g_CardStates[int(port)]; + if (CardResult err = card.getError()) + { + g_OpResults[int(port)] = err; + return err; + } + card = kabufuda::Card(); + g_OpResults[int(port)] = ECardResult::READY; + return ECardResult::READY; +} + ECardResult CMemoryCardSys::CheckCard(kabufuda::ECardSlot port) { kabufuda::Card& card = g_CardStates[int(port)]; @@ -553,4 +566,10 @@ ECardResult CMemoryCardSys::FormatCard(kabufuda::ECardSlot port) return ECardResult::READY; } +void CMemoryCardSys::CommitToDisk(kabufuda::ECardSlot port) +{ + kabufuda::Card& card = g_CardStates[int(port)]; + card.commit(); +} + } diff --git a/Runtime/CMemoryCardSys.hpp b/Runtime/CMemoryCardSys.hpp index 30a390b16..250df948d 100644 --- a/Runtime/CMemoryCardSys.hpp +++ b/Runtime/CMemoryCardSys.hpp @@ -145,6 +145,7 @@ public: static kabufuda::ProbeResults CardProbe(kabufuda::ECardSlot port); static ECardResult MountCard(kabufuda::ECardSlot port); + static ECardResult UnmountCard(kabufuda::ECardSlot port); static ECardResult CheckCard(kabufuda::ECardSlot port); static ECardResult CreateFile(kabufuda::ECardSlot port, const char* name, u32 size, CardFileHandle& info); static ECardResult OpenFile(kabufuda::ECardSlot port, const char* name, CardFileHandle& info); @@ -161,6 +162,8 @@ public: static ECardResult FastDeleteFile(kabufuda::ECardSlot port, int fileNo); static ECardResult Rename(kabufuda::ECardSlot port, const char* oldName, const char* newName); static ECardResult FormatCard(kabufuda::ECardSlot port); + + static void CommitToDisk(kabufuda::ECardSlot port); }; } diff --git a/Runtime/CMemoryCardSysWin.cpp b/Runtime/CMemoryCardSysWin.cpp index a9fcafa46..71aef432e 100644 --- a/Runtime/CMemoryCardSysWin.cpp +++ b/Runtime/CMemoryCardSysWin.cpp @@ -1,5 +1,6 @@ #include "CMemoryCardSys.hpp" #include +#include namespace urde {