- gp2x_memregs[0x2846>>1] = 0x20|2; //(gp2x_memregs[0x2846>>1] | 0x20) & ~2;\r
- while(!(gp2x_memregs[0x2846>>1] & 2));// usleep(1);\r
+ unsigned short v = gp2x_memregs[0x1182>>1];\r
+ while (!((v ^ gp2x_memregs[0x1182>>1]) & 0x10)) spend_cycles(1024);\r
+}\r
+\r
+\r
+void gp2x_video_flush_cache(void)\r
+{\r
+ // since we are using the mmu hack, we must flush the cache first\r
+ // (the params are most likely wrong, but they seem to work somehow)\r
+ //flushcache(addr, addr + 320*240*2, 0);\r
+ flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0);\r