mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
diskio.c: use the correct error codes
This commit is contained in:
parent
f74d9ddfd7
commit
5880777e18
@ -171,18 +171,18 @@ DRESULT disk_read (
|
|||||||
if (type == TYPE_NONE) {
|
if (type == TYPE_NONE) {
|
||||||
return RES_PARERR;
|
return RES_PARERR;
|
||||||
} else if (type == TYPE_SDCARD) {
|
} else if (type == TYPE_SDCARD) {
|
||||||
if (sdmmc_sdcard_readsectors(sector, count, buff))
|
if (sdmmc_sdcard_readsectors(sector, count, buff) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else if (type == TYPE_IMAGE) {
|
} else if (type == TYPE_IMAGE) {
|
||||||
if (ReadImageSectors(buff, sector, count))
|
if (ReadImageSectors(buff, sector, count) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else if (type == TYPE_RAMDRV) {
|
} else if (type == TYPE_RAMDRV) {
|
||||||
if (ReadRamDriveSectors(buff, sector, count))
|
if (ReadRamDriveSectors(buff, sector, count) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else {
|
} else {
|
||||||
FATpartition* fat_info = PART_INFO(pdrv);
|
FATpartition* fat_info = PART_INFO(pdrv);
|
||||||
if (ReadNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type))
|
if (ReadNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
@ -208,18 +208,18 @@ DRESULT disk_write (
|
|||||||
if (type == TYPE_NONE) {
|
if (type == TYPE_NONE) {
|
||||||
return RES_PARERR;
|
return RES_PARERR;
|
||||||
} else if (type == TYPE_SDCARD) {
|
} else if (type == TYPE_SDCARD) {
|
||||||
if (sdmmc_sdcard_writesectors(sector, count, (BYTE *)buff))
|
if (sdmmc_sdcard_writesectors(sector, count, (BYTE *)buff) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else if (type == TYPE_IMAGE) {
|
} else if (type == TYPE_IMAGE) {
|
||||||
if (WriteImageSectors(buff, sector, count))
|
if (WriteImageSectors(buff, sector, count) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else if (type == TYPE_RAMDRV) {
|
} else if (type == TYPE_RAMDRV) {
|
||||||
if (WriteRamDriveSectors(buff, sector, count))
|
if (WriteRamDriveSectors(buff, sector, count) != 0)
|
||||||
return RES_PARERR;
|
return RES_ERROR;
|
||||||
} else {
|
} else {
|
||||||
FATpartition* fat_info = PART_INFO(pdrv);
|
FATpartition* fat_info = PART_INFO(pdrv);
|
||||||
if (WriteNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type))
|
if (WriteNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type) != 0)
|
||||||
return RES_PARERR; // unstubbed!
|
return RES_ERROR; // unstubbed!
|
||||||
}
|
}
|
||||||
|
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user