Fix file seeking of gba ROM and fix seeking behaviour of EMUFILE_FILE
This commit is contained in:
parent
262fc4f14a
commit
fca4afd7ce
|
@ -60,6 +60,8 @@ private:
|
||||||
u32 readRom(const u32 pos, const u8 size)
|
u32 readRom(const u32 pos, const u8 size)
|
||||||
{
|
{
|
||||||
if (!fROM) return 0xFFFFFFFF;
|
if (!fROM) return 0xFFFFFFFF;
|
||||||
|
|
||||||
|
fROM->fseek(pos, SEEK_SET);
|
||||||
|
|
||||||
u32 data = 0xFFFFFFFF;
|
u32 data = 0xFFFFFFFF;
|
||||||
u32 readed = fROM->fread(&data, size);
|
u32 readed = fROM->fread(&data, size);
|
||||||
|
|
|
@ -83,17 +83,19 @@ int EMUFILE_FILE::fseek(int offset, int origin)
|
||||||
{
|
{
|
||||||
if(mFilePosition == offset)
|
if(mFilePosition == offset)
|
||||||
{
|
{
|
||||||
return mFilePosition;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mCondition = eCondition_Clean;
|
mCondition = eCondition_Clean;
|
||||||
|
|
||||||
int pos = ::fseek(fp, offset, origin);
|
int ret = ::fseek(fp, offset, origin);
|
||||||
mPositionCacheEnabled = pos;
|
|
||||||
|
if(mPositionCacheEnabled)
|
||||||
return pos;
|
mFilePosition = ::ftell(fp);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue