2d3fa877 |
1 | #ifndef LIBPICOFE_PLAT_H |
2 | #define LIBPICOFE_PLAT_H |
3 | |
24b24674 |
4 | #ifdef __cplusplus |
5 | extern "C" { |
6 | #endif |
7 | |
2d3fa877 |
8 | /* target device, everything is optional */ |
9 | struct plat_target { |
10 | int (*cpu_clock_get)(void); |
11 | int (*cpu_clock_set)(int clock); |
12 | int (*get_bat_capacity)(void); |
13 | void (*set_filter)(int which); |
14 | char **filters; |
15 | void (*set_lcdrate)(int is_pal); |
16 | void (*step_volume)(int is_up); |
17 | }; |
b5bfb864 |
18 | |
2d3fa877 |
19 | extern struct plat_target plat_target; |
20 | int plat_target_init(void); |
21 | void plat_target_finish(void); |
22 | void plat_target_setup_input(void); |
93c18cb4 |
23 | |
2d3fa877 |
24 | static __inline void plat_target_set_filter(int which) |
25 | { |
26 | if (plat_target.set_filter) |
27 | plat_target.set_filter(which); |
28 | } |
d572cbad |
29 | |
2d3fa877 |
30 | static __inline void plat_target_set_lcdrate(int is_pal) |
31 | { |
32 | if (plat_target.set_lcdrate) |
33 | plat_target.set_lcdrate(is_pal); |
34 | } |
388947f3 |
35 | |
24b24674 |
36 | /* menu: enter (switch bpp, etc), begin/end drawing */ |
37 | void plat_video_menu_enter(int is_rom_loaded); |
38 | void plat_video_menu_begin(void); |
39 | void plat_video_menu_end(void); |
95a2ec38 |
40 | void plat_video_menu_leave(void); |
24b24674 |
41 | |
b188c2b6 |
42 | void plat_video_flip(void); |
b5bfb864 |
43 | void plat_video_wait_vsync(void); |
b188c2b6 |
44 | |
2d3fa877 |
45 | /* return the dir/ where configs, saves, bios, etc. are found */ |
46 | int plat_get_root_dir(char *dst, int len); |
fa8d1331 |
47 | |
049a6b3e |
48 | int plat_is_dir(const char *path); |
4ab30ad4 |
49 | int plat_wait_event(int *fds_hnds, int count, int timeout_ms); |
50 | void plat_sleep_ms(int ms); |
049a6b3e |
51 | |
5e417de5 |
52 | void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed); |
53 | void *plat_mremap(void *ptr, size_t oldsize, size_t newsize); |
54 | void plat_munmap(void *ptr, size_t size); |
55 | |
8ced8d2b |
56 | /* timers, to be used for time diff and must refer to the same clock */ |
b5bfb864 |
57 | unsigned int plat_get_ticks_ms(void); |
58 | unsigned int plat_get_ticks_us(void); |
59 | void plat_wait_till_us(unsigned int us); |
4ab30ad4 |
60 | |
93c18cb4 |
61 | void plat_debug_cat(char *str); |
049a6b3e |
62 | |
24b24674 |
63 | #ifdef __cplusplus |
64 | } // extern "C" |
65 | #endif |
66 | |
2d3fa877 |
67 | #endif /* LIBPICOFE_PLAT_H */ |