diff --git a/pandora/pandora.c b/pandora/pandora.c index e6c92d9..9c4fc5c 100644 --- a/pandora/pandora.c +++ b/pandora/pandora.c @@ -217,6 +217,13 @@ void gp2x_init(void) exit(1); } */ + fbdev = open("/dev/fb0", O_RDWR); + if (fbdev == -1) + { + printf("open(\"/dev/fb0\") failed with %i\n", errno); + exit(1); + } + ret = ioctl(fbdev, FBIOGET_FSCREENINFO, &fbfix); if (ret == -1) { @@ -231,13 +238,6 @@ void gp2x_init(void) return; } - fbdev = open("/dev/fb0", O_RDWR); - if (fbdev == -1) - { - printf("open(\"/dev/fb0\") failed with %i\n", errno); - exit(1); - } - screen = mmap(0, SCREEN_MAP_SIZE, PROT_WRITE|PROT_READ, MAP_SHARED, fbdev, 0); if (screen == MAP_FAILED) {