English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 21 May 2020, 11:01   #1
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 1,811
Copper Horizontal Wait Problems

Hi all,

I battled with this issue for a good few hours last night but couldn't get to the bottom of it.

The screen shot below shows that I am waiting for vertical line 40, I'm changing the colour to Red at position 118 on the horizontal axis. As you can see the position is just slightly out.

http://109.228.4.199/pos76.png

So I though I would simply be able to move it back 8 pixels, but for some reason it jumps all the way back when I wait for position 116.

http://109.228.4.199/pos74.png

I tried to look at what cycles were being used but I'm unsure how to interpret the information properly.

Code:
Position $76

>v 40 112
Line: 28  40 HPOS 70 112:
 [70 112]  [71 113]  [72 114]  [73 115]  [74 116]  [75 117]  [76 118]  [77 119]
             CPU-RW              CPU-RW                      COP  08C    CPU-RW
               0008                0008  W                       0180      0008
           00DFF01E            00DFF01E                      00130D84  00DFF01E
 17FB8D80  17FB8F80  17FB9180  17FB9380  17FB9580  17FB9780  17FB9980  17FB9B80

 [78 120]  [79 121]  [7A 122]  [7B 123]  [7C 124]  [7D 125]  [7E 126]  [7F 127]
 COP  180    CPU-RW  COP  08C            COP  08C    CPU-RW              CPU-RW
     0F52      0008      28A5                FFFE      0008                0008
 00130D86  00DFF01E  00130D88            00130D8A  00DFF01E            00DFF01E
 17FB9D80  17FB9F80  17FBA180  17FBA380  17FBA580  17FBA780  17FBA980  17FBAB80

 [80 128]  [81 129]  [82 130]  [83 131]  [84 132]  [85 133]  [86 134]  [87 135]
                       CPU-RW              CPU-RW                        CPU-RW
                         0008                0008                          0008
                     00DFF01E            00DFF01E                      00DFF01E
 17FBAD80  17FBAF80  17FBB180  17FBB380  17FBB580  17FBB780  17FBB980  17FBBB80

 [88 136]  [89 137]  [8A 138]  [8B 139]  [8C 140]  [8D 141]  [8E 142]  [8F 143]
             CPU-RW                        CPU-RW              CPU-RW
               0008                          0008                0008
           00DFF01E                      00DFF01E            00DFF01E
 17FBBD80  17FBBF80  17FBC180  17FBC380  17FBC580  17FBC780  17FBC980  17FBCB80

 [90 144]  [91 145]  [92 146]  [93 147]  [94 148]  [95 149]  [96 150]  [97 151]
             CPU-RW              CPU-RW                        CPU-RW
               0008                0008                          0008
           00DFF01E            00DFF01E                      00DFF01E
 17FBCD80  17FBCF80  17FBD180  17FBD380  17FBD580  17FBD780  17FBD980  17FBDB80

 [98 152]  [99 153]  [9A 154]  [9B 155]  [9C 156]  [9D 157]  [9E 158]  [9F 159]
   CPU-RW                        CPU-RW              CPU-RW
     0008                          0008                0008
 00DFF01E                      00DFF01E            00DFF01E
 17FBDD80  17FBDF80  17FBE180  17FBE380  17FBE580  17FBE780  17FBE980  17FBEB80

 [A0 160]  [A1 161]  [A2 162]  [A3 163]  [A4 164]  [A5 165]  [A6 166]  [A7 167]
   CPU-RW              CPU-RW            COP  08C    CPU-RW  COP  180    CPU-RW
     0008            W   0008                0180      0008      0FF2      0008
 00DFF01E            00DFF01E            00130D8C  00DFF01E  00130D8E  00DFF01E
 17FBED80  17FBEF80  17FBF180  17FBF380  17FBF580  17FBF780  17FBF980  17FBFB80

 [A8 168]  [A9 169]  [AA 170]  [AB 171]  [AC 172]  [AD 173]  [AE 174]  [AF 175]
 COP  08C            COP  08C    CPU-RW              CPU-RW
     2925                FFFE      0008                0008
 00130D90            00130D92  00DFF01E            00DFF01E
 17FBFD80  17FBFF80  17FC0180  17FC0380  17FC0580  17FC0780  17FC0980  17FC0B80

 [B0 176]  [B1 177]  [B2 178]  [B3 179]  [B4 180]  [B5 181]  [B6 182]  [B7 183]
   CPU-RW              CPU-RW                        CPU-RW              CPU-RW
     0008                0008                          0008                0008
 00DFF01E            00DFF01E                      00DFF01E            00DFF01E
 17FC0D80  17FC0F80  17FC1180  17FC1380  17FC1580  17FC1780  17FC1980  17FC1B80

 [B8 184]  [B9 185]  [BA 186]  [BB 187]  [BC 188]  [BD 189]  [BE 190]  [BF 191]
                       CPU-RW              CPU-RW                        CPU-RW
                         0008                0008                          0008
                     00DFF01E            00DFF01E                      00DFF01E
 17FC1D80  17FC1F80  17FC2180  17FC2380  17FC2580  17FC2780  17FC2980  17FC2B80

