2014-10-29, 09:21 PM
Do you have any more information of table structure for CDs?
I haven't looked at the KF game specifically, but the process for loading data from the CD into RAM is usually fed three values: the data's starting sector (aka LBA) on the CD, it's destination address in RAM, and how many bytes to transfer.
To calculate the data's LBA location, the game loads a base LBA (which is the start location of the .T file), and then adds to that the value from the pertinent header entry. That makes the total equal the LBA location of the data the game wants to load. That LBA location is then fed to the function which loads the data to RAM.
I agree with the ToC idea, but I think the first 2 byte number isn't how many files there is, but actually how many entries are inside the table.
Yes, you're right. There could be many sub-tables inside the main .T 'archive' so it could contain many more files than are shown in the main ToC. If you go to the first location listed in RTMD.T's main ToC (ie 0x800), you'll see what looks to be another table (ie a sub- table) with 4 byte locations stored at patterned intervals. The sub-tables locations would most likely be relative to the beginning of the sub-file (ie 0x800 + 0x1A80 etc).
I haven't looked at the KF game specifically, but the process for loading data from the CD into RAM is usually fed three values: the data's starting sector (aka LBA) on the CD, it's destination address in RAM, and how many bytes to transfer.
To calculate the data's LBA location, the game loads a base LBA (which is the start location of the .T file), and then adds to that the value from the pertinent header entry. That makes the total equal the LBA location of the data the game wants to load. That LBA location is then fed to the function which loads the data to RAM.
I agree with the ToC idea, but I think the first 2 byte number isn't how many files there is, but actually how many entries are inside the table.
Yes, you're right. There could be many sub-tables inside the main .T 'archive' so it could contain many more files than are shown in the main ToC. If you go to the first location listed in RTMD.T's main ToC (ie 0x800), you'll see what looks to be another table (ie a sub- table) with 4 byte locations stored at patterned intervals. The sub-tables locations would most likely be relative to the beginning of the sub-file (ie 0x800 + 0x1A80 etc).