X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fpandora.c;h=4019994284e4369057bb46858458f6c3e6b7c7ec;hb=b188c2b6d0448a9c328a9dcae5ba5c8c8b5273f3;hp=ce9fac670cfad678503d207f13f7e6def09ef2ac;hpb=7fd581f40bb5273e81dc08afdd55224c26c8fb9e;p=libpicofe.git diff --git a/pandora/pandora.c b/pandora/pandora.c index ce9fac6..4019994 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -1,60 +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" -#include "pandora.h" -static int fbdev = -1; - -#define SCREEN_MAP_SIZE (800*480*2) -static void *screen = MAP_FAILED; +void plat_early_init(void) +{ +} -/* common */ -void pnd_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 pnd_exit(void) +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"); } @@ -69,13 +48,3 @@ void lprintf(const char *fmt, ...) va_end(vl); } - -/* fake GP2X */ -/* -void set_gamma(int g100, int A_SNs_curve) {} -void set_FCLK(unsigned MHZ) {} -void set_LCD_custom_rate(int rate) {} -void unset_LCD_custom_rate(void) {} -void Pause940(int yes) {} -void Reset940(int yes, int bank) {} -*/