Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
final fantasy type-0 iso merge file issue
#17
In BlockDevices.cpp, try changing:

Code:
fseek(f, blockNumber * GetBlockSize(), SEEK_SET);

To:

Code:
fseeko(f, (off_t)blockNumber * (off_t)GetBlockSize(), SEEK_SET);

And:

Code:
fseek(f,0,SEEK_END); filesize = ftell(f);

To:

Code:
fseek(f,0,SEEK_END); filesize = ftello(f);

And also:

Code:
u32 idx = index[blockNumber]; u32 idx2 = index[blockNumber+1]; u8 inbuffer[4096]; //too big z_stream z; int plain = idx & 0x80000000; idx = (idx & 0x7FFFFFFF) << indexShift; idx2 = (idx2 & 0x7FFFFFFF) << indexShift; u32 compressedReadPos = idx; u32 compressedReadSize = idx2 - idx; fseek(f, compressedReadPos, SEEK_SET); u32 readSize = (u32)fread(inbuffer, 1, compressedReadSize, f);

To:

Code:
u32 idx = index[blockNumber]; u32 idx2 = index[blockNumber+1]; u8 inbuffer[4096]; //too big z_stream z; int plain = idx & 0x80000000; off_t compressedReadPos = (idx & 0x7FFFFFFF) << indexShift; off_t compressedReadEnd = ((idx2 & 0x7FFFFFFF) << indexShift); off_t compressedReadSize = compressedReadEnd - compressedReadPos; fseeko(f, compressedReadPos, SEEK_SET); u32 readSize = (u32)fread(inbuffer, 1, compressedReadSize, f);

Does that make it work with iso and cso (make sure you're running a 64-bit build, it probably won't work with 32-bit)? If not, it probably takes just a bit more than that.

-[Unknown]
Reply


Messages In This Thread
RE: final fantasy type-0 iso merge file issue - by [Unknown] - 12-28-2013, 06:01 PM

Forum Jump: