View Single Post
Old 04 September 2019, 14:20   #5
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,430
Part 3: an example Copperlist
Let's look at all this in the form of an example. In this example, I skip the part where the Copper sets up the bitplane pointers and other display setting. I can give an example that does this as well, but I think it's more useful to show the basics first.

Note: in order to use the Copperlist below, the rest of the program running has to set up the display and reset the bitplane pointers every frame. If this is not done, the colour changes will still show up but the display will be garbled. It's also neccesary to put the Copperlist somewhere in memory and point the Copper location register to this place in memory.

Simple copperlist (as code)
Code:
; Screen setup omitted
; No waiting at the start means the Copper starts high up in the vertical border
$0180,$0000	; Change background colour to black
$0182,$0000	; Change colour 1 to black
$0184,$0000	; Change colour 2 to black
$0186,$0000	; Change colour 3 to black
$2BE3,$FFFE	; Wait for border location of top line of screen
$0180,$0F00	; Change background colour to red
$3BE3,$FFFE	; Wait for border location of line 16 of screen
$0180,$00F0	; Change background colour to green
$4BE3,$FFFE	; Wait for border location of line 32 of screen
$0180,$000F	; Change background colour to blue
$BB61,$FFFE	; Wait for Y position $BB, X position $60 = line 144, x=160
$0180,$0555	; Change background colour to gray
$EB00,$FF00	; Wait for any location of line 191 of screen
$0180,$0FFF	; Change background colour to white
$0182,$0400	; Change colour 1 to dark red
$0184,$0040	; Change colour 2 to dark green
$0186,$0004	; Change colour 3 to dark blue
$FFDF,$FFFE	; Wait for start of PAL area (visible part of screen Y=212)
$0180,$0000	; Change background colour to black
$FFFF,$FFFE	; End of Copper list
For reference, the above Copper list looks as follows if we decode the instructions:
Code:
; Screen setup omitted
; No waiting at the start means the Copper starts high up in the vertical border
MOVE $0000 to register $180	; Change background colour to black
MOVE $0000 to register $182	; Change colour 1 to black
MOVE $0000 to register $184	; Change colour 2 to black
MOVE $0000 to register $186	; Change colour 3 to black
WAIT on position Y=$2B, X=$E3	; Wait for border location of top line of screen
MOVE $0F00 to register $180	; Change background colour to red
WAIT on position Y=$3B, X=$E3	; Wait for border location of line 16 of screen
MOVE $00F0 to register $180	; Change background colour to green
WAIT on position Y=$4B, X=$E3	; Wait for border location of line 32 of screen
MOVE $000F to register $180	; Change background colour to blue
WAIT on position Y=$BB, X=$61	; Wait for Y=$BB, X=$60 => screen y=144, x=160
MOVE $0555 to register $180	; Change background colour to gray
WAIT on position Y=$EB		; Wait for any location of line 191 of screen
MOVE $0FFF to register $180	; Change background colour to white
MOVE $0400 to register $182	; Change colour 1 to dark red
MOVE $0040 to register $184	; Change colour 2 to dark green
MOVE $0004 to register $186	; Change colour 3 to dark blue
WAIT on position Y=$FF, X=$DF	; Wait for start of PAL area (screen Y=212)
MOVE $0000 to register $180	; Change background colour to black
WAIT on position Y=$FF, X=$FF	; End of Copper list
Hopefully, the example shows that the practical application of all that wall of theory text is not as complicated as it might seem. It all boils down to: WAIT on a position, MOVE the colours you want

Last edited by roondar; 05 September 2019 at 09:57. Reason: Fixed a small error
roondar is offline  
 
Page generated in 0.05891 seconds with 10 queries