Added search paths in case of missing DWARF directories information
[clinton/Virtual-Jaguar-Rx.git] / src / event.h
1 //
2 // EVENT.H: System timing support functionality
3 //
4 // by James Hammons
5 //
6
7 #ifndef __EVENT_H__
8 #define __EVENT_H__
9
10 enum { EVENT_MAIN, EVENT_JERRY };
11
12 //NTSC Timings...
13 #define RISC_CYCLE_IN_USEC 0.03760684198
14 #define M68K_CYCLE_IN_USEC (RISC_CYCLE_IN_USEC * 2)
15 //PAL Timings
16 #define RISC_CYCLE_PAL_IN_USEC 0.03760260812
17 #define M68K_CYCLE_PAL_IN_USEC (RISC_CYCLE_PAL_IN_USEC * 2)
18
19 #define HORIZ_PERIOD_IN_USEC_NTSC 63.555555555
20 #define HORIZ_PERIOD_IN_USEC_PAL 64.0
21
22 #define USEC_TO_RISC_CYCLES(u) (uint32_t)(((u) / (vjs.hardwareTypeNTSC ? RISC_CYCLE_IN_USEC : RISC_CYCLE_PAL_IN_USEC)) + 0.5)
23 #define USEC_TO_M68K_CYCLES(u) (uint32_t)(((u) / (vjs.hardwareTypeNTSC ? M68K_CYCLE_IN_USEC : M68K_CYCLE_PAL_IN_USEC)) + 0.5)
24
25 void InitializeEventList(void);
26 void SetCallbackTime(void (* callback)(void), double time, int type = EVENT_MAIN);
27 void RemoveCallback(void (* callback)(void));
28 void AdjustCallbackTime(void (* callback)(void), double time);
29 double GetTimeToNextEvent(int type = EVENT_MAIN);
30 void HandleNextEvent(int type = EVENT_MAIN);
31
32 #endif // __EVENT_H__