X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fpandora.c;h=5541c2db68a8a59e17d17b99e5589afb6ece5faf;hb=f6eaae4f09c6abab99692900a31c1df2a06b99af;hp=92047c289ca0e1062e9408b81c18481c46a76d08;hpb=d2f29611d1379a249c8f3f955ed16a336f9290cd;p=libpicofe.git diff --git a/pandora/pandora.c b/pandora/pandora.c index 92047c2..5541c2d 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -1,64 +1,45 @@ #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/oshide.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; + + oshide_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(); + oshide_finish(); - printf("all done"); + printf("all done\n"); } /* lprintf */