>


Code:
Position $74

>v 40 112
Line: 28  40 HPOS 70 112:
 [70 112]  [71 113]  [72 114]  [73 115]  [74 116]  [75 117]  [76 118]  [77 119]
             CPU-RW              CPU-RW  COP  08C            COP  180    CPU-RW
               0008  W             0008      0180                0F52      0008
           00DFF01E            00DFF01E  00130F3C            00130F3E  00DFF01E
 C8DDA380  C8DDA580  C8DDA780  C8DDA980  C8DDAB80  C8DDAD80  C8DDAF80  C8DDB180

 [78 120]  [79 121]  [7A 122]  [7B 123]  [7C 124]  [7D 125]  [7E 126]  [7F 127]
 COP  08C    CPU-RW  COP  08C              CPU-RW              CPU-RW
     28A5      0008      FFFE                0008                0008
 00130F40  00DFF01E  00130F42            00DFF01E            00DFF01E
 C8DDB380  C8DDB580  C8DDB780  C8DDB980  C8DDBB80  C8DDBD80  C8DDBF80  C8DDC180

 [80 128]  [81 129]  [82 130]  [83 131]  [84 132]  [85 133]  [86 134]  [87 135]
             CPU-RW              CPU-RW                        CPU-RW
               0008                0008                          0008
           00DFF01E            00DFF01E                      00DFF01E
 C8DDC380  C8DDC580  C8DDC780  C8DDC980  C8DDCB80  C8DDCD80  C8DDCF80  C8DDD180

 [88 136]  [89 137]  [8A 138]  [8B 139]  [8C 140]  [8D 141]  [8E 142]  [8F 143]
   CPU-RW                        CPU-RW              CPU-RW
     0008                          0008                0008
 00DFF01E                      00DFF01E            00DFF01E
 C8DDD380  C8DDD580  C8DDD780  C8DDD980  C8DDDB80  C8DDDD80  C8DDDF80  C8DDE180

 [90 144]  [91 145]  [92 146]  [93 147]  [94 148]  [95 149]  [96 150]  [97 151]
   CPU-RW              CPU-RW                        CPU-RW              CPU-RW
     0008                0008                          0008                0008
 00DFF01E            00DFF01E                      00DFF01E            00DFF01E
 C8DDE380  C8DDE580  C8DDE780  C8DDE980  C8DDEB80  C8DDED80  C8DDEF80  C8DDF180

 [98 152]  [99 153]  [9A 154]  [9B 155]  [9C 156]  [9D 157]  [9E 158]  [9F 159]
                       CPU-RW              CPU-RW                        CPU-RW
                         0008                0008                          0008
                     00DFF01E            00DFF01E                      00DFF01E
 C8DDF380  C8DDF580  C8DDF780  C8DDF980  C8DDFB80  C8DDFD80  C8DDFF80  C8DE0180

 [A0 160]  [A1 161]  [A2 162]  [A3 163]  [A4 164]  [A5 165]  [A6 166]  [A7 167]
             CPU-RW                      COP  08C    CPU-RW  COP  180    CPU-RW
               0008  W                       0180      0008      0FF2      0008
           00DFF01E                      00130F44  00DFF01E  00130F46  00DFF01E
 C8DE0380  C8DE0580  C8DE0780  C8DE0980  C8DE0B80  C8DE0D80  C8DE0F80  C8DE1180

 [A8 168]  [A9 169]  [AA 170]  [AB 171]  [AC 172]  [AD 173]  [AE 174]  [AF 175]
 COP  08C            COP  08C    CPU-RW              CPU-RW
     2925                FFFE      0008                0008
 00130F48            00130F4A  00DFF01E            00DFF01E
 C8DE1380  C8DE1580  C8DE1780  C8DE1980  C8DE1B80  C8DE1D80  C8DE1F80  C8DE2180

 [B0 176]  [B1 177]  [B2 178]  [B3 179]  [B4 180]  [B5 181]  [B6 182]  [B7 183]
   CPU-RW              CPU-RW                        CPU-RW              CPU-RW
     0008                0008                          0008                0008
 00DFF01E            00DFF01E                      00DFF01E            00DFF01E
 C8DE2380  C8DE2580  C8DE2780  C8DE2980  C8DE2B80  C8DE2D80  C8DE2F80  C8DE3180

 [B8 184]  [B9 185]  [BA 186]  [BB 187]  [BC 188]  [BD 189]  [BE 190]  [BF 191]
                       CPU-RW              CPU-RW                        CPU-RW
                         0008                0008                          0008
                     00DFF01E            00DFF01E                      00DFF01E
 C8DE3380  C8DE3580  C8DE3780  C8DE3980  C8DE3B80  C8DE3D80  C8DE3F80  C8DE4180
