English Amiga Board


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

 
 
Thread Tools
Old 17 September 2017, 10:54   #1
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Copper question

Hi,
I'm used to do ATARI demos, and did some AMIGA stuff too. but I never really played with the COPPER till now. I did a simple test to fill the screen with 8 pixels width columns. The goal is to not wait for a specific Y each raster line. My test is working BUT somewhere in the screen the WAIT instruction seems to not work anymore. Screenshot is better than my explain. I know there is some care to take at raster line 255, but the issue is far before the 255 line.
Any idea?



code producing the copper list:


Code:
copperBuild:
			move.l	pCopperList(pc),a1
			move.l	#$3001fffe,(a1)+	; first wait for line $30, pos x=0			
			move.w	#$0031,d2			; each line, wait opcode: don't care about Y line ($00) and wait for X pos $31
			move.w	#200-1,d0			; 200 lines high

.loopY:		move.l	#$01800ff0,(a1)+	; set screen to yellow just before executing the WAIT
			move.w	d2,(a1)+			; wait opcode
			move.w	#$00fe,(a1)+		; don't care about Y value			
			moveq	#42/2-1,d1			
			move.l	#$01800f00,(a1)+	; RED marker to see when the WAIT finished

.loop:		move.l	#$01800fff,(a1)+	; put some "white & black" 8 pixels columns
			move.l	#$01800000,(a1)+
			dbf		d1,.loop
			
			dbf		d0,.loopY
			move.l	#-2,(a1)+
			rts



PS: I did my test in latest WinUAE, using OCS chipset.
leonard is offline  
Old 17 September 2017, 11:02   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Only bits 0 to 6 of vertical position can be masked. Mask bit 7 is blitter finished disable bit.

This is very common "issue".
Toni Wilen is offline  
Old 17 September 2017, 11:19   #3
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
ok. I did a fix using:

move.w #$80fe,(a1)+ ; don't care about Y value


but it produces exactly the same image.

Do you mean I have to do specific code at the raster line 127, as I should do for raster 255?
leonard is offline  
Old 17 September 2017, 11:25   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
The key to working out all these vpos and hpos issues is realizing that you have to break down the display in segments of 256 lines, not just consider specifically line 255, since the Copper only sees the 8 least significant bits of vpos, and because bit 7 of the vpos mask is always set, you can't completely ignore vpos for the kind of effect you're doing here, you have to at least know whether you're in the upper or lower half of the current segment.

So in your case, just setting bit 15 in register D2 once you reach line 128 will fix the problem.
Leffmann is offline  
Old 17 September 2017, 11:39   #5
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Quote:
Originally Posted by Leffmann View Post
So in your case, just setting bit 15 in register D2 once you reach line 128 will fix the problem.
oh I get it! It works! thanks a lot guys
leonard is offline  
Old 17 September 2017, 11:57   #6
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
last question: I read somewhere that CPU shares the same memory slot than COPPER. In case of OCS machine with only SLOW ram extension, does it mean if I'm using COPPER MOVE all around the screen, CPU is blocked? (no CPU free at all?)
leonard is offline  
Old 17 September 2017, 12:18   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by leonard View Post
last question: I read somewhere that CPU shares the same memory slot than COPPER. In case of OCS machine with only SLOW ram extension, does it mean if I'm using COPPER MOVE all around the screen, CPU is blocked? (no CPU free at all?)
CPU can use any available cycle (Documentation talking about CPU only using even cycles is wrong): CPU is not blocked if Copper is doing MOVEs. (and no other DMA channel is stealing other cycles)
Toni Wilen is offline  
Old 17 September 2017, 14:14   #8
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
http://eab.abime.net/showthread.php?t=72575 contains more in-depth discussion of chipbus activity and prioritization.
Kalms is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining copper scrolling with copper background phx Coders. Asm / Hardware 16 13 February 2021 12:41
Using the Copper guy lateur Coders. C/C++ 22 26 July 2017 19:29
Best way to mix blitting with copper and copper effects roondar Coders. Asm / Hardware 3 12 September 2016 13:12
copper ? turrican3 Coders. Asm / Hardware 10 27 January 2016 09:10
Copper speed question FrenchShark Coders. General 18 14 August 2009 21:14

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 10:49.

Top

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