16 May 2011, 20:29 | #1 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
flawless double buffering
When using a double buffered screen, you typically store the bitplane pointers in an intermediate buffer in memory and then copy them to the custom registers on vblank.
The problem with this approach is that sometimes vblank will occur while you are creating the intermediate buffer, so that it is inconsistent when copied to the custom regs causing the screen to flicker. Is there some way of preventing vblank from occuring during a critical section of code? I dont think disabling it is an option, as that would cause the pointers not to be written. Ideally I would like to postpone it just a little |
16 May 2011, 21:37 | #2 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
You can accomplish this either by raising the IPL in SR, or by temporarily masking out the VERTB bit in INTENA.
If the vblank event occurs during this specific period of time, the VERTB bit will get set in INTREQ. Then, when you restore the IPL (or the VERTB bit in INTENA), the VERTB interrupt will immediately trigger. So you won't miss any VERTB events by doing this. Note that if you have a custom level3 handler and support VERTB/BLIT/COPER, your lev3 handler should only acknowledge (clear) flags in INTREQ for exactly those handlers that you run. Don't always acknowledge VERTB|BLIT|COPER by default - then you will occasionally miss out on interrupts. |
17 May 2011, 07:09 | #3 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
nice, thanks!
|
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 |
No-buffering display mode with zero screen tearing, the next step? | Dr.Venom | support.WinUAE | 87 | 22 January 2012 18:08 |
Triple buffering | atchoo | support.WinUAE | 29 | 30 November 2011 11:58 |
lha buffering | source | support.Apps | 7 | 18 July 2011 16:53 |
AGA double buffering using ChangeScreenBuffer() | NovaCoder | Coders. General | 1 | 03 November 2010 00:34 |
|
|