X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fpandora.c;h=4019994284e4369057bb46858458f6c3e6b7c7ec;hb=b188c2b6d0448a9c328a9dcae5ba5c8c8b5273f3;hp=92047c289ca0e1062e9408b81c18481c46a76d08;hpb=fbe111032e8092d5e031bf3a6f0cee6b9a20333e;p=libpicofe.git diff --git a/pandora/pandora.c b/pandora/pandora.c index 92047c2..4019994 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -1,62 +1,39 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "../linux/sndout_oss.h" -#include "../common/arm_linux.h" +#include "../linux/fbdev.h" #include "../common/emu.h" -static int fbdev = -1; - -#define SCREEN_MAP_SIZE (800*480*2) -static void *screen = MAP_FAILED; - void plat_early_init(void) { } void plat_init(void) { - printf("entering init()\n"); fflush(stdout); + int ret, w, h; - fbdev = open("/dev/fb0", O_RDWR); - if (fbdev == -1) - { - perror("open(\"/dev/fb0\")"); + ret = vout_fbdev_init(&w, &h); + if (ret != 0) { + fprintf(stderr, "couldn't init framebuffer\n"); exit(1); } - screen = mmap(0, SCREEN_MAP_SIZE, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev, 0); - if (screen == MAP_FAILED) - { - perror("mmap(fbptr)"); + if (w != g_screen_width || h != g_screen_height) { + fprintf(stderr, "%dx%d not supported\n", w, h); + vout_fbdev_finish(); exit(1); } - printf("fbptr %p\n", screen); - g_screen_ptr = screen; // snd sndout_oss_init(); - - printf("exitting init()\n"); fflush(stdout); } void plat_finish(void) { - if (screen != MAP_FAILED) - munmap(screen, SCREEN_MAP_SIZE); - if (fbdev >= 0) - close(fbdev); - sndout_oss_exit(); + vout_fbdev_finish(); printf("all done"); }