Here's the code that generates the copper list:

Code:
COPPER_OSD_INGAME	MACRO
; Horizontal wait
	move.l	#(BPLCON3<<16)+$0c80,(a1)+
	moveq	#22,d7
	move.l	#$2801fffe,d3
	move.l	#$2825fffe,d4
	move.l	#$2875fffe,d5			;< wait for hpos $77
	move.l	#$28a5fffe,d6
	
	move.l	d3,(a1)+
	move.l	#(COLOR10<<16)+$0222,(a1)+
	
.text:	move.l	d4,(a1)+		
	move.l	#(COLOR00<<16)+$088f,(a1)+	
	move.l	d5,(a1)+		
	move.l	#(COLOR00<<16)+$0f52,(a1)+
	move.l	d6,(a1)+		
	move.l	#(COLOR00<<16)+$0ff2,(a1)+
	rol.l	#8,d3
	rol.l	#8,d4
	rol.l	#8,d5
	rol.l	#8,d6
	addq.b	#1,d3
	addq.b	#1,d4
	addq.b	#1,d5
	addq.b	#1,d6
	ror.l	#8,d3
	ror.l	#8,d4
	ror.l	#8,d5
	ror.l	#8,d6	
	dbf	d7,.text	

	move.l	d3,(a1)+
	move.l	#(COLOR00<<16)+$0333,(a1)+
	move.l	d3,(a1)+
	move.l	#(COLOR10<<16)+$0410,(a1)+
	
	move.w	#BPLCON3,(a1)+
	move.w	#$1280,(a1)+			; First set of 16 colours for 2nd playfield
	ENDM
And here's the copper list in action:-

