Thanks again, Valendian. I've been down the rabbit hole a bit trying to figure out exactly what's happening with disc reads. Which spun into trying to tease out root dir and volume directories, and all sorts of adventures
The disc image I'm working with is in bin/cue format, and after poking around to find the PVD and figuring out that sectors where being stored in mode 2, I noticed that the .CUE file actually gives you this info upfront
. Oh well, lesson learned. Also notice that it supports CD-XA001, for what that's worth.
So I was able to start getting sector information out of those SetLoc calls using: numSectors * 0x930 + 0x18. It seemed like I was making progress, but the only way I could think to "test" that data was to flood the sector so the game would softlock or generate some kind of in game glitch to verify that I was in the right spot on disc. To make a long story short, I was off by 121 sectors (too far in). I was able to verify that all of the reads for casting elements were off by 121. So it was consistent. But all the reads for casting elements were fairly close address-wise, so I tested some different areas on disc and the error was 130 off my calculated sector. So I'm wondering what in the world is going on? Maybe no$psx is giving me the wrong debug info, or I'm not understanding some kind of indirection or pointer math in how sectors get accessed (more likely).
So I'm a little stuck. But, it's given me a whole new set of questions:
1. Chrono Cross Disc 1, the first 12 bytes of each sector has 10 FF's with 00 on each side, which is a little different than the 12 FF's expected. Valendian, I'm guessing this isn't particularly important, but I figured I'd mention it.
2. In the sector header data contains a mm:ss:ff at 0xC-0xE of the line. What is this for?
3. In one of the sectors I isolated for NPC dialog, I narrowed the data down to a word of data, which was obviously too small to be the text for that portion of the game. It also was padded in a way that fit 8Byte addressing, so I as suspicious that maybe it was a pointer and the data for that conversation was somewhere else on disc, but there weren't any other reads... Is it possible for psx reads to chain? Like one read gets an address from a sector and then jumps to another sector?
Thanks for hanging in there with me. I'm stuck at the moment, but feel like I'm learning a lot. So many little esoteric bits of stuff to discover.