| 1 | /* |
| 2 | * (C) GraÅžvydas "notaz" Ignotas, 2009,2010 |
| 3 | * |
| 4 | * This work is licensed under the terms of any of these licenses |
| 5 | * (at your option): |
| 6 | * - GNU GPL, version 2 or later. |
| 7 | * - GNU LGPL, version 2.1 or later. |
| 8 | * - MAME license. |
| 9 | * See the COPYING file in the top-level directory. |
| 10 | */ |
| 11 | |
| 12 | /* dummy code for qemu testing, etc */ |
| 13 | #include <stdlib.h> |
| 14 | |
| 15 | #include "soc.h" |
| 16 | #include "../emu.h" |
| 17 | |
| 18 | extern void *gp2x_screens[4]; |
| 19 | |
| 20 | extern unsigned int plat_get_ticks_ms_good(void); |
| 21 | extern unsigned int plat_get_ticks_us_good(void); |
| 22 | |
| 23 | /* video stuff */ |
| 24 | static void gp2x_video_flip_(void) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | /* doulblebuffered flip */ |
| 29 | static void gp2x_video_flip2_(void) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | static void gp2x_video_changemode_ll_(int bpp) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | static void gp2x_video_setpalette_(int *pal, int len) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | static void gp2x_video_RGB_setscaling_(int ln_offs, int W, int H) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | static void gp2x_video_wait_vsync_(void) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | /* RAM timings */ |
| 50 | static void set_ram_timings_(void) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | static void unset_ram_timings_(void) |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | /* LCD refresh */ |
| 59 | static void set_lcd_custom_rate_(int is_pal) |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | static void unset_lcd_custom_rate_(void) |
| 64 | { |
| 65 | } |
| 66 | |
| 67 | static void set_lcd_gamma_(int g100, int A_SNs_curve) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | static int gp2x_read_battery_(void) |
| 72 | { |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | void dummy_init(void) |
| 77 | { |
| 78 | int i; |
| 79 | g_screen_ptr = malloc(320 * 240 * 2); |
| 80 | for (i = 0; i < array_size(gp2x_screens); i++) |
| 81 | gp2x_screens[i] = g_screen_ptr; |
| 82 | |
| 83 | gp2x_video_flip = gp2x_video_flip_; |
| 84 | gp2x_video_flip2 = gp2x_video_flip2_; |
| 85 | gp2x_video_changemode_ll = gp2x_video_changemode_ll_; |
| 86 | gp2x_video_setpalette = gp2x_video_setpalette_; |
| 87 | gp2x_video_RGB_setscaling = gp2x_video_RGB_setscaling_; |
| 88 | gp2x_video_wait_vsync = gp2x_video_wait_vsync_; |
| 89 | |
| 90 | set_lcd_custom_rate = set_lcd_custom_rate_; |
| 91 | unset_lcd_custom_rate = unset_lcd_custom_rate_; |
| 92 | set_lcd_gamma = set_lcd_gamma_; |
| 93 | |
| 94 | set_ram_timings = set_ram_timings_; |
| 95 | unset_ram_timings = unset_ram_timings_; |
| 96 | gp2x_read_battery = gp2x_read_battery_; |
| 97 | |
| 98 | gp2x_get_ticks_ms = plat_get_ticks_ms_good; |
| 99 | gp2x_get_ticks_us = plat_get_ticks_us_good; |
| 100 | } |
| 101 | |
| 102 | void dummy_finish(void) |
| 103 | { |
| 104 | free(gp2x_screens[0]); |
| 105 | } |
| 106 | |