English Amiga Board


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

 
 
Thread Tools
Old 23 April 2020, 20:43   #1
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 193
copper skip and copjmp2

I make some tests with the copper skip instruction
and a second copperlist.

This program works if a wait instruction (on the same
line) before the skip instruction in the copperlist exists.
Without this wait instruction the skip instruction doesn't work.
I found no information about this behaviour in any documents.

Is this a normal behaviour?
Is this wait instruction always necessery?


start:
;.....
move.l #cop2,$84(a5) ; pointer COP
move.l #cop1,$80(a5) ; pointer COP
move.w d0,$88(a5) ; start COP
;.....
move.w #$ff01,skip ; dynamicly change from programm
;move.w #$fffe,skip
;.....

****************************************************************************

Cop1: ; copperlist 1
dc.w $1007,$fffe
dc.w $180,$F00 ; red
;dc.w $4007,$fffe ; wait $fffe
; without this instruction it doesn't work
dc.w $4007 ; the same as before??? !!!!!!!!
skip:
dc.w $ff01 ; skip $ff01 or wait $fffe
dc.w $8a,0 ; copjmp2 start (skip the next instruction)

dc.w $180,$0F0 ; green
dc.w $6007,$fffe
dc.w $180,$00F ; blue
dc.w $ffff,$fffe

****************************************************************************

Cop2: ; copperlist 2
dc.w $8007,$fffe
dc.w $180,$000 ; black
dc.w $A007,$fffe
dc.w $180,$FFF ; white
dc.w $C007,$fffe
dc.w $180,$FF0 ; yellow
dc.w $ffff,$fffe


;remeber: the only different between wait and skip are:
;SECOND WAIT INSTRUCTION WORD (IR2)
;Bit 0 Always set to 0 - so the end is even

;SECOND SKIP INSTRUCTION WORD (IR2)
;Bit 1 Always set to 1 - so the end is odd
Rock'n Roll is offline  
Old 23 April 2020, 22:22   #2
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
It only does the SKIP if the beam has passed $4007.. without the WAIT, the beam is somewhere just after $1007 by the time it hits the skip instruction...
DanScott is offline  
Old 23 April 2020, 22:35   #3
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
You don't have to use SKIP but CNOP, see this code:
Code:
start:
	lea	$dff000,a5
	move.w	#$4000,$9a(a5)
	move.w	#$0100,$96(a5)

	move.l #cop2,$84(a5) ; pointer COP
	move.l #cop1,$80(a5) ; pointer COP
;	move.w d0,$88(a5) 	; start COP
;	WHY! I wonder why everywhere in tutorials they put a copperjump without explaining the contraindications..

.ll	moveq	#50-1,d1	;1s blink
.wb	moveq	#$20,d0
	and.w	$1e(a5),d0
	beq.b	.wb
	move.w	d0,$9c(a5)
	dbf	d1,.wb
	eori.w	#$1fe^$8a,skip	; ;)
	bra.b	.ll


	SECTION	CHIP,data_c

****************************************************************************
cop1: ; copperlist 1
	dc.w $1007,$fffe
	dc.w $180,$F00 ; red

	dc.w $4007,$fffe ; wait $fffe
skip:
	dc.w $8a,0 ; copjmp2 start or CNOP

	dc.w $180,$0F0 ; green
	dc.w $6007,$fffe
	dc.w $180,$00F ; blue
	dc.w $ffff,$fffe

****************************************************************************
cop2: ; copperlist 2
	dc.w $8007,$fffe
	dc.w $180,$000 ; black
	dc.w $A007,$fffe
	dc.w $180,$FFF ; white
	dc.w $C007,$fffe
	dc.w $180,$FF0 ; yellow
	dc.w $ffff,$fffe
SKIP skips following MOVE instruction unless beam position has been reached.
But in you code (without the WAIT) beam position is in video line $10, so the following MOVE (the CJMP) is always executed!

EDIT: ops, too much time to edit the code and Dan already replied
ross is offline  
Old 24 April 2020, 19:44   #4
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 193
Thanks, now I know how the copper skip instruction works.
(I believed the skip command its a combination of wait and skip.
It waits like the normal wait command and if the condition is true,
then it skips the next move instruction.)
Rock'n Roll is offline  
Old 24 April 2020, 19:51   #5
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
No, the SKIP instruction doesn't wait at all. Otherwise my copper "loops" would not work
DanScott 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
Copper SKIP instruction sparhawk Coders. Asm / Hardware 21 15 January 2020 16:21
Bug with the Copper SKIP instruction ? Yragael support.WinUAE 5 08 August 2017 20:13
Copper SKIP after SKIP neoman support.WinUAE 3 29 June 2015 16:46
Behaviour of COPJMP2? Anding Coders. General 4 20 May 2009 18:35

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 20:15.

Top

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