Time for an update ...
As you, Dear Reader, may have seen, the font hacks that I took screen grabs of a few weeks ago are now properly integrated into the CD on both Xanadu 1 and Xanadu 2.
That's taken a fair bit of behind-the-scenes messing around to actually locate/extract the different code overlays for both games and then put together a PCEAS framework to let me modify them all and then reinsert them into the CD image.
Part of that has involved the discovery of how both games actually locate the files that they're loading from CD.
***************
They're both using a 2KB "directory" structure that's loaded as part of the IPL sectors and is then kept permanently in memory.
They're then referring to files by a 2 byte code when they want to load them ...
The 1st byte is a file type "X" for executable, "Z" for compressed META-BLOCK, and "A" for something else (presumably audio).
The 2nd byte is a binary number, and seemingly refers to the game section.
For instance, in Xanadu 1, the "Main Menu" is actually made up of 3 files "X00", "A00" and "Z00".
It also makes it really clear that there's a single "game" overlay, and 12 different sets of META-BLOCKs for each level ...
"X10", "Z10", "Z11", "Z12", "Z13", "Z14", "Z15", "Z16", "Z17", "Z18", "Z19", "Z1A", and "Z1B".
It's an interesting discovery ... and I wish that I'd found it a long time ago.
Having a list of files like this makes it a lot easier to see how the game is put together.
It also shows that there's a
lot of the game that we've not touched at all, yet!
***************
One nice side-effect of finding where the directory structure actually lives when it's loaded into in memory, is that there's enough free space in that bank for the English font, rather than just putting it in the space that I'm freeing up by recompressing the game data.
That's going to be really important on Xanadu 2, because the META-BLOCKs in that game just won't shrink down as much, and I'm already worried if there's going to be enough memory.
***************
Which leads on to the compression/decompression.
I've got a 1st-version of the SWD5 decompressor for the PCE, and I've managed to squeeze it down into being a few bytes shorter that the FALCOM1 decompression code, so it can just live in the same location and overwrite the old code.
I've also hacked the SWD5 format so that it can automatically decompress some data into a different block after it decompresses a script chunk.
That seems like the easiest way to get the game to allow SamIAm's translated script chunks to expand in size and overflow into the space that we're creating by recompressing all those game files.
Now that I've found the directory structure, I'm in the position of being able to rewrite all those old files in the new compression format ... and hope that it all doesn't just blow-up!
That's the next task.
***************
Anyway, for anyone that's interested in a challenge, here are the directories for Xanadu 1 & 2.
See if you can guess which groups of files are for the Main Menu, the Cinemas, the Top-Down Game, the Side-Scrolling Game, the Boss fights, etc.
***************
Xanadu 1 Files ...
X00, A00, Z00,
X01, Z01,
X02, Z02,
X03, Z03, A03,
X04, Z04, A04,
X05, Z05, A05,
X06, Z06, A06,
X10, Z10, Z11, Z12, Z13, Z14, Z15, Z16, Z17, Z18, Z19, Z1A, Z1B,
X30,
Z30, A40, A50, A60,
Z31, A41, A51, A61,
Z32, A42, A52, A62, A72, A82,
Z33, A43, A53, A63,
Z34, A44, A54, A64,
Z35, A45, A55, A65,
Z36, A46, A56, A66,
Z37, A47, A57, A67,
Z38, A48, A58, A68,
Z39, A49, A59,
Z3A, A4A, A5A, A6A, A7A,
Z3B, A4B, A5B,
Z3C, A4C, A5C,
X20, Z20, A20,
X21, Z21, A21,
X22, Z22, A22,
X23, Z23, A23, A33,
X24, Z24, A24,
X25, Z25, A25,
X26, Z26, A26,
X27, Z27, A27,
X28, Z28, A28,
X29, Z29, A29,
X2A, Z2A, A2A,
X2B, Z2B,***************
Xanadu 2 Files ...
XF0, ZF0,
X10, Z90, Z0F, A0F,
Z00, Z01, Z02,
Z10, Z11, Z12, Z13, Z14, Z15, Z16, Z17,
Z20, Z21, Z22, Z23, Z24, Z25, Z26, Z27,
Z30, Z31, Z32, Z33, Z34, Z35, Z36, Z37,
Z40, Z41, Z42, Z43, Z44, Z45, Z46, Z47, Z48, Z49,
Z50, Z51, Z52, Z53, Z54, Z55, Z56, Z57,
Z60, Z61, Z62, Z63, Z64, Z65, Z66,
Z70, Z71, Z72, Z73, Z74, Z75, Z76,
Z80, Z81, Z82, Z83, Z84, Z85,
A15,
A20, A24, A25, A26,
A35,
A41, A42,
A51,
A60,
A70, A74, A75,
A82,
XA0,
Z98, A98,
Z99, A99,
Z9A, A9A,
Z9B, A9B,
Z9C, A9C,
Z9D, A9D,
Z9E, A9E,
Z9F, A9F,
ZA0, AA0,
ZA1, AA1,
ZA2, AA2,
ZA3, AA3,
ZA4, AA4,
ZA5, AA5,
ZA6, AA6,
ZA7, AA7,
ZA8, AA8,
ZA9, AA9,
ZAA, AAA,
ZAB, AAB,
ZAC, AAC,
ZAD, AAD,
AB0, AB1, AB2, AB3, AB4, AB5, AB6, AB7,
XC0, ZC0, AC0,
XC1, ZC1,
XC2, ZC2,
XC3, ZC3,
XC4, ZC4,
XC5, ZC5,
XC6, ZC6,
XC7, ZC7,
XC8, ZC8,
XC9, ZC9,
XCA, ZCA,
XCB, ZCB,***************