10 June 2016, 05:51 | #1 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
|
Best way to detect the end of a frame?
I'm currently tracking VPOS and if it goes backwards (example, 300 to 10) I've made the assumption that we've started a new frame. Is there a better way to do this?
|
10 June 2016, 11:17 | #2 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
VWait
|
10 June 2016, 12:36 | #3 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Yes, VWait will suspend your program until the next frame begins, which is suitable for syncing for double buffering, animation and so on. If you need to catch *every* frame however, a type 5 interrupt is executed at the start of every frame, even if your main loop takes longer than a frame to execute.
|
10 June 2016, 12:42 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Just setup a vblank interrupt and set some flag somewhere.
|
10 June 2016, 16:05 | #5 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
There is also VWaitPos that waits for a certain line.
|
12 June 2016, 02:23 | #6 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
Also graphics' WaitTOF_ is available.
Well, wait-top-of-frame, not end. |
02 July 2016, 06:20 | #7 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
|
Thanks guys, appreciated
|
02 July 2016, 14:48 | #8 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
|
02 July 2016, 20:00 | #9 |
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Indeed, and this gives you great flexibility in deciding when and why to trigger that interrupt. This could be either at the actual VBlank or immediately after the last onscreen word of data was fetched by the custom chips.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Screenshots are off by one frame | Minuous | support.WinUAE | 1 | 29 March 2015 17:30 |
Detect NTSC or PAL | highpuff | Coders. Asm / Hardware | 14 | 18 March 2015 17:23 |
How to detect WinUAE | demolition | support.Apps | 13 | 13 November 2012 11:21 |
VSync + sound = frame dropping | Sasq | support.WinUAE | 3 | 25 March 2004 17:18 |
'detect pixel format' | Melroc | support.WinUAE | 2 | 09 December 2003 16:03 |
|
|