Not quite. First, stamps can be two sizes - 16x16 or 32x32. The register at 8058 controls the stamp map:
b2 = SMS - stamp map size; 0 = 256x256, 1 = 4096x4096
b1 = STS - stamp size; 0 = 16x16, 1 = 32x32
b0 = RPT - repeat; 0 = clamp to stamp map, 1 = repeat stamp map
The repeat bit is like clamping the texture on a regular VDP, or setting it to wrap.
The stamp map entries are a word with the bits set like this:
b15 = HFLP - horizontal flip
b14-13 = RT1-0 - rotation; 00 = no rotation, 01 = 90 degrees, 10 = 180, 11 = 270 degrees (all counter-clockwise); note that the h-flip is done first before the rotate bits are considered.
b12-11 = 0
b10-0 = stamp index
The stamps themselves are NOT laid out like tiles in the MD - the 16x16 stamp is actually laid out as sixteen 4x4 tiles. Each tile is like this
and the tiles are laid out like this:
32x32 stamps are very similar, being made of 4x4 tiles as well. You layout 64 tiles in an 8x8 pattern to make the 32x32 stamp. Go vertically, then horizontally, just like the 16x16 stamp.
Code: Select all
0 8 G O W e m u
1 9 H P X f n v
2 A I Q Y g o w
3 B J R Z h p x
4 C K S a i q y
5 D L T b j r z
6 E M U c k s a'
7 F N V d l t b'
Stamps always start at offset 0 in the word ram, and stamp 0 cannot be used for image data - it CAN be used by the CPU as scratch ram. Note that when using 32x32 stamps, the two lsb of the stamp index are ignored. You can think of it like four 16x16 stamps being used to make a single 32x32 stamp, just with the layout above instead of actually being four 16x16 stamps laid out. So you actually only have 511 stamps in 32x32 mode.
The stamp map base address sets the address of the stamp map, whose entries were shown above. The number of valid offset bits in the base address depends on the stamp map size and the stamp size.
If the stamp map is 256x256:
16x16 stamps: b15-7 = A17-9
32x32 stamps: b15-5 = A17-7
and if the stamp map is 4096 x4096:
16x16 stamps: b15 = A17 (should be set to 1)
32x32 stamps: b15-13 = A17-A15