X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fgp2x%2Fminimal.c;h=86bfdfb74aedc48b8c45996834a8a578e81276c3;hb=0bb3fe122854be9af6c3024fef9f503d27bc63a1;hp=9716e5b9f5216ec651969670febb38fc7e09ddf5;hpb=989672f4f2b4b4b2b373271374e6546546091c10;p=fceu.git diff --git a/drivers/gp2x/minimal.c b/drivers/gp2x/minimal.c index 9716e5b..86bfdfb 100644 --- a/drivers/gp2x/minimal.c +++ b/drivers/gp2x/minimal.c @@ -68,7 +68,8 @@ void gp2x_video_flip(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(addr, addr + 320*240*2, 0); + flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0); lsw = (unsigned short) addr; msw = (unsigned short)(addr >> 16); @@ -219,7 +220,10 @@ void gp2x_start_sound(int rate, int bits, int stereo) if (sounddev > 0) close(sounddev); sounddev = open("/dev/dsp", O_WRONLY|O_ASYNC); if (sounddev == -1) + { printf("open(\"/dev/dsp\") failed with %i\n", errno); + return; + } ioctl(sounddev, SNDCTL_DSP_SPEED, &rate); ioctl(sounddev, SNDCTL_DSP_SETFMT, &bits); @@ -321,14 +325,14 @@ void gp2x_deinit(void) gp2x_memregs[0x2912>>1] = gp2x_screenaddr_old[2]; gp2x_memregs[0x2914>>1] = gp2x_screenaddr_old[3]; + gp2x_usbjoy_deinit(); + munmap(gp2x_screens[0], FRAMEBUFF_WHOLESIZE); munmap((void *)gp2x_memregs, 0x10000); close(memdev); close(mixerdev); if (sounddev > 0) close(sounddev); - gp2x_usbjoy_deinit(); - printf("all done, running "); // Zaq121's alternative frontend support from MAME