274f95a9 |
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 | |
38 | /* CPU clock */ |
39 | static void gp2x_set_cpuclk_(unsigned int mhz) |
40 | { |
41 | } |
42 | |
43 | /* RAM timings */ |
44 | static void set_ram_timings_(void) |
45 | { |
46 | } |
47 | |
48 | static void unset_ram_timings_(void) |
49 | { |
50 | } |
51 | |
52 | /* LCD refresh */ |
53 | static void set_lcd_custom_rate_(int is_pal) |
54 | { |
55 | } |
56 | |
57 | static void unset_lcd_custom_rate_(void) |
58 | { |
59 | } |
60 | |
61 | static void set_lcd_gamma_(int g100, int A_SNs_curve) |
62 | { |
63 | } |
64 | |
65 | static int gp2x_read_battery_(void) |
66 | { |
67 | return 0; |
68 | } |
69 | |
70 | void dummy_init(void) |
71 | { |
72 | int i; |
73 | g_screen_ptr = malloc(320 * 240 * 2); |
74 | for (i = 0; i < array_size(gp2x_screens); i++) |
75 | gp2x_screens[i] = g_screen_ptr; |
76 | |
77 | gp2x_video_flip = gp2x_video_flip_; |
78 | gp2x_video_flip2 = gp2x_video_flip2_; |
79 | gp2x_video_changemode_ll = gp2x_video_changemode_ll_; |
80 | gp2x_video_setpalette = gp2x_video_setpalette_; |
81 | gp2x_video_RGB_setscaling = gp2x_video_RGB_setscaling_; |
82 | gp2x_video_wait_vsync = gp2x_video_wait_vsync_; |
83 | |
84 | gp2x_set_cpuclk = gp2x_set_cpuclk_; |
85 | |
86 | set_lcd_custom_rate = set_lcd_custom_rate_; |
87 | unset_lcd_custom_rate = unset_lcd_custom_rate_; |
88 | set_lcd_gamma = set_lcd_gamma_; |
89 | |
90 | set_ram_timings = set_ram_timings_; |
91 | unset_ram_timings = unset_ram_timings_; |
92 | gp2x_read_battery = gp2x_read_battery_; |
93 | |
94 | gp2x_get_ticks_ms = plat_get_ticks_ms_good; |
95 | gp2x_get_ticks_us = plat_get_ticks_us_good; |
96 | } |
97 | |
98 | void dummy_finish(void) |
99 | { |
100 | free(gp2x_screens[0]); |
101 | } |
102 | |