3 /** @file hal.h Hardware Abstraction Layer declarations */ |
3 /** @file hal.h Hardware Abstraction Layer declarations */ |
4 |
4 |
5 #ifndef HAL_H |
5 #ifndef HAL_H |
6 #define HAL_H |
6 #define HAL_H |
7 |
7 |
8 typedef struct { |
8 struct HalCommonDriver { |
9 const char *(*start)(const char * const *parm); |
9 const char *(*start)(const char * const *parm); |
10 void (*stop)(void); |
10 void (*stop)(); |
11 } HalCommonDriver; |
11 }; |
12 |
12 |
13 typedef struct { |
13 struct HalVideoDriver { |
14 const char *(*start)(const char * const *parm); |
14 const char *(*start)(const char * const *parm); |
15 void (*stop)(void); |
15 void (*stop)(); |
16 void (*make_dirty)(int left, int top, int width, int height); |
16 void (*make_dirty)(int left, int top, int width, int height); |
17 void (*main_loop)(void); |
17 void (*main_loop)(); |
18 bool (*change_resolution)(int w, int h); |
18 bool (*change_resolution)(int w, int h); |
19 void (*toggle_fullscreen)(bool fullscreen); |
19 void (*toggle_fullscreen)(bool fullscreen); |
20 } HalVideoDriver; |
20 }; |
21 |
21 |
22 typedef struct { |
22 struct HalSoundDriver { |
23 const char *(*start)(const char * const *parm); |
23 const char *(*start)(const char * const *parm); |
24 void (*stop)(void); |
24 void (*stop)(); |
25 } HalSoundDriver; |
25 }; |
26 |
26 |
27 typedef struct { |
27 struct HalMusicDriver { |
28 const char *(*start)(const char * const *parm); |
28 const char *(*start)(const char * const *parm); |
29 void (*stop)(void); |
29 void (*stop)(); |
30 |
30 |
31 void (*play_song)(const char *filename); |
31 void (*play_song)(const char *filename); |
32 void (*stop_song)(void); |
32 void (*stop_song)(); |
33 bool (*is_song_playing)(void); |
33 bool (*is_song_playing)(); |
34 void (*set_volume)(byte vol); |
34 void (*set_volume)(byte vol); |
35 } HalMusicDriver; |
35 }; |
36 |
36 |
37 extern HalMusicDriver *_music_driver; |
37 extern HalMusicDriver *_music_driver; |
38 extern HalSoundDriver *_sound_driver; |
38 extern HalSoundDriver *_sound_driver; |
39 extern HalVideoDriver *_video_driver; |
39 extern HalVideoDriver *_video_driver; |
40 |
40 |