X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpandora%2Fpandora.c;h=5541c2db68a8a59e17d17b99e5589afb6ece5faf;hb=e59af1c9b829484ffa4c84b680c6ce9abcdfa53f;hp=ce9fac670cfad678503d207f13f7e6def09ef2ac;hpb=74f5e726ba66ace3c4976a4ac5f13a92fdbfbae1;p=picodrive.git diff --git a/platform/pandora/pandora.c b/platform/pandora/pandora.c index ce9fac6..5541c2d 100644 --- a/platform/pandora/pandora.c +++ b/platform/pandora/pandora.c @@ -1,62 +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" -#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; + + 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 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(); + oshide_finish(); - printf("all done"); + printf("all done\n"); } /* lprintf */ @@ -69,13 +52,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) {} -*/