OK so I've pretty much made the program, but the output looks wonky. That is, it's all glitchy and it's not really giving any proper tiles. I'm not sure why, but if you could give some clarification on a couple of things that might help.
When you say 4bpp linear "reversed", does that mean that instead of byte 1 = first bitplane of first row, it's actually the fourth bitplane of the first row?
So for example, format 11 in this document explains 4bpp linear. So instead of it going like this:
It goes like this:
Is this correct?
Also are multi-byte values read in big endian? Or little endian?
Also, I've attached a (decompressed) savestate that I'm using to test this (it's in a ZIP so I could attach it). If you could give me some images of 16x16 tiles found in it, along with the offsets of their 8-byte information chunks, then I can know what sort of output I'm trying to get.
When you say 4bpp linear "reversed", does that mean that instead of byte 1 = first bitplane of first row, it's actually the fourth bitplane of the first row?
So for example, format 11 in this document explains 4bpp linear. So instead of it going like this:
Code:
[r0, bp1], [r0, bp2], [r0, bp3], [r0, bp4], [r1, bp1], [r1, bp2], [r1, bp3], [r1, bp4]
[r2, bp1], [r2, bp2], [r2, bp3], [r2, bp4], [r3, bp1], [r3, bp2], [r3, bp3], [r3, bp4]
[r4, bp1], [r4, bp2], [r4, bp3], [r4, bp4], [r5, bp1], [r5, bp2], [r5, bp3], [r5, bp4]
[r6, bp1], [r6, bp2], [r6, bp3], [r6, bp4], [r7, bp1], [r7, bp2], [r7, bp3], [r7, bp4]
It goes like this:
Code:
[r0, bp4], [r0, bp3], [r0, bp2], [r0, bp1], [r1, bp4], [r1, bp3], [r1, bp2], [r1, bp1]
[r2, bp4], [r2, bp3], [r2, bp2], [r2, bp1], [r3, bp4], [r3, bp3], [r3, bp2], [r3, bp1]
[r4, bp4], [r4, bp3], [r4, bp2], [r4, bp1], [r5, bp4], [r5, bp3], [r5, bp2], [r5, bp1]
[r6, bp4], [r6, bp3], [r6, bp2], [r6, bp1], [r7, bp4], [r7, bp3], [r7, bp2], [r7, bp1]
Is this correct?
Also are multi-byte values read in big endian? Or little endian?
Also, I've attached a (decompressed) savestate that I'm using to test this (it's in a ZIP so I could attach it). If you could give me some images of 16x16 tiles found in it, along with the offsets of their 8-byte information chunks, then I can know what sort of output I'm trying to get.