![]() |
![]() |
![]() |
#1 |
Registered User
![]() Join Date: Jun 2020
Location: Brno
Posts: 90
|
Copper WAIT, copper SKIP and $80/$100 vpos problem
Hello!
I've recently wanted to try myself how to construct a copper list with SKIP instructions. You know, that simple famous 8x8 copper chunky screen allowing CPU to set colors of 40 8x8 "pixels" (no overscan) by writing just 40 words per line -- hence the use of SKIP copper instructions. And therefore, inevitably, I've encountered a problem of two boundaries: vpos=$80 and vpos=$100. The first one results (as far as I understand it) from the fact that 7th bit cannot be masked out in WAIT/SKIP instruction (that bit is reserved for blitter-wait test). The second one is the obvious result of having just 8 bits for vpos test. To fight the $80 problem I've created two macros for copper list construction: Code:
macro COPPER_LINE dc.w COP2LCH,0,COP2LCL,0 dc.w $0039,$80fe rept 10 dc.w COLOR00,$f00^\2,COLOR00,$0f0^\2,COLOR00,$00f^\2,COLOR00,$ff0^\2 endr dc.w $00df,$80fe dc.w (((\1+8)&$ff)<<8)|$01,$ff01,COPJMP2,0 endm macro COPPER_LINE_128 dc.w COP2LCH,0,COP2LCL,0 dc.w $8039,$80fe rept 10 dc.w COLOR00,$f00^\2,COLOR00,$0f0^\2,COLOR00,$00f^\2,COLOR00,$ff0^\2 endr dc.w $80df,$80fe dc.w (((\1+8)&$ff)<<8)|$8001,$ff01,COPJMP2,0 endm I use them in the following way: Code:
Copper: dc.w BPLCON0,0,BPLCON1,0,BPLCON2,0 dc.w COLOR00,$fff dc.w $5801,$fffe .firstLine COPPER_LINE $58,$000 .firstLineEnd COPPER_LINE $60,$fff COPPER_LINE $68,$000 COPPER_LINE $70,$fff COPPER_LINE $78,$000 COPPER_LINE_128 $80,$fff COPPER_LINE_128 $88,$000 COPPER_LINE_128 $90,$fff COPPER_LINE_128 $98,$000 COPPER_LINE_128 $a0,$fff COPPER_LINE_128 $a8,$000 COPPER_LINE_128 $b0,$fff COPPER_LINE_128 $b8,$000 COPPER_LINE_128 $c0,$fff COPPER_LINE_128 $c8,$000 COPPER_LINE_128 $d0,$fff COPPER_LINE_128 $d8,$000 COPPER_LINE_128 $e0,$fff COPPER_LINE_128 $e8,$000 COPPER_LINE_128 $f0,$faf ;COPPER_LINE_128 $f8,$000 .linesEnd dc.w COLOR00,$fff dc.w $ffff,$fffe Initialization is done by something like this: Code:
Init: ; Initialization of copper jumps! ; Relies on a specific command order in ONE_COPPER_LINE macro! lea.l Copper\.firstLine,a0 lea.l 8(a0),a1 ; offset from line beginning to line jump address move.w #Copper\.firstLineEnd-Copper\.firstLine,d1 ; skip to next line move.w #(Copper\.linesEnd-Copper\.firstLine)/(Copper\.firstLineEnd-Copper\.firstLine)-1,d2 ;no.lines - 1 .1 move.l a1,d0 move.w d0,6(a0) swap d0 move.w d0,2(a0) add.w d1,a0 add.w d1,a1 dbf d2,.1 move.l #Copper,CopperAddress rts So my question is: How do you usually do it? What is your technique to get over $100 boundary in similar scenario? Do you reduce one line height to 7 lines so that you can start with $00 vpos? Or do you construct the copper list in some special way? Or maybe the solution is very simple and I can't see it? ...not the first time ![]() P.S.: This is how the screen looks like. |
![]() |
![]() |
#2 |
Defendit numerus
![]() Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,959
|
Code:
macro COPPER_LINE_255 dc.w $1fe,$1fe,$1fe,$1fe dc.w $8039,$80fe rept 10 dc.w $180,$f00^\2,$180,$0f0^\2,$180,$00f^\2,$180,$ff0^\2 endr dc.w $80df,$80fe dc.w $1fe,$1fe,$1fe,$1fe endm Code:
... COPPER_LINE_128 $e8,$000 COPPER_LINE_128 $f0,$fff COPPER_LINE_128 $f7,$000 COPPER_LINE_255 $ff,$000 COPPER_LINE $00,$fff COPPER_LINE $08,$000 COPPER_LINE $10,$fff COPPER_LINE $18,$000 ... |
![]() |
![]() |
#3 |
Registered User
![]() Join Date: Jun 2020
Location: Brno
Posts: 90
|
I see! Thank you Ross!
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copper SKIP/WAIT timing | roondar | Coders. Asm / Hardware | 5 | 05 February 2021 18:46 |
copper skip and copjmp2 | Rock'n Roll | Coders. Asm / Hardware | 4 | 24 April 2020 20:51 |
Copper SKIP instruction | sparhawk | Coders. Asm / Hardware | 21 | 15 January 2020 17:21 |
Copper Wait Problem | sandruzzo | support.WinUAE | 13 | 18 May 2016 22:54 |
Copper Wait Problem | sandruzzo | Coders. Asm / Hardware | 2 | 17 May 2016 11:30 |
|
|