cdvdgigaherz: Rename variables/parameters in cdvdDirectReadSector

s/sector/sector_block
s/first/sector
This commit is contained in:
Jonathan Li 2016-12-17 14:18:10 +00:00
parent 3f89f4bd32
commit c1160f40d0
2 changed files with 9 additions and 9 deletions

View File

@ -115,7 +115,7 @@ bool cdvdStartThread();
void cdvdStopThread();
s32 cdvdRequestSector(u32 sector, s32 mode);
u8 *cdvdGetSector(u32 sector, s32 mode);
s32 cdvdDirectReadSector(u32 first, s32 mode, u8 *buffer);
s32 cdvdDirectReadSector(u32 sector, s32 mode, u8 *buffer);
s32 cdvdGetMediaType();
s32 cdvdRefreshData();
void cdvdParseTOC();

View File

@ -297,28 +297,28 @@ u8 *cdvdGetSector(u32 sector, s32 mode)
return data;
}
s32 cdvdDirectReadSector(u32 first, s32 mode, u8 *buffer)
s32 cdvdDirectReadSector(u32 sector, s32 mode, u8 *buffer)
{
static u8 data[2352 * sectors_per_read];
if (first >= src->GetSectorCount())
if (sector >= src->GetSectorCount())
return -1;
// Align to cache block
u32 sector = first & ~(sectors_per_read - 1);
u32 sector_block = sector & ~(sectors_per_read - 1);
if (!cdvdCacheFetch(sector, mode, data)) {
if (cdvdReadBlockOfSectors(sector, mode, data))
cdvdCacheUpdate(sector, mode, data);
if (!cdvdCacheFetch(sector_block, mode, data)) {
if (cdvdReadBlockOfSectors(sector_block, mode, data))
cdvdCacheUpdate(sector_block, mode, data);
}
if (mode == CDVD_MODE_2048) {
u32 offset = 2048 * (first - sector);
u32 offset = 2048 * (sector - sector_block);
memcpy(buffer, data + offset, 2048);
return 0;
}
u32 offset = 2352 * (first - sector);
u32 offset = 2352 * (sector - sector_block);
u8 *bfr = data + offset;
switch (mode) {