Quote:
Originally Posted by litwr
@roondar Thank you. But your idea takes one color from the main screen. IMHO it is possible to use copper to change the value of color register 0 but it will require not very easy coding, we need to change the register two times for horizontal borders and one time for vertical.
|
Using the copper is indeed the better option if you need colour 0 to be different for the background and border part. Do note that in my idea you can still use colour 0 on the main screen, though it does indeed mean choosing a border colour that is 'useful' for the main screen as well.
To try and help you a bit more, the copper 'trick' you're referring to here really isn't hard. It's essentially the same thing as is done when you create a copper rainbow but instead of having one wait and one move command per scanline, there are two.
The copper list would look something like this for a PAL Amiga (I did this from memory, so there may be bugs
):
Code:
; ... whatever init stuff you have goes here ...
; Repeat this next part for every scanline up to VPOS=$fe
dc.w <waiting_position_left_border>|1,$fffe
dc.w $0180,$700 ; Set background colour to middle yellow
dc.w <waiting_position_right_border>|1,$fffe
dc.w $0180,$000 ; Set border colour to black
; However, for VPOS=$ff do
dc.w <waiting_position_left_border>|1,$fffe
dc.w $0180,$700 ; Set background colour to middle yellow
dc.w <waiting_position_right_border>|1,$fffe
dc.w $0180,$000 ; Set border colour to black
dc.w $ffdf,$fffe ; Wait for start of PAL area
; For the remaining lines continue as before
dc.w <waiting_position_left_border>|1,$fffe
dc.w $0180,$700 ; Set background colour to middle yellow
dc.w <waiting_position_right_border>|1,$fffe
dc.w $0180,$000 ; Set border colour to black
; ... whatever closing stuff you have goes here...
dc.w $ffff,$fffe ; End of copperlist
Note that the waiting positions do need to be correctly chosen. I haven't put any values in as the exact positions depend on how wide the screen is. Also note that this method requires the screen edges to be on multiples of 4 pixels due to limits in the Copper wait command.
Hope this helps, as I said - the copper is very nice and can be used for all sorts of tricks.