Help with tile palette selector
Posted: Thu, 08.03.2018 19:16:28
Hi
According to the TSConf excel file, the Tile palette selector, TPAL, comes from:
"Tile Palette Selector, bits 0-1. Bits 2-3 are taken from PalSel register bits 6-7 or 4-5, dependently on tiles layer 1 or 0."
So it seems that bits 0,1 come from the tile descriptor, and bits 2-3 comes from the T0Pal or T1Pal bits (register 07AF).
But looking at the same excel file, T1Pal and T0Pal are described as:
T1PAL[7:6] T0PAL[7:6]
So it seems that the final palette selector comes from bits 0-1 of the tile descriptor, but bits 7-6 come from T1Pal or T0Pal (and I suppuse bits 5,4,3,2 are zero)
Even more, looking at unreal sources, seems that it is using t1pal and t0pal as bits 7-6:
comp.ts.tsu.tpal = (comp.ts.tsu.layer ? comp.ts.t1pal : comp.ts.t0pal) << 6; // Prepared Tile palette selector
Or.... maybe the final colour (as I may guess on the unreal sources) is:
Bit 7-6: T1Pal or T0Pal
Bit 5-4: TPAL (from tile descriptor)
Bits 3-0: colour from tile data
??
So... what is the right definition for the final tile palette selector?
Thanks
According to the TSConf excel file, the Tile palette selector, TPAL, comes from:
"Tile Palette Selector, bits 0-1. Bits 2-3 are taken from PalSel register bits 6-7 or 4-5, dependently on tiles layer 1 or 0."
So it seems that bits 0,1 come from the tile descriptor, and bits 2-3 comes from the T0Pal or T1Pal bits (register 07AF).
But looking at the same excel file, T1Pal and T0Pal are described as:
T1PAL[7:6] T0PAL[7:6]
So it seems that the final palette selector comes from bits 0-1 of the tile descriptor, but bits 7-6 come from T1Pal or T0Pal (and I suppuse bits 5,4,3,2 are zero)
Even more, looking at unreal sources, seems that it is using t1pal and t0pal as bits 7-6:
comp.ts.tsu.tpal = (comp.ts.tsu.layer ? comp.ts.t1pal : comp.ts.t0pal) << 6; // Prepared Tile palette selector
Or.... maybe the final colour (as I may guess on the unreal sources) is:
Bit 7-6: T1Pal or T0Pal
Bit 5-4: TPAL (from tile descriptor)
Bits 3-0: colour from tile data
??
So... what is the right definition for the final tile palette selector?
Thanks