savestate and other bugfixes
[fceu.git] / drivers / gp2x / minimal.c
index 1ac5129..86bfdfb 100644 (file)
@@ -68,7 +68,8 @@ void gp2x_video_flip(void)
 \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(addr, addr + 320*240*2, 0);\r
+       flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0);\r
 \r
        lsw = (unsigned short) addr;\r
        msw = (unsigned short)(addr >> 16);\r
@@ -324,14 +325,14 @@ void gp2x_deinit(void)
        gp2x_memregs[0x2912>>1] = gp2x_screenaddr_old[2];\r
        gp2x_memregs[0x2914>>1] = gp2x_screenaddr_old[3];\r
 \r
+       gp2x_usbjoy_deinit();\r
+\r
        munmap(gp2x_screens[0], FRAMEBUFF_WHOLESIZE);\r
        munmap((void *)gp2x_memregs, 0x10000);\r
        close(memdev);\r
        close(mixerdev);\r
        if (sounddev > 0) close(sounddev);\r
 \r
-       gp2x_usbjoy_deinit();\r
-\r
        printf("all done, running ");\r
 \r
        // Zaq121's alternative frontend support from MAME\r