soc_dummy.c 1.7 KB

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