Code:
00130f24: 0106 0c80 [015 0c4]  ;  BPLCON3 := 0x0c80
 00130f28: 2801 fffe [028 000]  ;  Wait for vpos >= 0x28 and hpos >= 0x00
                                ;  VP 28, VE 7f; HP 00, HE fe; BFD 1
 00130f2c: 0194 0222 [028 004]  ;  COLOR10 := 0x0222
 00130f30: 2825 fffe [028 022]  ;  Wait for vpos >= 0x28 and hpos >= 0x24
                                ;  VP 28, VE 7f; HP 24, HE fe; BFD 1
 00130f34: 0180 088f [028 026]  ;  COLOR00 := 0x088f
 00130f38: 2875 fffe [028 072]  ;  Wait for vpos >= 0x28 and hpos >= 0x74
                                ;  VP 28, VE 7f; HP 74, HE fe; BFD 1
 00130f3c: 0180 0f52 [028 076]  ;  COLOR00 := 0x0f52
 00130f40: 28a5 fffe [028 0a2]  ;  Wait for vpos >= 0x28 and hpos >= 0xa4
                                ;  VP 28, VE 7f; HP a4, HE fe; BFD 1
 00130f44: 0180 0ff2 [028 0a6]  ;  COLOR00 := 0x0ff2
 00130f48: 2925 fffe [029 022]  ;  Wait for vpos >= 0x29 and hpos >= 0x24
                                ;  VP 29, VE 7f; HP 24, HE fe; BFD 1
 00130f4c: 0180 088f [029 026]  ;  COLOR00 := 0x088f
 00130f50: 2975 fffe [029 072]  ;  Wait for vpos >= 0x29 and hpos >= 0x74
                                ;  VP 29, VE 7f; HP 74, HE fe; BFD 1
 00130f54: 0180 0f52 [029 076]  ;  COLOR00 := 0x0f52
 00130f58: 29a5 fffe [029 0a2]  ;  Wait for vpos >= 0x29 and hpos >= 0xa4
                                ;  VP 29, VE 7f; HP a4, HE fe; BFD 1
 00130f5c: 0180 0ff2 [029 0a6]  ;  COLOR00 := 0x0ff2
 00130f60: 2a25 fffe [02a 022]  ;  Wait for vpos >= 0x2a and hpos >= 0x24
                                ;  VP 2a, VE 7f; HP 24, HE fe; BFD 1
 00130f64: 0180 088f [02a 026]  ;  COLOR00 := 0x088f
 00130f68: 2a75 fffe [02a 072]  ;  Wait for vpos >= 0x2a and hpos >= 0x74
                                ;  VP 2a, VE 7f; HP 74, HE fe; BFD 1
 00130f6c: 0180 0f52 [02a 076]  ;  COLOR00 := 0x0f52
