Hi,
TLDR;
How does the CBP address convert back it's pixel location in the PSMCT32? (See below for my calc).
If I have a PSMT8 texture with CBP referencing back to a PSMCT32 how does that work?
Perhaps some other REGS that can offset effective result of CBP?
Currently reversing the Xenosaga series, in particular the first game. I'm really interested in their multi CLUT/palette textures. For example.
For Shion's character, there is a single .xtx (texture format) file that has both a PSMCT32 image and a PSMT8 image composed together. Meaning the rgba32 data is both a texture, and a palette for the same PSMCT32 data but as an PSMT8 image. Neat right.
So, I have an 472x128(WxH) PSMCT32 image. Textures must be a power of 2 so it gets expanded to 512x128 PSMCT32 .
A second texture is created referencing that same 512x128 PSMCT32 data but formatted as PSMT8, which causes the PSMCT32 data to expand to a 1024x256 texture,
per the result of the documentation (8.2 Page Arrangement in Buffer).
Following the VIF command list + VifUnpack + disassembly from @chaoticgd vutracer (I can't post link), I was able to see an XGKICK setting TEX0_1 to a known value from their 3d file format .lex(slight value differences but that's expected, see note later on).
Here's some examples for TEX0_1.
#1 Model 1 : VU1 TEX0_1
#2 Model 2 : VU1 TEX0_1
#3 Model 3 : Suspected TEX0_1 from disc
I have two questions;
How does the CBP address convert back it's pixel location in the PSMCT32?
Is the CBP address 0xDD00 from the OnDisc version really a CBP, or is it something that needs to be processed and I should go look for that?
*TBP0 being 0 on OnDisc is expected, but is the difference in CBP expected too?
The closest I got was the Y coord being correct, while the X coord is off by 32;
*palette location... should... be correct, I checked by incrementing the Index8 data and matching a palette in the PSMCT32
Sample if you want to try to calculate it.
I can't share game assets due to copyright. Though I can make a mock-up, I've marked the palette location.
You should use 0x20006E8629340000 for TEX0_1; goal : { x : 240, y : 96 };
Tex0 definition can be found here : /PCSX2/pcsx2/blob/master/pcsx2/GS/GSRegs.h
Thanks for your time.
**I have a bunch of scripts for this game I'll be releasing once they are finished. I'll post them to this forum if anyone wants to make character/texture mods. Right now I have an obj exporter and patcher, but it can only do deltas on vertices. I hope to have that, this, and rigging support sorted for release. Stretch goal targets their VM that runs most of the gameplay code
. But the swizzeling on textures is giving me burn out.
TLDR;
How does the CBP address convert back it's pixel location in the PSMCT32? (See below for my calc).
If I have a PSMT8 texture with CBP referencing back to a PSMCT32 how does that work?
Perhaps some other REGS that can offset effective result of CBP?
Currently reversing the Xenosaga series, in particular the first game. I'm really interested in their multi CLUT/palette textures. For example.
For Shion's character, there is a single .xtx (texture format) file that has both a PSMCT32 image and a PSMT8 image composed together. Meaning the rgba32 data is both a texture, and a palette for the same PSMCT32 data but as an PSMT8 image. Neat right.

So, I have an 472x128(WxH) PSMCT32 image. Textures must be a power of 2 so it gets expanded to 512x128 PSMCT32 .
A second texture is created referencing that same 512x128 PSMCT32 data but formatted as PSMT8, which causes the PSMCT32 data to expand to a 1024x256 texture,
per the result of the documentation (8.2 Page Arrangement in Buffer).
Following the VIF command list + VifUnpack + disassembly from @chaoticgd vutracer (I can't post link), I was able to see an XGKICK setting TEX0_1 to a known value from their 3d file format .lex(slight value differences but that's expected, see note later on).
Here's some examples for TEX0_1.
#1 Model 1 : VU1 TEX0_1
#2 Model 2 : VU1 TEX0_1
#3 Model 3 : Suspected TEX0_1 from disc
Code:
#1 FROM VU1
TEX0_1 : 0x20071D0629343800
TBP0 : 14336 (3800h)
TBW : 16 (10h) 16*64=1024
PSM : 19 (13h) PSMT8
TW : 10 (ah) 1024
TH : 8 (8h) 256
TCC : 1 (1h) RGBA
TFX : 0 (0h) MODULATE
CBP : 14568 (38e8h) (CBP * 64)=E3A00
CPSM : 0 (0h) PSMCT32
CSM : 0 (0h) CSM1
CSA : 0 (0h) 0
CLD : 1 (1h)
#2 FROM VU1
TEX0_1 : 0x20071D0629343800
TBP0 : 14336 (3800h)
TBW : 8 (8h) 8*64=512
PSM : 0 (0h) PSMCT32
TW : 9 (9h) 512
TH : 7 (7h) 128
TCC : 1 (1h) RGBA
TFX : 0 (0h) MODULATE
CBP : 14335 (37ffh) (CBP * 64)=DFFC0
CPSM : 1 (1h) ??? :(
CSM : 0 (0h) CSM1
CSA : 0 (0h) 0
CLD : 1 (1h)
CLAMP1 : 0x000000007F5003FF
WMS : 3 (3h) REGION_REPEAT
WMT : 3 (3h) REGION_REPEAT
MINU : 63 (3fh) -> UMSK
MAXU : 320 (140h) -> UFIX
MINV : 127 (7fh) -> VMSK
MAXV : 0 (0h) -> VFIX
#3 ORIGINAL VALUE ON DISC
TEX0_1 : 0x20006E8629340000
TBP0 : 0 (0h)
TBW : 16 (10h) 1024
PSM : 19 (13h) PSMT8
TW : 10 (ah) 1024
TH : 8 (8h) 256
TCC : 1 (1h) RGBA
TFX : 0 (0h) MODULATE
CBP : 884 (374h) (CBP * 64)=DD00
CPSM : 0 (0h) PSMCT32
CSM : 0 (0h) CSM1
CSA : 0 (0h)
CLD : 1 (1h)
I have two questions;
How does the CBP address convert back it's pixel location in the PSMCT32?
Is the CBP address 0xDD00 from the OnDisc version really a CBP, or is it something that needs to be processed and I should go look for that?
*TBP0 being 0 on OnDisc is expected, but is the difference in CBP expected too?
The closest I got was the Y coord being correct, while the X coord is off by 32;
*palette location... should... be correct, I checked by incrementing the Index8 data and matching a palette in the PSMCT32
Sample if you want to try to calculate it.
I can't share game assets due to copyright. Though I can make a mock-up, I've marked the palette location.
You should use 0x20006E8629340000 for TEX0_1; goal : { x : 240, y : 96 };
Tex0 definition can be found here : /PCSX2/pcsx2/blob/master/pcsx2/GS/GSRegs.h
Thanks for your time.
**I have a bunch of scripts for this game I'll be releasing once they are finished. I'll post them to this forum if anyone wants to make character/texture mods. Right now I have an obj exporter and patcher, but it can only do deltas on vertices. I hope to have that, this, and rigging support sorted for release. Stretch goal targets their VM that runs most of the gameplay code

