11 September 2018, 09:35 | #1 |
Inviyya Dude!
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?
|
11 September 2018, 10:18 | #2 |
Defendit numerus
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.
|
11 September 2018, 14:39 | #3 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
|
That sounds like a nice idea..
Will have a look into it.. thanks, ross... |
21 September 2018, 16:03 | #4 |
Moderator
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. |
22 September 2018, 02:43 | #5 |
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.
|
27 October 2019, 14:00 | #6 |
Inviyya Dude!
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. |
27 October 2019, 14:38 | #7 |
It's coming back!
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.
|
27 October 2019, 14:48 | #8 |
Inviyya Dude!
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... |
27 October 2019, 15:03 | #9 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Corrupted WB visible is a symptom of an old value buffered in pointer register. (screens use COP2 for splits) |
|
27 October 2019, 15:08 | #10 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
Edit: Didn't realise ross was about - listen to him, he taught me everything I know (about copper lists). |
|
27 October 2019, 15:19 | #11 |
Inviyya Dude!
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? |
27 October 2019, 15:26 | #12 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
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. |
|
27 October 2019, 15:27 | #13 |
Defendit numerus
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 Last edited by ross; 27 October 2019 at 15:55. Reason: sorry for the first post... |
27 October 2019, 16:11 | #14 |
Inviyya Dude!
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. |
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 |
|
|