+u32 gpsp_gp2x_gpiodev = 0;
+
+static volatile u16 *gpsp_gp2x_memregs;
+static volatile u32 *gpsp_gp2x_memregl;
+
+#ifdef WIZ_BUILD
+#include <linux/fb.h>
+void *gpsp_gp2x_screen;
+#define fb_buf_count 4
+static u32 fb_paddr[fb_buf_count];
+static void *fb_vaddr[fb_buf_count];
+static u32 fb_work_buf;
+static int fb_buf_use;
+static int fbdev;
+
+static void fb_video_init()
+{
+ struct fb_fix_screeninfo fbfix;
+ int i, ret;
+
+ fbdev = open("/dev/fb0", O_RDWR);
+ if (fbdev < 0) {
+ perror("can't open fbdev");
+ exit(1);
+ }
+
+ ret = ioctl(fbdev, FBIOGET_FSCREENINFO, &fbfix);
+ if (ret == -1)
+ {
+ perror("ioctl(fbdev) failed");
+ exit(1);
+ }
+
+ printf("framebuffer: \"%s\" @ %08lx\n", fbfix.id, fbfix.smem_start);
+ fb_paddr[0] = fbfix.smem_start;
+
+ fb_vaddr[0] = mmap(0, 320*240*2*fb_buf_count, PROT_READ|PROT_WRITE,
+ MAP_SHARED, gpsp_gp2x_dev, fb_paddr[0]);
+ if (fb_vaddr[0] == MAP_FAILED)
+ {
+ perror("mmap(fb_vaddr) failed");
+ exit(1);
+ }
+ memset(fb_vaddr[0], 0, 320*240*2*fb_buf_count);
+
+ printf(" %p -> %08x\n", fb_vaddr[0], fb_paddr[0]);
+ for (i = 1; i < fb_buf_count; i++)
+ {
+ fb_paddr[i] = fb_paddr[i-1] + 320*240*2;
+ fb_vaddr[i] = (char *)fb_vaddr[i-1] + 320*240*2;
+ printf(" %p -> %08x\n", fb_vaddr[i], fb_paddr[i]);
+ }
+ fb_work_buf = 0;
+ fb_buf_use = fb_buf_count;