X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=gp2x%2Fgp2x.c;h=d6a701c97801ec529ccc681f899531d0e4e5c6a4;hb=59d0f042a1bf325213ca8da779d89bb969881952;hp=f138be636ae501fb2bf8020892404014bed2a686;hpb=0ae6813e481cdbb7a661b49dba612bd1c6670433;p=libpicofe.git diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c index f138be6..d6a701c 100644 --- a/gp2x/gp2x.c +++ b/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); }