[SDL] Dynamically Linking SDL_main with borland C++
gamegod3001 at hotmail.com
Thu Aug 23 20:57:00 PDT 2001
Standa Opichal <opichals at seznam.cz> wrote:
>Well, what are the other methods. If you have an emulator and want to make
>e.g. 200Hz timer. You must blit the screen at 50Hz frequency.
>What is the SDL like (multiplatform) solution for this problems?
You should not need to use the timer for anything in an emulator, except
possibly for meta-stuff like the user interface. Exactly how to do it
depends on your emulation model, your timing contraints, and your
For instance, you can use an cpu cycle-based event queue, where you
insert interrupts from various sources. Each cycle (or every N cycles,
for some value of N) you check the event queue. To synchronise your
emulator with real time in some way, you could call SDL_GetTicks()
periodically and wait a few cycles if you are ahead, or decide to skip a
frame update if you are behind. There are many different ways of doing it.
There are many emulators with source code available, so I suggest you
start reading --- it can be *very* educational. And even if they
emulate different machines, they often have to solve the same problems.
(200Hz, you are not writing an ST emulator by any chance? :-)
More information about the SDL