summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-11-03 18:00:10 +0100
committershfil <filip.gawin@zoho.com>2020-11-06 18:42:28 +0100
commitf442793d201bd905c38c4861c564ba2896b8cd88 (patch)
tree71159d2380a384ad214ad59f5221bf6d7427758e /src
parentRwRenderStateGet (diff)
downloadre3-f442793d201bd905c38c4861c564ba2896b8cd88.tar
re3-f442793d201bd905c38c4861c564ba2896b8cd88.tar.gz
re3-f442793d201bd905c38c4861c564ba2896b8cd88.tar.bz2
re3-f442793d201bd905c38c4861c564ba2896b8cd88.tar.lz
re3-f442793d201bd905c38c4861c564ba2896b8cd88.tar.xz
re3-f442793d201bd905c38c4861c564ba2896b8cd88.tar.zst
re3-f442793d201bd905c38c4861c564ba2896b8cd88.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/CdStream.cpp9
-rw-r--r--src/core/CdStreamPosix.cpp2
-rw-r--r--src/core/config.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp
index c11fb72a..1d39aa52 100644
--- a/src/core/CdStream.cpp
+++ b/src/core/CdStream.cpp
@@ -242,8 +242,15 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
else
return STREAM_SUCCESS;
}
-
+
+#ifdef BIG_IMG
+ LARGE_INTEGER liDistanceToMove;
+ liDistanceToMove.QuadPart = _GET_OFFSET(offset);
+ liDistanceToMove.QuadPart *= CDSTREAM_SECTOR_SIZE;
+ SetFilePointerEx(hImage, liDistanceToMove, nil, FILE_BEGIN);
+#else
SetFilePointer(hImage, _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE, nil, FILE_BEGIN);
+#endif
DWORD NumberOfBytesRead;
diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp
index 5c8d1b16..35a90a74 100644
--- a/src/core/CdStreamPosix.cpp
+++ b/src/core/CdStreamPosix.cpp
@@ -429,7 +429,7 @@ void *CdStreamThread(void *param)
ASSERT(pChannel->hFile >= 0);
ASSERT(pChannel->pBuffer != nil );
- lseek(pChannel->hFile, pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE, SEEK_SET);
+ lseek(pChannel->hFile, (size_t)pChannel->nSectorOffset * (size_t)CDSTREAM_SECTOR_SIZE, SEEK_SET);
if (read(pChannel->hFile, pChannel->pBuffer, pChannel->nSectorsToRead * CDSTREAM_SECTOR_SIZE) == -1) {
// pChannel->nSectorsToRead == 0 at this point means we wanted to flush channel
// STREAM_WAITING is a little hack to make CStreaming not process this data
diff --git a/src/core/config.h b/src/core/config.h
index bdc5cd54..48e616bd 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -326,6 +326,8 @@ enum Config {
#endif
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
+// IMG
+#define BIG_IMG // allows to read larger img files
//#define SQUEEZE_PERFORMANCE
#ifdef SQUEEZE_PERFORMANCE