Qbasicnews.com

Full Version: Iron Speed Initialiser released
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
The ISI is now available to download. It is a great little peice of code that is used for making a given program run the same speed on every computer. Get it at http://www.geocities.com/norwickdown/index.htm.

News submitted by: Iron Software
Typo? Isn't it spelled "initializer"?
Did you guys even look at it?????

VSYNCH is better Wink
Vsych, any of the fine hi-res timers available, some of the libraries' frame rate caps, anything works better than TIMER and a for loop.
Actually, loops can be used for very accurate delays if calibrated correctly.

Especially in cases where you need delays < 1 ms, and you can't touch the timer. (TSRs, for example.)
Or we could all use the UGL timer Smile
And, even though antoni would disagree, the clock function i've been shoving in everyone's face that simply refreshes the timer at an increased rate and screws setting tsrs or interrupt vectors.

The reason loops can't be used properly for delay, is:

1) you can only pause with it, not really cap a frame rate.
2) loops are inconsistant. You cpu moves at different rates depending on its congestion. It's minor, but htere.

The only think you can really do is keep a really hi-res clock handy. Before he disappeared, robert claypool pointed me to a windows virtual device that could keep time in milliseconds. In pure dos, the clock function works perfectly. In windows,however, it may be off 1/18th of a second in either direction. Ideally, you'd keep a function for both and detect windows at the start of the program. But I still like seav's timer best Smile Nothing better than a timer whose precision is 4 million times a second.

...or, vsynch can work 99% of the time if you dont need anything more controllable.
Quote:The reason loops can't be used properly for delay, is:

1) you can only pause with it, not really cap a frame rate.
2) loops are inconsistant. You cpu moves at different rates depending on its congestion. It's minor, but htere.

Your first point (1) makes no sense. You're saying "the reason loops can't be used for a delay is because you can only use them for a delay." Right. That's the point.

And as far as (2) goes, loops are far more accurate when calibrated than any high res timer.

Also, vsync is not a catch-all solution. Under certain conditions, waiting for vsync has no effect. (an OS/2 dos box, for example...)


I'm not saying loops should be used to control the framerate of games, but I am saying they are very useful and accurate in the right conditions.
meh? the system timer is separate from your cpu. It's an oscillator with a frequency of something like a million cycles per second. You the cpu is being used for all kinds of crap, calculating stuff in between loops or different programs or just plain congestion. Code executes at different speeds depending on how efficient the cpu is running, and loops can run at different speeds depending on what's going on. It's easier just to trust the system timer, which is pretty capable and constant, and surely you dont need more than a million ticks a second.
When you are running under pure DOS, your CPU is doing exactly what you tell it to. And again, there are times you can't touch the timer.
Pages: 1 2 3