]> Shamusworld >> Repos - virtualjaguar/blob - src/event.h
Video rendering now has correct timing per frame, in both NTSC and PAL mode.
[virtualjaguar] / src / event.h
1 //
2 // EVENT.H: System timing support functionality
3 //
4 // by James L. Hammons
5 //
6
7 #ifndef __EVENT_H__
8 #define __EVENT_H__
9
10 #include "types.h"
11
12 #define RISC_CYCLE_IN_USEC        0.03760684198
13 #define M68K_CYCLE_IN_USEC        (RISC_CYCLE_IN_USEC * 2)
14
15 #define HORIZ_PERIOD_IN_USEC_NTSC 63.555555555
16 #define HORIZ_PERIOD_IN_USEC_PAL  64.0
17
18 #define USEC_TO_RISC_CYCLES(u) (uint32)(((u) / RISC_CYCLE_IN_USEC) + 0.5)
19 #define USEC_TO_M68K_CYCLES(u) (uint32)(((u) / M68K_CYCLE_IN_USEC) + 0.5)
20
21 void InitializeEventList(void);
22 void SetCallbackTime(void (* callback)(void), double time);
23 void RemoveCallback(void (* callback)(void));
24 void AdjustCallbackTime(void (* callback)(void), double time);
25 double GetTimeToNextEvent(void);
26 void HandleNextEvent(void);
27
28 #endif  // __EVENT_H__