>o
 00130f70: 2aa5 fffe [02a 0a2]  ;  Wait for vpos >= 0x2a and hpos >= 0xa4
                                ;  VP 2a, VE 7f; HP a4, HE fe; BFD 1
 00130f74: 0180 0ff2 [02a 0a6]  ;  COLOR00 := 0x0ff2
 00130f78: 2b25 fffe [02b 022]  ;  Wait for vpos >= 0x2b and hpos >= 0x24
                                ;  VP 2b, VE 7f; HP 24, HE fe; BFD 1
 00130f7c: 0180 088f [02b 026]  ;  COLOR00 := 0x088f
 00130f80: 2b75 fffe [02b 072]  ;  Wait for vpos >= 0x2b and hpos >= 0x74
                                ;  VP 2b, VE 7f; HP 74, HE fe; BFD 1
 00130f84: 0180 0f52 [02b 076]  ;  COLOR00 := 0x0f52
 00130f88: 2ba5 fffe [02b 0a2]  ;  Wait for vpos >= 0x2b and hpos >= 0xa4
                                ;  VP 2b, VE 7f; HP a4, HE fe; BFD 1
 00130f8c: 0180 0ff2 [02b 0a6]  ;  COLOR00 := 0x0ff2
 00130f90: 2c25 fffe [02c 022]  ;  Wait for vpos >= 0x2c and hpos >= 0x24
                                ;  VP 2c, VE 7f; HP 24, HE fe; BFD 1
 00130f94: 0180 088f [02c 026]  ;  COLOR00 := 0x088f
 00130f98: 2c75 fffe [02c 072]  ;  Wait for vpos >= 0x2c and hpos >= 0x74
                                ;  VP 2c, VE 7f; HP 74, HE fe; BFD 1
 00130f9c: 0180 0f52 [02c 076]  ;  COLOR00 := 0x0f52
 00130fa0: 2ca5 fffe [02c 0a2]  ;  Wait for vpos >= 0x2c and hpos >= 0xa4
                                ;  VP 2c, VE 7f; HP a4, HE fe; BFD 1
 00130fa4: 0180 0ff2 [02c 0a6]  ;  COLOR00 := 0x0ff2
 00130fa8: 2d25 fffe [02d 022]  ;  Wait for vpos >= 0x2d and hpos >= 0x24
                                ;  VP 2d, VE 7f; HP 24, HE fe; BFD 1
 00130fac: 0180 088f [02d 026]  ;  COLOR00 := 0x088f
 00130fb0: 2d75 fffe [02d 072]  ;  Wait for vpos >= 0x2d and hpos >= 0x74
                                ;  VP 2d, VE 7f; HP 74, HE fe; BFD 1
 00130fb4: 0180 0f52 [02d 076]  ;  COLOR00 := 0x0f52
 00130fb8: 2da5 fffe [02d 0a2]  ;  Wait for vpos >= 0x2d and hpos >= 0xa4
                                ;  VP 2d, VE 7f; HP a4, HE fe; BFD 1
 00130fbc: 0180 0ff2 [02d 0a6]  ;  COLOR00 := 0x0ff2
>o
 00130fc0: 2e25 fffe [02e 022]  ;  Wait for vpos >= 0x2e and hpos >= 0x24
                                ;  VP 2e, VE 7f; HP 24, HE fe; BFD 1
 00130fc4: 0180 088f [02e 026]  ;  COLOR00 := 0x088f
 00130fc8: 2e75 fffe [02e 072]  ;  Wait for vpos >= 0x2e and hpos >= 0x74
                                ;  VP 2e, VE 7f; HP 74, HE fe; BFD 1
 00130fcc: 0180 0f52 [02e 076]  ;  COLOR00 := 0x0f52
 00130fd0: 2ea5 fffe [02e 0a2]  ;  Wait for vpos >= 0x2e and hpos >= 0xa4
                                ;  VP 2e, VE 7f; HP a4, HE fe; BFD 1
 00130fd4: 0180 0ff2 [02e 0a6]  ;  COLOR00 := 0x0ff2
 00130fd8: 2f25 fffe [02f 022]  ;  Wait for vpos >= 0x2f and hpos >= 0x24
                                ;  VP 2f, VE 7f; HP 24, HE fe; BFD 1
 00130fdc: 0180 088f [02f 026]  ;  COLOR00 := 0x088f
 00130fe0: 2f75 fffe [02f 072]  ;  Wait for vpos >= 0x2f and hpos >= 0x74
                                ;  VP 2f, VE 7f; HP 74, HE fe; BFD 1
 00130fe4: 0180 0f52 [02f 076]  ;  COLOR00 := 0x0f52
 00130fe8: 2fa5 fffe [02f 0a2]  ;  Wait for vpos >= 0x2f and hpos >= 0xa4
                                ;  VP 2f, VE 7f; HP a4, HE fe; BFD 1
 00130fec: 0180 0ff2 [02f 0a6]  ;  COLOR00 := 0x0ff2
 00130ff0: 3025 fffe [030 022]  ;  Wait for vpos >= 0x30 and hpos >= 0x24
                                ;  VP 30, VE 7f; HP 24, HE fe; BFD 1
 00130ff4: 0180 088f [030 026]  ;  COLOR00 := 0x088f
 00130ff8: 3075 fffe [030 072]  ;  Wait for vpos >= 0x30 and hpos >= 0x74
                                ;  VP 30, VE 7f; HP 74, HE fe; BFD 1
 00130ffc: 0180 0f52 [030 076]  ;  COLOR00 := 0x0f52
 00131000: 30a5 fffe [030 0a2]  ;  Wait for vpos >= 0x30 and hpos >= 0xa4
                                ;  VP 30, VE 7f; HP a4, HE fe; BFD 1
 00131004: 0180 0ff2 [030 0a6]  ;  COLOR00 := 0x0ff2
 00131008: 3125 fffe [031 022]  ;  Wait for vpos >= 0x31 and hpos >= 0x24
                                ;  VP 31, VE 7f; HP 24, HE fe; BFD 1
 0013100c: 0180 088f [031 026]  ;  COLOR00 := 0x088f
