English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 10 June 2016, 05:51   #1
earok
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?
earok is offline  
Old 10 June 2016, 11:17   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
VWait
idrougge is offline  
Old 10 June 2016, 12:36   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
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.
Daedalus is offline  
Old 10 June 2016, 12:42   #4
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Just setup a vblank interrupt and set some flag somewhere.
meynaf is offline  
Old 10 June 2016, 16:05   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
There is also VWaitPos that waits for a certain line.
idrougge is offline  
Old 12 June 2016, 02:23   #6
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
Also graphics' WaitTOF_ is available.

Well, wait-top-of-frame, not end.
Cylon is offline  
Old 02 July 2016, 06:20   #7
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Thanks guys, appreciated
earok is offline  
Old 02 July 2016, 14:48   #8
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by meynaf View Post
Just setup a vblank interrupt and set some flag somewhere.
or use the Copper to do it, it can write to INTREQ (bit 4 is reserved for Copper interrupts!)
Mrs Beanbag is offline  
Old 02 July 2016, 20:00   #9
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by Mrs Beanbag View Post
or use the Copper to do it, it can write to INTREQ (bit 4 is reserved for Copper interrupts!)
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.
ReadOnlyCat 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
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

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 21:16.

Top

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