notaz.gp2x.de
/
ginge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better port to newer libpicofe
[ginge.git]
/
common
/
wiz_video.c
diff --git
a/common/wiz_video.c
b/common/wiz_video.c
index
657e4af
..
4bfc7c5
100644
(file)
--- a/
common/wiz_video.c
+++ b/
common/wiz_video.c
@@
-1,3
+1,9
@@
+/*
+ * GINGE - GINGE Is Not Gp2x Emulator
+ * (C) notaz, 2010-2011
+ *
+ * This work is licensed under the MAME license, see COPYING file for details.
+ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-8,10
+14,11
@@
#include <sys/mman.h>
#include <unistd.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <unistd.h>
#include <linux/fb.h>
-#include "warm.h"
+#include "warm
/warm
.h"
static volatile unsigned short *memregs;
static volatile unsigned int *memregl;
static volatile unsigned short *memregs;
static volatile unsigned int *memregl;
+int probably_caanoo;
int memdev = -1;
#define FB_BUF_COUNT 4
int memdev = -1;
#define FB_BUF_COUNT 4
@@
-67,6
+74,8
@@
static int vout_gp2x_init(int no_dblbuf)
printf("framebuffer: \"%s\" @ %08lx\n", fbfix.id, fbfix.smem_start);
fb_paddr[0] = fbfix.smem_start;
printf("framebuffer: \"%s\" @ %08lx\n", fbfix.id, fbfix.smem_start);
fb_paddr[0] = fbfix.smem_start;
+ probably_caanoo = fb_paddr[0] >= 0x4000000;
+ printf("looking like Caanoo? %s.\n", probably_caanoo ? "yes" : "no");
gp2x_screens[0] = mmap(0, 320*240*2*FB_BUF_COUNT, PROT_READ|PROT_WRITE,
MAP_SHARED, memdev, fb_paddr[0]);
gp2x_screens[0] = mmap(0, 320*240*2*FB_BUF_COUNT, PROT_READ|PROT_WRITE,
MAP_SHARED, memdev, fb_paddr[0]);
@@
-107,6
+116,9
@@
static void vout_gp2x_set_mode(int bpp, int rot)
unsigned int r;
int ret;
unsigned int r;
int ret;
+ if (probably_caanoo)
+ rot = 0;
+
rot_cmd[0] = rot ? 6 : 5;
ret = ioctl(fbdev, _IOW('D', 90, int[2]), rot_cmd);
if (ret < 0)
rot_cmd[0] = rot ? 6 : 5;
ret = ioctl(fbdev, _IOW('D', 90, int[2]), rot_cmd);
if (ret < 0)