mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-03 04:19:45 -06:00
Slight fixups with FATStorage
(#1934)
* Reload the SD card for `CartSD` and all subclasses * Make `ROMManager::LoadDLDISDCard` delegate to `GetDLDISDCardArgs` * Add a method overload for `CartSD::SetSDCard` * Initialize new SD card images with the correct size * Sync the old card to the host (if applicable) when move-assigning a new one * Only sync the old card to the host if it's not read-only * Remove static state in `FATStorage` - Replace `FF_ReadStorage` and `FF_WriteStorage` with lambda functions - Keep open and use the single `File` handle throughout the `FATStorage`'s life
This commit is contained in:
@ -196,12 +196,11 @@ bool EmuThread::UpdateConsole(UpdateConsoleNDSArgs&& ndsargs, UpdateConsoleGBAAr
|
||||
ndsargs = {};
|
||||
}
|
||||
|
||||
if (nextndscart && nextndscart->Type() == NDSCart::Homebrew)
|
||||
if (auto* cartsd = dynamic_cast<NDSCart::CartSD*>(nextndscart.get()))
|
||||
{
|
||||
// Load DLDISDCard will return nullopt if the SD card is disabled;
|
||||
// LoadDLDISDCard will return nullopt if the SD card is disabled;
|
||||
// SetSDCard will accept nullopt, which means no SD card
|
||||
auto& homebrew = static_cast<NDSCart::CartHomebrew&>(*nextndscart);
|
||||
homebrew.SetSDCard(ROMManager::LoadDLDISDCard());
|
||||
cartsd->SetSDCard(ROMManager::GetDLDISDCardArgs());
|
||||
}
|
||||
|
||||
std::unique_ptr<GBACart::CartCommon> nextgbacart;
|
||||
|
Reference in New Issue
Block a user