07 July 2011, 17:57 | #1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 766
|
Double buffer copper??
So you double buffer your screen drawing, clearing one while drawing the other.
I'm wondering if you can do this with the copper and how best to go about it I know that for interlace you can setup two copper lists, however I would be concerned as to which one was acutally active at any given time. So, lets say I say i build a copper list ready for the next frame. If I then load the copper pointers at the end of the routine but the copper is still running through the current list, does instantly start your new one or wait until it is finished then start your new one? would love to know how.... cheers |
07 July 2011, 18:33 | #2 | ||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Quote:
If you want it to start the new copperlist immediately, then write any value to the appropriate strobe register (e.g. COPJMPx). Regards, Lonewolf10 Last edited by Lonewolf10; 07 July 2011 at 18:56. |
||
11 July 2011, 20:06 | #3 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
I double buffer copper lists and swap them over as the first part of my loop. I've 2 copper lists, pointing to 2 different sets of bitplanes, so swapping them when my loop is entered handles the screen double buffering for me. I just refer to a base pointer in the code and switch what cop1lc refers to each frame.
I had a nasty issue with a race condition when I first started trying to learn asm - I was updating the copperlist as it was being read - so I moved over to double buffering the lot as it just seemed to be easier to manage. What I'm not doing atm is building any copper lists on the fly, so I've got a load of unnecessary duplication in my code. |
11 July 2011, 22:12 | #4 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 766
|
Nice one, cheers guys, have tested the theory and it seems to work
|
12 July 2011, 22:27 | #5 | ||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Quote:
Regards, Lonewolf10 |
||
13 July 2011, 04:02 | #6 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
Both mine are being modified. I just don't like the fact that I'm statically duplicating all the unmodified stuff, multiple times. Low pri and not a massive issue, but it bugs the hell out of me all the same
I wish I had more time |
14 July 2011, 19:54 | #7 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
|
If it's the buffer you are doubling, and the rest of the copper should show the same, just set the currently-not-being-drawn-into bitplane pointers in the Vblank interrupt.
Or, you could 'poke' the bitplane pointers in a single copper to do double-buffering. No need for more than 1 copper, just because you double buffer. Only if you also need a copper buffer; when content differs in the copperlist between two frames - somewhere to poke the copper that is not being displayed yet. |
19 July 2011, 13:51 | #8 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
Yeah, my copper contents were changing, so I duplicated the list for simplicity. Dirty
|
19 July 2011, 19:10 | #9 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
|
Well, it's not dirty if you're planning on double-buffering the rest of the copperlist contents, like a coppershade that should match some moving bitplane, for example. Or if you have a screen split and the buffer you are doubling isn't at the top. And if you're running a copper with some stuff in it anyway, it IS the simplest way to switch buffers.
Wasn't a criticism at all I try to keep such out of non-opinion posts. Reducing redundancy is good programming though, even if it's not always best practice. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Double PAL / Double NTSC, oficially supported by WHDLoad... | Shoonay | project.WHDLoad | 3 | 15 May 2021 19:42 |
Combining copper scrolling with copper background | phx | Coders. Asm / Hardware | 16 | 13 February 2021 12:41 |
Vsync Fullscreen and Double Buffer, incorrect frame rate? | rsn8887 | support.WinUAE | 1 | 07 April 2011 20:43 |
SysEx buffer overflow | Ducktale | support.WinUAE | 1 | 30 August 2007 12:20 |
4 way IDE buffer for sale | Smiley | MarketPlace | 7 | 04 July 2007 16:27 |
|
|