English Amiga Board


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

 
 
Thread Tools
Old 11 September 2018, 09:35   #1
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
skipping parts of a static copperlist...

Is there any way to skip parts of a static copperlist (means one, that I am not dynamically constructing myself with code on runtime) based on some condition?
Tigerskunk is offline  
Old 11 September 2018, 10:18   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
The easiest thing that comes to mind is to set COP1LCx and then strobe COPJMPx, overwriting the first words part of the copper list you want to skip.
ross is offline  
Old 11 September 2018, 14:39   #3
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
That sounds like a nice idea..

Will have a look into it.. thanks, ross...
Tigerskunk is offline  
Old 21 September 2018, 16:03   #4
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
That's not a conditional, though, you'd have to poke the destination address with code calculating it from the condition.

There's the SKIP instruction, but it's of limited use.
Photon is offline  
Old 22 September 2018, 02:43   #5
FSizzle
Registered User
 
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
Take care to either write both the high and low address for the jmp destination, OR make sure the jmp destination is in the same 64KiB aligned block as the copper list start address if you only set the low word to save cycles.
FSizzle is offline  
Old 27 October 2019, 14:00   #6
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Some thoughts here, please correct me if I am wrong..

Could I strobe COPJMP2 when the part of the copperlist gets executed where I want to jmp over the next few instructions to the place thats written in COP2LCH/L?

example in pseudo code:

("jumpAdress" is written to COP2LCH/L at the initialization of the code,

move.l #jumpAdress,a6
move.l a6,Cop2lch
)

Code:
        ;some copper list stuff
	dc.w $0180,$0000
	dc.w $0182,$0000
	dc.w $0184,$0000
	dc.w $0186,$0000
	dc.w $0188,$0000
	dc.w $018a,$0000
	dc.w $018c,$0000
	dc.w $018e,$0000

        dc.w $008a,$0000   ;here I strobe COPJMP2, so we jump to "jumpAdress" in our copper list and don't execute the next commands

	dc.w $0190,$0000
	dc.w $0192,$0000
	dc.w $0194,$0000
	dc.w $0196,$0000
	dc.w $0198,$0000
	dc.w $019a,$0000
	dc.w $019c,$0000
	dc.w $019e,$0000

jumpAdress:        ;here we jump to
	dc.w $3d0f,$fffe
	dc.w $0100,$4200

On my condition check I would then simply overwrite that COPJMP2 statement with something harmless if I want to execute the stuff after the COPJMP2 instruction..

Would this work the way intended?

