Difference between revisions of "Sprite port-mirror Attribute 4 Register"

From SpecNext official Wiki
Jump to: navigation, search
(Core 2.00.22 changes, and forum knowledge from Jim Bagley distilled.)
 
m (3 revisions imported)
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
 
}}
 
}}
 
Byte 5 is bitmapped:
 
Byte 5 is bitmapped:
 +
:For '''anchor''' sprites:
 
{|class="wikitable"
 
{|class="wikitable"
 
! Bit !! Description
 
! Bit !! Description
 
|-
 
|-
| 7 || If 1, the pattern will be treated as 4-bit colour one (128 bytes), 0 is for 8-bit colour patterns (256 bytes)
+
| 7-6 || "H N6" - "H" is 4/8 bit graphics selector, "N6" is sub-pattern selector for 4 bit modes.<br />
 +
%00 = 8-bit colour patterns (256 bytes), this sprite is "'''anchor'''"<br />
 +
%01 = this sprite is "'''relative'''" (4/8-bit colour is selected by "anchor" sprite) → see tables below<br />
 +
%10 = 4-bit colour pattern (128 bytes) using bytes 0..127 of pattern slot, this sprite is "'''anchor'''"<br />
 +
%11 = 4-bit colour pattern (128 bytes) using bytes 128..255 of pattern slot, this sprite is "'''anchor'''"
 
|-
 
|-
| 6 || Chooses top/bottom part of pattern slot (for 4-bit colour patterns)
+
| 5 || Type for following '''relative''' sprites: 0 = "composite", 1 = "big sprite"
0 will target bytes 0..127 of pattern "Name" (byte 4), 1 will target bytes 128..255 of pattern "Name".
 
 
|-
 
|-
| 5 || Reserved, use always 0
+
| 4-3 || x-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
 +
|-
 +
| 2-1 || y-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
 +
|-
 +
| 0 || MSB of Y coordinate
 +
|}
 +
:For '''composite relative''' sprites:
 +
{|class="wikitable"
 +
! Bit !! Description
 +
|-
 +
| 7-6 ||%01 = relative sprite
 +
|-
 +
| 5 || "N6" bit, in 4-bit colour mode 0 = using bytes 0..127 of pattern slot, 1 = using bytes 128..255 of pattern slot. In 8-bit mode use 0.
 
|-
 
|-
 
| 4-3 || x-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
 
| 4-3 || x-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
Line 20: Line 36:
 
| 2-1 || y-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
 
| 2-1 || y-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
 
|-
 
|-
| 0 || MSB of Y coordinate
+
| 0 || Enable relative pattern offset (1 = Pattern index is added to anchor pattern index, 0 = independent pattern index)
 +
|}
 +
:For '''big-sprite relative''' sprites:
 +
{|class="wikitable"
 +
! Bit !! Description
 +
|-
 +
| 7-6 ||%01 = relative sprite
 +
|-
 +
| 5 || "N6" bit, in 4-bit colour mode 0 = using bytes 0..127 of pattern slot, 1 = using bytes 128..255 of pattern slot. In 8-bit mode use 0.
 +
|-
 +
| 4-1 || use 0 (scaling is defined by '''anchor''' sprite)
 +
|-
 +
| 0 || Enable relative pattern offset (1 = Pattern index is added to anchor pattern index, 0 = independent pattern index)
 
|}
 
|}
  
See {{PortNo|$xx57}} for extra notes about coordinates and clipping.
+
See {{PortNo|$xx57}} for extra notes about anchor/relative sprites, coordinates and clipping.

Latest revision as of 11:00, 14 April 2019

Number $39
Readable No
Writable Yes
Short Description Nextreg port-mirror to write directly into "byte 5" of Sprite Attribute Upload ($xx57 / 87).

Byte 5 is bitmapped:

For anchor sprites:
Bit Description
7-6 "H N6" - "H" is 4/8 bit graphics selector, "N6" is sub-pattern selector for 4 bit modes.

%00 = 8-bit colour patterns (256 bytes), this sprite is "anchor"
%01 = this sprite is "relative" (4/8-bit colour is selected by "anchor" sprite) → see tables below
%10 = 4-bit colour pattern (128 bytes) using bytes 0..127 of pattern slot, this sprite is "anchor"
%11 = 4-bit colour pattern (128 bytes) using bytes 128..255 of pattern slot, this sprite is "anchor"

5 Type for following relative sprites: 0 = "composite", 1 = "big sprite"
4-3 x-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
2-1 y-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
0 MSB of Y coordinate
For composite relative sprites:
Bit Description
7-6 %01 = relative sprite
5 "N6" bit, in 4-bit colour mode 0 = using bytes 0..127 of pattern slot, 1 = using bytes 128..255 of pattern slot. In 8-bit mode use 0.
4-3 x-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
2-1 y-axis scale factor: %00 = 1x (16 pixels), %01 = 2x, %10 = 4x, %11 = 8x (128 pixels)
0 Enable relative pattern offset (1 = Pattern index is added to anchor pattern index, 0 = independent pattern index)
For big-sprite relative sprites:
Bit Description
7-6 %01 = relative sprite
5 "N6" bit, in 4-bit colour mode 0 = using bytes 0..127 of pattern slot, 1 = using bytes 128..255 of pattern slot. In 8-bit mode use 0.
4-1 use 0 (scaling is defined by anchor sprite)
0 Enable relative pattern offset (1 = Pattern index is added to anchor pattern index, 0 = independent pattern index)

See Sprite Attribute Upload ($xx57 / 87) for extra notes about anchor/relative sprites, coordinates and clipping.