Fixed a bunch of code inconsistencies

This commit is contained in:
2026-08-31 07:02:19 -05:00
parent 320c5e6ce5
commit fcf0de72af
30 changed files with 1033 additions and 619 deletions
@@ -97,6 +97,33 @@ bool_t saveDeviceDolphinCardHasFreeSpace(const int32_t channel);
*/
errorret_t saveDeviceDolphinCardDispose(savedevice_t *device);
// One probe result for one of the two ping-pong slots.
typedef struct {
bool_t valid;
uint32_t generation;
uint8_t *buffer;// only set if keepBuffer was requested, else NULL
uint32_t len;
} savedevicedolphincardslot_t;
/**
* Opens the given card file (if it exists) and validates it as a raw save
* blob via saveDeviceRawIsValid(). CARD_Read requires a 32-byte aligned
* buffer, so the read (and any buffer kept for the caller) uses memoryAlign
* rather than memoryAllocate. If keepBuffer is false, or the file doesn't
* exist/validate, no buffer is left allocated.
*
* @param channel The CARD slot (CARD_SLOTA or CARD_SLOTB) to probe.
* @param filename The card file name to open.
* @param keepBuffer Whether to keep the read buffer allocated on success.
* @return The probe result - valid is false if the file doesn't exist or
* doesn't validate as a raw save blob.
*/
savedevicedolphincardslot_t saveDeviceDolphinCardProbeSlot(
const int32_t channel,
const char_t *filename,
const bool_t keepBuffer
);
/**
* Writes the combined save data blob out to whichever of the two fixed
* card files (see SAVE_DEVICE_DOLPHIN_CARD_FILENAME_0/1 above) is not