Last edited by Tigerskunk; 27 October 2019 at 14:50.
Tigerskunk is offline  
Old 27 October 2019, 14:38   #7
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Similar things have been done. The trick is setting cop2lc at a safe time to do so. You'll never have any real condition checking within your copper list, it all has to happen in your main code, and timed to happen when it's safe to change cop2lc, which may well limit you to once per screen refresh. Unless you're actually branching out to dynamically generated code it may not be worth the effort.
deimos is offline  
Old 27 October 2019, 14:48   #8
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Yep, I wanna check that in my main code once per frame and not within the copper list (I wouldn't have any idea how to do that, anyway)

At the moment if I have the COPJMP2 executing in the copperlist, it starts showing me a corrupted workbench screen, and not my game anymore..

Very strange...
Tigerskunk is offline  
Old 27 October 2019, 15:03   #9
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Steril707 View Post
At the moment if I have the COPJMP2 executing in the copperlist, it starts showing me a corrupted workbench screen, and not my game anymore..

Very strange...
Are you sure COP2LC is ever set?
Corrupted WB visible is a symptom of an old value buffered in pointer register.
(screens use COP2 for splits)
ross is offline  
Old 27 October 2019, 15:08   #10
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by Steril707 View Post
Yep, I wanna check that in my main code once per frame and not within the copper list (I wouldn't have any idea how to do that, anyway)

At the moment if I have the COPJMP2 executing in the copperlist, it starts showing me a corrupted workbench screen, and not my game anymore..

Very strange...
Well, the idea works, I'm using it myself. What is happening in the place that COPLC2 is pointing to? Does it return to the main copper list with another jump? What if you try just making it go to sleep "$ffff, $fffe"?

Edit: Didn't realise ross was about - listen to him, he taught me everything I know (about copper lists).
deimos is offline  
Old 27 October 2019, 15:19   #11
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
I am not "returning" to a copper list.
I have just one copper list, and all I wanna do is skip a part of it by doing this copjmp thing.

So, at the beginning of the frame, in my main code I load up Cop2lc with the adress where i wanna jump to in the copper list, and i put a copjmp2 into the copper list at the place where i wanna jump...

Is this wrong?
Tigerskunk is offline  
Old 27 October 2019, 15:26   #12
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by Steril707 View Post
I am not "returning" to a copper list.
I have just one copper list, and all I wanna do is skip a part of it by doing this copjmp thing.

So, at the beginning of the frame, in my main code I load up Cop2lc with the adress where i wanna jump to in the copper list, and i put a copjmp2 into the copper list at the place where i wanna jump...

Is this wrong?
No, not wrong, that's me thinking about how I did mine.

You say "at the beginning of the frame". Can you expand on that, because I had problems caused by doing things at what I thought were the right time, even though they were actually the wrong time.
deimos is offline  
Old 27 October 2019, 15:27   #13
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
In the first part of IRQ3/VBI handler (before video line $18!) I would check the choice condition for the sub-list and write the NULL or COPJMP2 value at 'switch:'

Copper list:

Code:
COP1_start:
	dc.w $00e0,$0000
	.. general setup

	dc.w $1807,$fffe        ;<---
	dc.w $0120,$0000
	-- sprites setup
	
	;some copper list stuff
	dc.w $0180,$0000
	dc.w $0182,$0000
	dc.w $0184,$0000
	dc.w $0186,$0000
	dc.w $0188,$0000
	dc.w $018a,$0000
	dc.w $018c,$0000
	dc.w $018e,$0000

switch: dc.w $008a,$0000   	;or $01fe,$0000 (NULL)

	dc.w $0190,$0000
	dc.w $0192,$0000
	dc.w $0194,$0000
	dc.w $0196,$0000
	dc.w $0198,$0000
	dc.w $019a,$0000
	dc.w $019c,$0000
	dc.w $019e,$0000

jumpAdress:
        ;here we jump to
	dc.w $3d0f,$fffe
	dc.w $0100,$4200
EDIT: in fact I could leave what I had written the first time, it wasn't the OP's request but equally interesting

Last edited by ross; 27 October 2019 at 15:55. Reason: sorry for the first post...
ross is offline  
Old 27 October 2019, 16:11   #14
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Seems I can do whatever I want, it won't work.

If I put

setCopLC:
dc.w $0084,$0000
dc.w $0086,$0000

before

dc.w $008a,$0000

at least it jumps somewhere else than the workbench, it seems.

But setting those values with

move.l #setCopLC,a0
move.l #jumpAdress,d0
move.w d0,6(a0)
swap d0
move.w d0,2(a0)

doesn't do anything...

*scratching my head*


ADD/EDIT: okay, it works now.. seems I was just too dumb to notice that my copperlist isn't "sufficient" with the skipped part and looks weird as a result..
Thanks, Ross (and Deimos)..
Happy coding!

Last edited by Tigerskunk; 27 October 2019 at 16:29.
Tigerskunk 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
Mouse and static Solderbro support.Hardware 1 19 June 2018 20:36
WinUAE 2.5.0 mouse capturing/pointer skipping issue mark_k support.WinUAE 25 06 December 2012 18:15
CD32 video skipping Djay support.WinUAE 4 04 October 2010 14:09
CD32 Video Skipping Kitty support.WinUAE 18 29 December 2009 20:24
Systematic skipping of all interesting content? :) Photon AMR suggestions and feedback 7 01 September 2009 17:05

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 04:57.

Top

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