Both look about right but I can't seem to fathom why it's not moving back to the correct position.

I should point out I'm in FMODE x4 and in Hires interlaced mode.

Can anyone shed any light on what is going on?

Cheers,
Geezer

Last edited by mcgeezer; 21 May 2020 at 11:45.
mcgeezer is offline  
Old 21 May 2020, 11:51   #2
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,601
Hi Graeme, this is due to the way the AGA advanced fetches mode works.
You can view it with the visual DMA debugger.
Bitplane DMA slots are not distributed evenly over time but 'packed'.

64 pixel 8bpls:
Code:
x1: $38     $40      $48      $50      $58
    xxxxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx|
x2: $38     $40      $48      $50      $58
    xxxxxxxx|        |xxxxxxxx|        |
x4: $38     $40      $48      $50      $58
    xxxxxxxx|        |        |        |
Your wait is where the packed 8bpls x4 fetches are done, so you cannot have 8px for the color change (in some positions).

Cheers.
ross is online now  
Old 21 May 2020, 12:03   #3
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 1,811
Thanks Ross,
Is there any tricks around it aside from moving the text?
I did fear it would be something like this but I just couldn't find it in my debugging.

Graeme
mcgeezer is offline  
Old 21 May 2020, 12:17   #4
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,601
Quote:
Originally Posted by mcgeezer View Post
Thanks Ross,
Is there any tricks around it aside from moving the text?
I did fear it would be something like this but I just couldn't find it in my debugging.

Graeme
hmm maybe ..
The screen doesn't scroll, so you might try playing with BPLCON1 and some unusual DDFSTRT that 'shift' fetch positions and make the CWAIT valid for the color changes.
ross is online now  
Old 21 May 2020, 12:20   #5
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 1,811
Quote:
Originally Posted by ross View Post
hmm maybe ..
The screen doesn't scroll, so you might try playing with BPLCON1 and some unusual DDFSTRT that 'shift' fetch positions and make the CWAIT valid for the color changes.
I took the easy route and shifted the Blue text back 16px and the Yellow forward 16.

http://109.228.4.199/posfix.png

Appreciate your help as ever Ross - you're a genius.
mcgeezer is offline  
Old 21 May 2020, 16:45   #6
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,601
Quote:
Originally Posted by mcgeezer View Post
I took the easy route and shifted the Blue text back 16px and the Yellow forward 16.
ross is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copper wait geldo79 Coders. Asm / Hardware 9 12 November 2019 09:18
Copper Branch Problems mcgeezer Coders. Asm / Hardware 5 26 January 2019 21:46
Copper Wait Problem sandruzzo support.WinUAE 13 18 May 2016 21:54
Copper Wait Problem sandruzzo Coders. Asm / Hardware 2 17 May 2016 10:30
Combining copper scrolling with copper background phx Coders. Asm / Hardware 14 16 June 2013 07:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07057 seconds with 13 queries