Fix FF_ReadStorage/FF_WriteStorage callback return value (#2400)

The return value for these callbacks is in sectors, not bytes.
This commit is contained in:
CasualPokePlayer
2025-08-10 04:51:46 -07:00
committed by GitHub
parent 90e7601c78
commit 18bffde207

View File

@ -192,14 +192,16 @@ u64 FATStorage::GetSectorCount() const
ff_disk_read_cb FATStorage::FF_ReadStorage() const noexcept ff_disk_read_cb FATStorage::FF_ReadStorage() const noexcept
{ {
return [this](BYTE* buf, LBA_t sector, UINT num) { return [this](BYTE* buf, LBA_t sector, UINT num) {
return ReadSectorsInternal(File, FileSize, sector, num, buf); u32 res = ReadSectorsInternal(File, FileSize, sector, num, buf);
return res / 0x200;
}; };
} }
ff_disk_write_cb FATStorage::FF_WriteStorage() const noexcept ff_disk_write_cb FATStorage::FF_WriteStorage() const noexcept
{ {
return [this](const BYTE* buf, LBA_t sector, UINT num) { return [this](const BYTE* buf, LBA_t sector, UINT num) {
return WriteSectorsInternal(File, FileSize, sector, num, buf); u32 res = WriteSectorsInternal(File, FileSize, sector, num, buf);
return res / 0x200;
}; };
} }