X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fgp2x.c;h=4995f08b6be7a3925758a083dff75f99869c80fa;hb=c2e83bcd16add6d776ea9ace7bc4e2622277f48e;hp=c0396d9d7162ff9456a2e8bd7bbbb81b78e52ad5;hpb=b9f8cb3d6d8d0b5965fab83a27fc356a56442ddb;p=libpicofe.git diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c index c0396d9..4995f08 100644 --- a/gp2x/gp2x.c +++ b/gp2x/gp2x.c @@ -34,7 +34,7 @@ #include "gp2x.h" #include "usbjoy.h" -#include "asmutils.h" +#include "../common/arm_utils.h" volatile unsigned short *gp2x_memregs; //static @@ -157,6 +157,15 @@ void gp2x_video_wait_vsync(void) } +void gp2x_video_flush_cache(void) +{ + // since we are using the mmu hack, we must flush the cache first + // (the params are most likely wrong, but they seem to work somehow) + //flushcache(addr, addr + 320*240*2, 0); + flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0); +} + + void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len) { char *dst; @@ -184,9 +193,7 @@ void gp2x_memset_all_buffers(int offset, int byte, int len) void gp2x_pd_clone_buffer2(void) { - memcpy(gp2x_screen, gp2x_screens[2], 320*240); - memset(gp2x_screen, 0xe0, 320*8); - memset(gp2x_screen + 320*232, 0xe0, 320*8); + memcpy(gp2x_screen, gp2x_screens[2], 320*240*2); }