English Amiga Board


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

 
 
Thread Tools
Old 12 October 2021, 18:41   #1
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Switching Copperlists

Hey all!

During specific positions in my game I am switching between two copper lists, which is working to a degree; the problem is I get a nasty flicker when the switch occurs.

I set the initial list using
Code:
move.l #PrimaryCopper,COP1LCH(a6)
but then switch to the second list with a subsequent
Code:
move.l #SecondaryCopper,COP1LCH(a6)
.

Something doesn't quite seem right though, so is this a valid way to switch between two copper lists using the CPU?

Cheers
DanielAllsopp is offline  
Old 12 October 2021, 19:07   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,113
How and when are you switching? The new copperlist won't be active until the next vblank (unless you explicitly jump to it by strobing COPJMP1). If you're doing this in the visible area and immediate start updating PrimaryCopper or if SecondaryCopper isn't ready for the next frame you'll get interesting results.

Make sure SecondaryCopper is fully initialized and switch after PrimaryCopper has finished (but before line 0) and you should be good.

Last edited by paraj; 12 October 2021 at 19:24. Reason: Y DIWSTOP -> PrimaryCopper
paraj is offline  
Old 12 October 2021, 20:16   #3
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Quote:
Originally Posted by paraj View Post
How and when are you switching? The new copperlist won't be active until the next vblank (unless you explicitly jump to it by strobing COPJMP1). If you're doing this in the visible area and immediate start updating PrimaryCopper or if SecondaryCopper isn't ready for the next frame you'll get interesting results.

Make sure SecondaryCopper is fully initialized and switch after PrimaryCopper has finished (but before line 0) and you should be good.
Cool, makes sense but how does one know when a copper list is actually finished?

Would I wait until the end of a frame?
DanielAllsopp is offline  
Old 12 October 2021, 20:43   #4
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,113
Quote:
Originally Posted by DanielAllsopp View Post
Cool, makes sense but how does one know when a copper list is actually finished?

Would I wait until the end of a frame?

The easy answer is: wait for an Y position that's later than the last line you care about. I.e. just beyond the end of the visible frame. You wrote PrimaryCopper so you know when it's done. Find the last WAIT in it and wait for a line just below that (unless you're doing really complicated stuff).


I.e. if you're changing the background color on line 301 just after your playfield has finished displaying, wait for line 302.


If in doubt, post your copper list (starting from at least the last WAIT).
paraj is offline  
Old 13 October 2021, 12:39   #5
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Fixed The bitplane pointers in the second copperlist were uninitialised and obviously containing garbage, so that's what was initially showing when I switched it over.

Thanks for the pointers, it all helped!
DanielAllsopp 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
How to do multiple copperlists Havie Coders. Blitz Basic 5 25 April 2020 10:54
Copperlists and screen sizes Jherek Carnelia Coders. Asm / Hardware 2 12 November 2019 18:59
Multiple Copperlists and Sprites Havie Coders. Blitz Basic 4 03 October 2018 21:10
Switching Discs ghost_of_war New to Emulation or Amiga scene 2 19 May 2009 20:19
Switching from 1.3 to 2.04!!! Im confused! Galatran New to Emulation or Amiga scene 18 08 October 2008 13:30

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:17.

Top

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