X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Fsoc.c;h=d9b956fc0f6c548abc547b6324b4a30712873d1b;hb=093b8a420ef1834c75b2cb86c3fce9784789c638;hp=d34077dbce2cbd4f0218fa95175bc3884505ff87;hpb=421713439805e3d389c420a04afc48fc267eb28f;p=picodrive.git diff --git a/platform/gp2x/soc.c b/platform/gp2x/soc.c index d34077d..d9b956f 100644 --- a/platform/gp2x/soc.c +++ b/platform/gp2x/soc.c @@ -7,20 +7,38 @@ #include #include "soc.h" -#include "../common/emu.h" -gp2x_soc_t gp2x_soc = -1; +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); + gp2x_soc_t soc_detect(void) { volatile unsigned short *memregs; volatile unsigned int *memregl; + static gp2x_soc_t ret = -1; int pollux_chipname[0x30/4 + 1]; char *pollux_chipname_c = (char *)pollux_chipname; - gp2x_soc_t ret = -1; int memdev; int i; + if (ret != -1) + /* already detected */ + return ret; + memdev = open("/dev/mem", O_RDONLY); if (memdev == -1) { @@ -72,7 +90,6 @@ not_pollux_like: out: munmap((void *)memregs, 0x20000); close(memdev); - gp2x_soc = ret; return ret; }