17#include "../FileSystemDriver.h"
18#include "OgcSmbDriver.h"
19#include <ogc/disc_io.h>
27 DISC_INTERFACE * (*getDisc)();
48 void pollStorageDevices(
int removedIds[MAX_STORAGE_DEVICES],
int & outRemovedCount,
bool & deviceListChanged)
override;
Storage device enumeration/mount/poll backend for the SD/USB/DVD file browser.
Shared GameCube/Wii FileSystemDriver base: FAT slot enumeration, mounting and polling.
bool isMounted[MAX_STORAGE_DEVICES]
A filesystem is currently mounted for this device.
MountResult attemptFatMount(int deviceId)
Single mountFAT() attempt that also records the outcome in mountFailed.
bool isDevicePresent(int deviceId) const override
Lightweight, cached hardware-presence check for a single device - does NOT mount and does no invasive...
MountResult mountFAT(int deviceId)
Mounts the FAT filesystem on a slot with fatMountSimple(), unmounting first if unmountRequired is set...
void pollStorageDevices(int removedIds[MAX_STORAGE_DEVICES], int &outRemovedCount, bool &deviceListChanged) override
Called once per device-checking thread cycle.
bool unmountRequired[MAX_STORAGE_DEVICES]
A stale mount must be torn down before the next mount attempt.
const OgcFatSlotDescriptor * fatSlots
Table of FAT slots this platform supports; set by the concrete driver.
char volumeLabel[MAX_STORAGE_DEVICES][16]
Volume label cached for each device.
void initFatSlotsAndAutoMount()
Runs the shared boot-time pass: probe every pollable fatSlots[] entry once for isPresentCache,...
bool hasRemovableStorageDevices() const override
Whether the device-checking thread should run on this platform.
const char * unsupportedFormatMessage
Text returned by mountResultMessage() when a present device fails to mount.
bool labelFetched[MAX_STORAGE_DEVICES]
fetched since the last mount/removal - see mountFAT()/invalidateStorageDevice()
virtual void prepareMount(int deviceId)
Platform-specific work that must run immediately before a user-initiated mount attempt on deviceId,...
const char * getMountPath(int device) const override
devoptab-style mount path for device (eg.
const OgcFatSlotDescriptor * findFatSlot(int deviceId) const
int fatSlotCount
Number of entries in fatSlots.
DISC_INTERFACE * dvdDisc
Disc interface used to mount the DVD drive, or nullptr if the platform has none.
const char * getDevicePrefix(int device) const override
The devoptab prefix this device would use (eg.
void shutdown() override
Unmounts every device and releases the driver's resources.
bool mountFailed[MAX_STORAGE_DEVICES]
set by a real MountFailed; cleared on removal/reinsertion - see attemptFatMount()
SmbDriver * getSmb() override
OgcSmbDriver smbDriver
The network-share driver returned by getSmb()
const char * mountResultMessage(int deviceId, MountResult result) override
A short, user-displayable reason for a non-Success MountResult (eg.
virtual bool pollPlatformExtra()
Platform-specific extra polling that must run before the shared per-slot presence check (eg.
virtual void shutdownPlatform()
Platform-specific extra teardown beyond the shared per-slot fatUnmount() pass (eg.
MountResult mountDVD()
Mounts the DVD as ISO9660 if a disc is inserted.
MountResult mountStorageDevice(int deviceId) override
Attempts to mount deviceId exactly once.
int enumerateStorageDevices(StorageDevice outDevices[MAX_STORAGE_DEVICES]) override
Fills outDevices (size MAX_STORAGE_DEVICES) and returns the device count.
bool isPresentCache[MAX_STORAGE_DEVICES]
raw hardware insertion only - see isDevicePresent()'s comment for why this is no longer what it retur...
void invalidateStorageDevice(int deviceId) override
Marks deviceId as needing a fresh mount next time mountStorageDevice() is called, eg.
Wraps libsmb2 behind a "smb:/" devoptab.
MountResult
Result of a single mount attempt.
One hot-pluggable FAT-formatted slot, shared shape between GameCube (SD Gecko A/B/port2,...
bool autoMountAtStartup
Mounted silently at boot.
const char * notFoundMessage
eg.
const char * displayName
Short name shown in device lists.
bool pollable
true: probed every pollStorageDevices() cycle
bool removable
advisory only - not currently read by app code
const char * prefix
precomputed "name:/" literal - returned by getMountPath()/enumerateStorageDevices() as-is
int deviceId
Device enum value this slot mounts (DEVICE_SD, DEVICE_USB, ...)
const char * mountName
devoptab basename, no colon/slash - eg.
Description of one storage device: id, display name, mount prefix, volume label and flags such as rem...