X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=pandora%2Fpandora.c;h=dd73973944ffb4fca46f9a7e8fb4e8e847c3dfe6;hb=725d7f6c16b396ad3c7f98175cc20289c5241f3a;hp=e6c92d9e99edfa6d8300778dd6ef72e9f3de473c;hpb=f7c40368a7700e5f18993c71a7d77bfe768c4900;p=libpicofe.git diff --git a/pandora/pandora.c b/pandora/pandora.c index e6c92d9..dd73973 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -15,7 +15,7 @@ #include "../gp2x/gp2x.h" #include "../gp2x/usbjoy.h" -#include "../common/arm_utils.h" +#include "../common/arm_linux.h" static volatile unsigned int *memregs = MAP_FAILED; //static @@ -64,13 +64,11 @@ void gp2x_video_wait_vsync(void) { } - void gp2x_video_flush_cache(void) { -// flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0); +// cache_flush_d_inval_i(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0); } - void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len) { } @@ -89,6 +87,7 @@ void gp2x_memset_all_buffers(int offset, int byte, int len) void gp2x_pd_clone_buffer2(void) { + memset(gp2x_screen, 0, 800*480*2); } @@ -140,11 +139,10 @@ int gp2x_touchpad_read(int *x, int *y) } -//static int s_oldrate = 0, s_oldbits = 0, s_oldstereo = 0; +static int s_oldrate = 0, s_oldbits = 0, s_oldstereo = 0; void gp2x_start_sound(int rate, int bits, int stereo) { -#if 0 int frag = 0, bsize, buffers; // if no settings change, we don't need to do anything @@ -171,13 +169,12 @@ void gp2x_start_sound(int rate, int bits, int stereo) rate, bits, stereo?"stereo":"mono", frag>>16, 1<<(frag&0xffff)); s_oldrate = rate; s_oldbits = bits; s_oldstereo = stereo; -#endif } void gp2x_sound_write(void *buff, int len) { -// write(sounddev, buff, len); + write(sounddev, buff, len); } void gp2x_sound_sync(void) @@ -217,6 +214,13 @@ void gp2x_init(void) exit(1); } */ + fbdev = open("/dev/fb0", O_RDWR); + if (fbdev == -1) + { + printf("open(\"/dev/fb0\") failed with %i\n", errno); + exit(1); + } + ret = ioctl(fbdev, FBIOGET_FSCREENINFO, &fbfix); if (ret == -1) { @@ -231,13 +235,6 @@ void gp2x_init(void) return; } - fbdev = open("/dev/fb0", O_RDWR); - if (fbdev == -1) - { - printf("open(\"/dev/fb0\") failed with %i\n", errno); - exit(1); - } - screen = mmap(0, SCREEN_MAP_SIZE, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev, 0); if (screen == MAP_FAILED) {