X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fsoc.c;h=43ebd85c605b823961efef4f9e5f12dfda63e6bb;hb=f342bededbe5d51afd1632e689f5105e50d4f63e;hp=68b2c892dd8d9b3d394ee43523a44f5616ef8bd2;hpb=fa5e045bdc817112c1abf19e65e2d3481d51c48a;p=libpicofe.git diff --git a/gp2x/soc.c b/gp2x/soc.c index 68b2c89..43ebd85 100644 --- a/gp2x/soc.c +++ b/gp2x/soc.c @@ -7,19 +7,39 @@ #include #include "soc.h" -#include "../common/emu.h" + +void (*gp2x_video_flip)(void); +void (*gp2x_video_flip2)(void); +void (*gp2x_video_changemode_ll)(int bpp); +void (*gp2x_video_setpalette)(int *pal, int len); +void (*gp2x_video_RGB_setscaling)(int ln_offs, int W, int H); +void (*gp2x_video_wait_vsync)(void); + +void (*gp2x_set_cpuclk)(unsigned int mhz); + +void (*set_lcd_custom_rate)(int is_pal); +void (*unset_lcd_custom_rate)(void); +void (*set_lcd_gamma)(int g100, int A_SNs_curve); + +void (*set_ram_timings)(void); +void (*unset_ram_timings)(void); +int (*gp2x_read_battery)(void); + +unsigned int (*gp2x_get_ticks_ms)(void); +unsigned int (*gp2x_get_ticks_us)(void); + gp2x_soc_t soc_detect(void) { volatile unsigned short *memregs; volatile unsigned int *memregl; - static gp2x_soc_t ret = -1; + static gp2x_soc_t ret = -2; int pollux_chipname[0x30/4 + 1]; char *pollux_chipname_c = (char *)pollux_chipname; int memdev; int i; - if (ret != -1) + if ((int)ret != -2) /* already detected */ return ret; @@ -27,6 +47,7 @@ gp2x_soc_t soc_detect(void) if (memdev == -1) { perror("open(/dev/mem)"); + ret = -1; return -1; } @@ -35,6 +56,7 @@ gp2x_soc_t soc_detect(void) { perror("mmap(memregs)"); close(memdev); + ret = -1; return -1; } memregl = (volatile void *)memregs;