Jump to content
  • 0

Display List Texture Blocks.


SanguinettiMods
 Share

Question

Does anyone have any helpful information on how to calculate the exact texture block of each of the 15 different types of F3DZEX Textures?

 

I tried ZLE2, but that doesn't work with EVERY texture.

 

If anyone has any info on how to calculate the -EXACT- Tetxure Data block, instead of guessing for

 

00: 4-bit RGBA

08: 8-bit RGBA

10: 16-bit RGBA

20: 4-bit YUV (rare)

28: 8-bit YUV (rare)

30: 16-bit YUV (rare)

40: 4-bit CI

48: 8-bit CI

50: 16-bit CI

60: 4-bit IA

68: 8-bit IA

70: 16-bit IA

80: 4-bit I

88: 8-bit I

90: 16-bit I

 

I'd gladly appreciate it.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

gDPSetTileSize should have what you're looking for.

 

In display lists, it is used like this:

 

gDPSetTileSize(pkt, 0, 0, 0, ((width)-1) << 2, ((height)-1) << 2);

 

It is defined as so:

 

#define G_SETTILESIZE 0xf2

#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt)

gDPLoadTileGeneric(pkt, G_SETTILESIZE, t, uls, ult, lrs, lrt)

 

#define gsDPLoadTileGeneric(c, tile, uls, ult, lrs, lrt) \

{ \

_SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \

_SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12)\

}

 

Meaning the width and height can be extracted like so:

width = ( _SHIFTR(w1, 12, 12) >> 2) + 1;

height = ( _SHIFTR(w1, 0, 12) >> 2) + 1;

 

In simpler terms:

F2000000 00wwwhhh

 

width = (w / 4) + 1

height = (h / 4) + 1

 

The size (in bytes) of the texture can be determined by the bits per pixel multiplied by the number of pixels divided by eight:

bytes of pixel data = bpp * width * height / 8

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.