Question about Inp ?
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
Even if it seems to work, it would be better to use Screensync since it also works. When the graphics card doesn't support Screensync, does it just go straight through or can it freeze?
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
I'll use Screensync if it's safe, that is, if it won't jam. But, the synchronization effect of "A = Inp(&h3da)" is still interesting.
Re: Question about Inp ?
Why or how would it jam? I have used screensync before, no issues.Daniel Ouellette wrote:I'll use Screensync if it's safe, that is, if it won't jam. But, the synchronization effect of "A = Inp(&h3da)" is still interesting.
Re: Question about Inp ?
Are you using Inp with the Windows 32-bit or 64-bit compiler or are we talking about the DOS version?
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
I asked the question for Screensync because I have no idea what could be behind this command.
It's Windows 32-bit compiler.
It's Windows 32-bit compiler.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
In both cases, Screensync or "A = Inp(&h3da)", the synchronization effect is the same and the execution time is between 0.00001 sec and 0.01790 sec (a bit more sometimes).
0.00001 sec indicates that the graphics card has ended tracing the frame juste at the time of the Screensync command (as well as with "A = Inp(&h3da)"), I have doubts about the efficiency of the synchronization at that moment.
0.00001 sec indicates that the graphics card has ended tracing the frame juste at the time of the Screensync command (as well as with "A = Inp(&h3da)"), I have doubts about the efficiency of the synchronization at that moment.
Re: Question about Inp ?
Look at my article and example: Graphics Mode Refresh and Anti-Flickering
Re: Question about Inp ?
The windows Screensync translates to roughly this:Daniel Ouellette wrote:I asked the question for Screensync because I have no idea what could be behind this command.
It's Windows 32-bit compiler.
Code: Select all
Sleep(1000 / iif(refresh_rate, refresh_rate,60))
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
I'm not an expert like all of you, so I stupidly used "Sleep(1000 / iif(refresh_rate, refresh_rate,60))" and it doesn't work as well as Screensync and even "A = Inp(&h3da)".
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
According to my tests, Screensync and "A = Inp(&h3da)" query the hardware. It is not a Sleep related to the refresh rate.
Re: Question about Inp ?
I don't know what to tell you, then. This is the C code for the graphic library. There is no hardware query during Screensync.Daniel Ouellette wrote:According to my tests, Screensync and "A = Inp(&h3da)" query the hardware. It is not a Sleep related to the refresh rate.
Code: Select all
void fb_hWin32WaitVSync(void)
{
Sleep(1000 / (__fb_gfx->refresh_rate ? __fb_gfx->refresh_rate : 60));
}
The refresh rate is grabbed by the library when you initialize a graphic screen. If you init a screen, it uses that, if you did not, it use 1/60 of a second.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
What is Wait Vsync ?
Re: Question about Inp ?
It's the internal FB runtime function that Screensync calls on Windows.
-
- Posts: 96
- Joined: Apr 17, 2011 17:43
- Location: Montréal, Canada
- Contact:
Re: Question about Inp ?
Is it more than a Sleep ?
Re: Question about Inp ?
No. That was the point of me posting it. That is exactly what code is executed when you call screensync or wait with the port number.Daniel Ouellette wrote:Is it more than a Sleep ?