perfect vsync

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@218 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-08-08 19:49:11 +00:00
parent 0ae6813e48
commit 59d0f042a1
4 changed files with 64 additions and 32 deletions

View file

@ -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);
}