X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fpandora.c;h=736052f8fcb424ec56a521c5259f309899bd30ee;hb=8ced22511b8082415a42fd74192602ea8ca661a1;hp=92047c289ca0e1062e9408b81c18481c46a76d08;hpb=d2f29611d1379a249c8f3f955ed16a336f9290cd;p=libpicofe.git diff --git a/pandora/pandora.c b/pandora/pandora.c index 92047c2..736052f 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -1,62 +1,42 @@ #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 "../linux/x11h.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; + + x11h_init(); - 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"); }