Sprite port-mirror Index Register: Difference between revisions

From SpecNext Wiki
Jump to: navigation, search
Core 2.00.23 changes (sprite-index link with port $303B)
Core 2.00.26 changes
Line 3: Line 3:
|Readable=Yes
|Readable=Yes
|Writable=Yes
|Writable=Yes
|ShortDesc=Selects sprite index 0..63 to be affected by writes to other Sprite ports (and mirrors).
|ShortDesc=Selects sprite index 0..127 to be affected by writes to other Sprite ports (and mirrors).
}}
}}
{|class="wikitable"
! Bit !! Description
|-
| 7 || Enable "link" with I/O port {{PortNo|$303B}} (sprite index for port {{PortNo|$xx57}}) (1 = interlinked, 0 = decoupled)
|-
| 6 || reserved, write 0
|-
| 5-0 || Sprite index (0..63), which sprite-attributes will be modified.
|}
When the index is "linked" (bit 7 is set), it ties the nextreg sprite-index and the I/O sprite-index together.
* any change to the nextreg sprite number via write to nextreg $34 or auto-inc on nextreg $75-$79 will set the sprite index for I/O to the same and also reset the I/O attribute port {{PortNo|$xx57}} (next write to sprite-attribute port will modify first byte of attributes of particular sprite)
* any change to sprite number via I/O port {{PortNo|$303B}} or auto-inc via I/O port $xx57 will also be reflected in nextreg $34.


This link is broken by writing to nextreg $34 with bit 7 reset.
If sprite id lockstep in {{NextRegNo|$09}} is enabled, write to this registers has same effect as writing to {{PortNo|$303B}}.
 
I.e. bit 7 offsets pattern writes by 128 bytes (second half of 0..63 pattern slot), and bits 6-0 contain index 0..63 (for patterns) or 0..127 for sprite attributes, resetting those indices for ports {{PortNo|$xx57}} and {{PortNo|$xx5B}} and for following NextRegs $35..$39 and $75..$79.
 
Index-increments caused by write to NextRegs $75..$79 will propagate also to current index of port $xx57 and reset current attribute (next write to port $xx57 after index change will modify first byte of attributes).
 
The index increment caused by sending full attribute set to port $xx57, or by writing to port $303B, will also propagate to this register, affecting next writes to registers $35..$39/$75..$79.
 
-------
 
If sprite id lockstep in {{NextRegNo|$09}} is disabled, bit 7 is ignored and bits 6-0 value selects index 0..127 for NextRegs $35..$39 and $75..$79 (decoupled from ports $xx57/$303B completely?).
 
-------
 
Bit 7 always reads back as zero.

Revision as of 09:03, 27 January 2019

Number TBRegisterNumber::$34
Readable TBRegisterReadable::Yes
Writable TBRegisterWritable::Yes
Short Description ShortDesc::Selects sprite index 0..127 to be affected by writes to other Sprite ports (and mirrors).


If sprite id lockstep in {{#ask: TBRegisterNumber::$09 }} ($09) is enabled, write to this registers has same effect as writing to {{#ask: PortNumber::$303B }} ($303B{{#ask: PortNumber::$303B |mainlabel=- |headers=hide |intro= /  |?NumberDec#- }}).

I.e. bit 7 offsets pattern writes by 128 bytes (second half of 0..63 pattern slot), and bits 6-0 contain index 0..63 (for patterns) or 0..127 for sprite attributes, resetting those indices for ports {{#ask: PortNumber::$xx57 }} ($xx57{{#ask: PortNumber::$xx57 |mainlabel=- |headers=hide |intro= /  |?NumberDec#- }}) and {{#ask: PortNumber::$xx5B }} ($xx5B{{#ask: PortNumber::$xx5B |mainlabel=- |headers=hide |intro= /  |?NumberDec#- }}) and for following NextRegs $35..$39 and $75..$79.

Index-increments caused by write to NextRegs $75..$79 will propagate also to current index of port $xx57 and reset current attribute (next write to port $xx57 after index change will modify first byte of attributes).

The index increment caused by sending full attribute set to port $xx57, or by writing to port $303B, will also propagate to this register, affecting next writes to registers $35..$39/$75..$79.


If sprite id lockstep in {{#ask: TBRegisterNumber::$09 }} ($09) is disabled, bit 7 is ignored and bits 6-0 value selects index 0..127 for NextRegs $35..$39 and $75..$79 (decoupled from ports $xx57/$303B completely?).


Bit 7 always reads back as zero.