mirror of https://github.com/PCSX2/pcsx2.git
cdvdgigaherz: Rename variables/parameters in cdvdDirectReadSector
s/sector/sector_block s/first/sector
This commit is contained in:
parent
3f89f4bd32
commit
c1160f40d0
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue