diff --git a/pcsx2/CDVD/IsoFS/IsoFile.cpp b/pcsx2/CDVD/IsoFS/IsoFile.cpp
index dc34670964..6d1f87e8e1 100644
--- a/pcsx2/CDVD/IsoFS/IsoFile.cpp
+++ b/pcsx2/CDVD/IsoFS/IsoFile.cpp
@@ -17,15 +17,19 @@ IsoFile::IsoFile(SectorSource* reader, IsoFileDescriptor fileEntry)
reader->readSector(currentSector,currentSectorNumber);
}
-void IsoFile::seek(__int64 offset)
+void IsoFile::seek(s64 offset)
{
- __int64 endOffset = offset;
-
+ s64 endOffset = offset;
+
+#ifdef __LINUX__
+ if (offset<0) throw "Seek offset out of bounds.";
+#else
if(offset<0)
- throw new exception("Seek offset out of bounds.");
+ throw new exception("Seek offset out of bounds.");
+#endif
int oldSectorNumber = currentSectorNumber;
- __int64 newOffset = endOffset;
+ s64 newOffset = endOffset;
int newSectorNumber = fileEntry.lba + (int)(newOffset / sectorLength);
if(oldSectorNumber != newSectorNumber)
{
@@ -36,7 +40,7 @@ void IsoFile::seek(__int64 offset)
sectorOffset = (int)(currentOffset % sectorLength);
}
-void IsoFile::seek(__int64 offset, int ref_position)
+void IsoFile::seek(s64 offset, int ref_position)
{
if(ref_position == SEEK_SET)
seek(offset);
@@ -53,9 +57,9 @@ void IsoFile::reset()
seek(0);
}
-__int64 IsoFile::skip(__int64 n)
+s64 IsoFile::skip(s64 n)
{
- __int64 oldOffset = currentOffset;
+ s64 oldOffset = currentOffset;
if(n<0)
return n;
@@ -65,7 +69,7 @@ __int64 IsoFile::skip(__int64 n)
return currentOffset-oldOffset;
}
-__int64 IsoFile::getFilePointer()
+s64 IsoFile::getFilePointer()
{
return currentOffset;
}
@@ -197,7 +201,7 @@ wstring IsoFile::readLineW()
return s;
}
-__int64 IsoFile::getLength()
+s64 IsoFile::getLength()
{
return maxOffset;
}
@@ -207,7 +211,7 @@ const IsoFileDescriptor& IsoFile::getEntry()
return fileEntry;
}
-IsoFile::~IsoFile(void)
+IsoFile::~IsoFile(void)
{
}
diff --git a/pcsx2/CDVD/IsoFS/IsoFile.h b/pcsx2/CDVD/IsoFS/IsoFile.h
index 4ebc457857..4ff0d41b37 100644
--- a/pcsx2/CDVD/IsoFS/IsoFile.h
+++ b/pcsx2/CDVD/IsoFS/IsoFile.h
@@ -11,8 +11,8 @@ public:
private:
IsoFileDescriptor fileEntry;
- __int64 currentOffset;
- __int64 maxOffset;
+ s64 currentOffset;
+ s64 maxOffset;
int currentSectorNumber;
byte currentSector[sectorLength];
@@ -27,12 +27,12 @@ public:
IsoFile(SectorSource* reader, IsoFileDescriptor fileEntry);
- void seek(__int64 offset);
- void seek(__int64 offset, int ref_position);
+ void seek(s64 offset);
+ void seek(s64 offset, int ref_position);
void reset();
- __int64 skip(__int64 n);
- __int64 getFilePointer();
+ s64 skip(s64 n);
+ s64 getFilePointer();
bool eof();
int read();
@@ -55,9 +55,9 @@ public:
std::string readLine(); // Assume null-termination
std::wstring readLineW(); // (this one too)
- __int64 getLength();
+ s64 getLength();
const IsoFileDescriptor& getEntry();
-
+
~IsoFile(void);
};
diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp
index 11e0e0d4d3..45b1b4f30d 100644
--- a/pcsx2/Elfheader.cpp
+++ b/pcsx2/Elfheader.cpp
@@ -19,8 +19,8 @@
//#include "CDVD/IsoFSdrv.h"
#include "DebugTools/Debug.h"
#include "GS.h" // for sending game crc to mtgs
-#include "cdvd/isofs/isofscdvd.h"
-#include "cdvd/isofs/isofs.h"
+#include "CDVD/IsoFS/IsoFSCDVD.h"
+#include "CDVD/IsoFS/IsoFS.h"
using namespace std;
extern void InitPatch(wxString crc);
@@ -336,7 +336,6 @@ struct ElfObject
int size = file.getLength();
- char buffer[256]; //if the file is longer...it should be shorter :D
rsize = file.read((u8*)data.GetPtr(), data.GetSizeInBytes());
//if (fi < 0) throw Exception::FileNotFound( filename );
@@ -568,9 +567,8 @@ void loadElfFile(const wxString& filename)
{
IsoFSCDVD isofs;
IsoDirectory fsroot(&isofs);
- u32 crcval = 0;
- Console.WriteLn("loadElfCRC: %s", filename);
+ Console.WriteLn(L"loadElfCRC: " + filename);
desc = fsroot.FindFile(fnptr + strlen( "cdromN:" ));
}
@@ -634,9 +632,7 @@ void loadElfFile(const wxString& filename)
// 2 - PS2 CD
int GetPS2ElfName( wxString& name )
{
- int f;
char buffer[g_MaxPath];//if a file is longer...it should be shorter :D
- char *pos;
try {
IsoFSCDVD isofs;
diff --git a/pcsx2/Linux/pcsx2.cbp b/pcsx2/Linux/pcsx2.cbp
index 034aae8564..0e547f486b 100644
--- a/pcsx2/Linux/pcsx2.cbp
+++ b/pcsx2/Linux/pcsx2.cbp
@@ -1,473 +1,476 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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