1eb704b6 |
1 | /* dummy code for qemu testing, etc */ |
2 | #include <stdlib.h> |
3 | |
4 | #include "soc.h" |
5 | #include "../common/emu.h" |
6 | |
7 | extern void *gp2x_screens[4]; |
8 | |
9 | extern unsigned int plat_get_ticks_ms_good(void); |
10 | extern unsigned int plat_get_ticks_us_good(void); |
11 | |
12 | /* video stuff */ |
13 | static void gp2x_video_flip_(void) |
14 | { |
15 | } |
16 | |
17 | /* doulblebuffered flip */ |
18 | static void gp2x_video_flip2_(void) |
19 | { |
20 | } |
21 | |
22 | static void gp2x_video_changemode_ll_(int bpp) |
23 | { |
24 | } |
25 | |
26 | static void gp2x_video_setpalette_(int *pal, int len) |
27 | { |
28 | } |
29 | |
30 | static void gp2x_video_RGB_setscaling_(int ln_offs, int W, int H) |
31 | { |
32 | } |
33 | |
34 | static void gp2x_video_wait_vsync_(void) |
35 | { |
36 | } |
37 | |
1eb704b6 |
38 | /* RAM timings */ |
39 | static void set_ram_timings_(void) |
40 | { |
41 | } |
42 | |
43 | static void unset_ram_timings_(void) |
44 | { |
45 | } |
46 | |
47 | /* LCD refresh */ |
48 | static void set_lcd_custom_rate_(int is_pal) |
49 | { |
50 | } |
51 | |
52 | static void unset_lcd_custom_rate_(void) |
53 | { |
54 | } |
55 | |
56 | static void set_lcd_gamma_(int g100, int A_SNs_curve) |
57 | { |
58 | } |
59 | |
60 | static int gp2x_read_battery_(void) |
61 | { |
62 | return 0; |
63 | } |
64 | |
65 | void dummy_init(void) |
66 | { |
67 | int i; |
68 | g_screen_ptr = malloc(320 * 240 * 2); |
69 | for (i = 0; i < array_size(gp2x_screens); i++) |
70 | gp2x_screens[i] = g_screen_ptr; |
71 | |
72 | gp2x_video_flip = gp2x_video_flip_; |
73 | gp2x_video_flip2 = gp2x_video_flip2_; |
74 | gp2x_video_changemode_ll = gp2x_video_changemode_ll_; |
75 | gp2x_video_setpalette = gp2x_video_setpalette_; |
76 | gp2x_video_RGB_setscaling = gp2x_video_RGB_setscaling_; |
77 | gp2x_video_wait_vsync = gp2x_video_wait_vsync_; |
78 | |
1eb704b6 |
79 | set_lcd_custom_rate = set_lcd_custom_rate_; |
80 | unset_lcd_custom_rate = unset_lcd_custom_rate_; |
81 | set_lcd_gamma = set_lcd_gamma_; |
82 | |
83 | set_ram_timings = set_ram_timings_; |
84 | unset_ram_timings = unset_ram_timings_; |
85 | gp2x_read_battery = gp2x_read_battery_; |
86 | |
87 | gp2x_get_ticks_ms = plat_get_ticks_ms_good; |
88 | gp2x_get_ticks_us = plat_get_ticks_us_good; |
89 | } |
90 | |
91 | void dummy_finish(void) |
92 | { |
93 | free(gp2x_screens[0]); |
94 | } |
95 | |