[solved]Any XP user here ?

Windows specific questions.
D.J.Peters
Posts: 8210
Joined: May 28, 2005 3:28
Contact:

[solved]Any XP user here ?

Postby D.J.Peters » Nov 06, 2020 5:53

If any XP user here can you report min: max: from timeGetDevCaps() please ?
(I can't test it self I'm not at home ATM)

Joshy

Code: Select all

#ifdef __FB_WIN32__
 #include "windows.bi"
 #include "win/mmsystem.bi"
#else
 #error 666, sorry Windows only test !
#endif

dim shared as TIMECAPS gTimeCaps

sub _moduleInit constructor
  print "module()"
  timeGetDevCaps(@gTimeCaps,sizeof(TIMECAPS))
  print "min: " & gTimeCaps.wPeriodMin & " max: " & gTimeCaps.wPeriodMax
  timeBeginPeriod(gTimeCaps.wPeriodMin)
end sub

sub _moduleExit destructor
  print "module~"
  timeEndPeriod(gTimeCaps.wPeriodMin)
  beep
  sleep 3000,1
end sub

sub SleepMS(byval ms as ulong)
  static as ulong rest=0
  if ms<gTimeCaps.wPeriodMin then
    ms = gTimeCaps.wPeriodMin
  elseif ms>gTimeCaps.wPeriodMax then
    ms = gTimeCaps.wPeriodMax
  end if
  ' if on XP min value >1 eg. 15 store the remainder for next SleepMS() call
  ms += rest : rest = ms mod gTimeCaps.wPeriodMin
  SleepEx(ms, FALSE)
end sub


'
' main
'
screenres 640,480,8,2
screenset 1,0
const as single radius = 30.0f
dim as single x = -radius
while inkey()=""
  cls
  circle(x,240),radius,1,,,,F
  flip
  SleepMS(1000/(640+2*radius))
  x+=1:if x-radius>639 then x=-radius
wend
Last edited by D.J.Peters on Nov 06, 2020 21:15, edited 1 time in total.
hhr
Posts: 12
Joined: Nov 29, 2019 10:41

Re: Any XP user here ?

Postby hhr » Nov 06, 2020 7:50

min: 1 max: 1000000
Last edited by hhr on Nov 07, 2020 5:37, edited 1 time in total.
grindstone
Posts: 785
Joined: May 05, 2015 5:35
Location: Germany

Re: Any XP user here ?

Postby grindstone » Nov 06, 2020 12:18

Working on XP (as main OS) without any problems.

module()
min: 1 max: 1000000
D.J.Peters
Posts: 8210
Joined: May 28, 2005 3:28
Contact:

Re: Any XP user here ?

Postby D.J.Peters » Nov 06, 2020 21:15

Thanks for the report.

Joshy
antarman
Posts: 68
Joined: Jun 12, 2006 9:27
Location: Russia, Krasnodar

Re: [solved]Any XP user here ?

Postby antarman » Nov 07, 2020 6:40

module()
min: 1 max: 1000000
work is well.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests