Difference between revisions of "Copper Control High Byte"

From SpecNext official Wiki
Jump to: navigation, search
(Created page with "{{NextRegister |Number=$62 |Readable=No |Writable=Yes |ShortDesc=Holds high byte of Copper control flags. }}")
 
(Adding info (and rewording) from distro docs.)
Line 5: Line 5:
 
|ShortDesc=Holds high byte of [[Copper]] control flags.
 
|ShortDesc=Holds high byte of [[Copper]] control flags.
 
}}
 
}}
 +
{| class="wikitable"
 +
|-
 +
! Bit !! Function
 +
|-
 +
| 7-6 || Control mode
 +
|-
 +
| 5-3 || Reserved, must be 0
 +
|-
 +
| 2-0 || High three bits of Copper list index (value 0-2047)
 +
|}
 +
 +
When "Control mode" bits are identical with previously set ones, they are ignored - allowing for index change without restarting currently running Copper program.
 +
 +
Copper has internally 10 bit "program counter" register ('''CPC'''), going through 0-1023 values, executing Copper instruction from the list at memory position (CPC*2). This will cause the Copper program to loop automatically. To "halt" program (avoiding possible loop), use WAIT instruction with non-existent horizontal line, like "WAIT 63,511 = 0xFF, 0xFF".
 +
 +
To change control mode, the new value must differ from previous, the possible control modes are:
 +
{| class="wikitable"
 +
|-
 +
! Bits 7-6 !! Control mode
 +
|-
 +
| %00 || STOP Copper (CPC is kept at current value)
 +
|-
 +
| %01 || Reset CPC to 0 and START Copper
 +
|-
 +
| %10 || START Copper (does resume at current CPC)
 +
|-
 +
| %11 || Reset CPC to 0 and START Copper, reset CPC at each video frame at (0,0) (top left pixel of PAPER area)
 +
|}

Revision as of 00:17, 23 December 2018

Number $62
Readable No
Writable Yes
Short Description Holds high byte of Copper control flags.
Bit Function
7-6 Control mode
5-3 Reserved, must be 0
2-0 High three bits of Copper list index (value 0-2047)

When "Control mode" bits are identical with previously set ones, they are ignored - allowing for index change without restarting currently running Copper program.

Copper has internally 10 bit "program counter" register (CPC), going through 0-1023 values, executing Copper instruction from the list at memory position (CPC*2). This will cause the Copper program to loop automatically. To "halt" program (avoiding possible loop), use WAIT instruction with non-existent horizontal line, like "WAIT 63,511 = 0xFF, 0xFF".

To change control mode, the new value must differ from previous, the possible control modes are:

Bits 7-6 Control mode
%00 STOP Copper (CPC is kept at current value)
%01 Reset CPC to 0 and START Copper
%10 START Copper (does resume at current CPC)
%11 Reset CPC to 0 and START Copper, reset CPC at each video frame at (0,0) (top left pixel of PAPER area)