X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Fgp2x.c;h=d6a701c97801ec529ccc681f899531d0e4e5c6a4;hb=aae35e84da8631de2c0e0faec578bc7f187c3b62;hp=f138be636ae501fb2bf8020892404014bed2a686;hpb=0af33fe0ef24a3e3b65217ad0d7aa2db03d16fc1;p=picodrive.git diff --git a/platform/gp2x/gp2x.c b/platform/gp2x/gp2x.c index f138be6..d6a701c 100644 --- a/platform/gp2x/gp2x.c +++ b/platform/gp2x/gp2x.c @@ -34,6 +34,7 @@ #include "gp2x.h" #include "usbjoy.h" +#include "asmutils.h" volatile unsigned short *gp2x_memregs; //static @@ -149,11 +150,10 @@ void gp2x_video_RGB_setscaling(int ln_offs, int W, int H) } -/* LCD updates @ 80Hz? */ void gp2x_video_wait_vsync(void) { - gp2x_memregs[0x2846>>1] = 0x20|2; //(gp2x_memregs[0x2846>>1] | 0x20) & ~2; - while(!(gp2x_memregs[0x2846>>1] & 2));// usleep(1); + unsigned short v = gp2x_memregs[0x1182>>1]; + while (!((v ^ gp2x_memregs[0x1182>>1]) & 0x10)) spend_cycles(1024); }