ExtractStream + new SVR2000 FIXED!
jeremyjgordonhome
jgordon at s...
Mon, 07 Jan 2002 10:01:35 -0000
> I've figured this out for an experimental ExtractStream that I
> wrote.
Great work! I have a much lamer formula that works, but I will try
switching over to your more elegant solution. Mine goes like this:
#define FSIDtoOffset(x) \
((((((long long)x) * 0x20db2) & 0x3ffff) + 0x462) << 9)
char buffer[512];
// attempt to seek where the FSID tells us to
if(!devices[deviceIndex]->Seek(FSIDtoOffset(fsid)))
return false;
// read data from the device
if(!devices[deviceIndex]->Read(buffer, sizeof(buffer)))
return false;
// check to see if this sector is good or not
if(!((*(unsigned long*)(buffer + 0x2c) == MAGIC_SIGNATURE) &&
(buffer[0x28] == 0x2) && (*(unsigned long*)buffer == fsid)))
{
// advance the device index
deviceIndex++;
// attempt to seek where the FSID tells us to
if(!devices[deviceIndex]->Seek(FSIDtoOffset(fsid) -
0x408c000 - 0x200))
return false;
...
I'll let you know how it works,
Regards,
Jeremy