From 9e0630ab54cbf6b6e3ec525f1088aa54e163c938 Mon Sep 17 00:00:00 2001
From: notaz
Date: Sun, 9 Oct 2011 22:15:00 +0300
Subject: add caanoo frontend files, move pandora files
---
frontend/pandora/pcsx.png | Bin 0 -> 7981 bytes
frontend/pandora/pcsx.pxml.templ | 40 +++++++++++++
frontend/pandora/pcsx.sh | 16 +++++
frontend/pandora/picorestore.c | 109 +++++++++++++++++++++++++++++++++++
frontend/pandora/skin/background.png | Bin 0 -> 183772 bytes
frontend/pandora/skin/font.png | Bin 0 -> 11264 bytes
frontend/pandora/skin/readme.txt | 8 +++
frontend/pandora/skin/selector.png | Bin 0 -> 386 bytes
frontend/pandora/skin/skin.txt | 4 ++
9 files changed, 177 insertions(+)
create mode 100644 frontend/pandora/pcsx.png
create mode 100644 frontend/pandora/pcsx.pxml.templ
create mode 100755 frontend/pandora/pcsx.sh
create mode 100644 frontend/pandora/picorestore.c
create mode 100644 frontend/pandora/skin/background.png
create mode 100644 frontend/pandora/skin/font.png
create mode 100644 frontend/pandora/skin/readme.txt
create mode 100644 frontend/pandora/skin/selector.png
create mode 100644 frontend/pandora/skin/skin.txt
(limited to 'frontend/pandora')
diff --git a/frontend/pandora/pcsx.png b/frontend/pandora/pcsx.png
new file mode 100644
index 0000000..71f36d0
Binary files /dev/null and b/frontend/pandora/pcsx.png differ
diff --git a/frontend/pandora/pcsx.pxml.templ b/frontend/pandora/pcsx.pxml.templ
new file mode 100644
index 0000000..5c53f24
--- /dev/null
+++ b/frontend/pandora/pcsx.pxml.templ
@@ -0,0 +1,40 @@
+
+
+
+
+ PCSX ReARMed
+
+
+
+
+
+
+ PCSX ReARMed %PR%
+
+ PCSX ReARMed %PR%
+
+
+ PlayStation Emulator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/pandora/pcsx.sh b/frontend/pandora/pcsx.sh
new file mode 100755
index 0000000..2077a29
--- /dev/null
+++ b/frontend/pandora/pcsx.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# stupid nub mode thing
+nub0mode=`cat /proc/pandora/nub0/mode`
+nub1mode=`cat /proc/pandora/nub1/mode`
+echo absolute > /proc/pandora/nub0/mode
+echo absolute > /proc/pandora/nub1/mode
+
+./pcsx "$@"
+
+# restore stuff if pcsx crashes
+./picorestore
+sudo -n /usr/pandora/scripts/op_lcdrate.sh 60
+
+echo "$nub0mode" > /proc/pandora/nub0/mode
+echo "$nub1mode" > /proc/pandora/nub1/mode
diff --git a/frontend/pandora/picorestore.c b/frontend/pandora/picorestore.c
new file mode 100644
index 0000000..77f5720
--- /dev/null
+++ b/frontend/pandora/picorestore.c
@@ -0,0 +1,109 @@
+/*
+ * picorestore - clean up after an omapfb program crash
+ *
+ * Copyright (c) GraÅžvydas "notaz" Ignotas, 2010
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the organization nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+int main()
+{
+ struct fb_var_screeninfo fbvar;
+ struct omapfb_plane_info pi;
+ struct omapfb_mem_info mi;
+ int ret, fbdev, kbdfd;
+
+ fbdev = open("/dev/fb0", O_RDWR);
+ if (fbdev == -1) {
+ perror("open fb0");
+ goto end_fb0;
+ }
+
+ ret = ioctl(fbdev, FBIOGET_VSCREENINFO, &fbvar);
+ if (ret == -1) {
+ perror("FBIOGET_VSCREENINFO ioctl");
+ goto end_fb0;
+ }
+
+ if (fbvar.yoffset != 0) {
+ printf("fixing yoffset.. ");
+ fbvar.yoffset = 0;
+ ret = ioctl(fbdev, FBIOPAN_DISPLAY, &fbvar);
+ if (ret < 0)
+ perror("ioctl FBIOPAN_DISPLAY");
+ else
+ printf("ok\n");
+ }
+
+end_fb0:
+ if (fbdev >= 0)
+ close(fbdev);
+
+ fbdev = open("/dev/fb1", O_RDWR);
+ if (fbdev == -1) {
+ perror("open fb1");
+ goto end_fb1;
+ }
+
+ ret = ioctl(fbdev, OMAPFB_QUERY_PLANE, &pi);
+ ret |= ioctl(fbdev, OMAPFB_QUERY_MEM, &mi);
+ if (ret != 0)
+ perror("QUERY_*");
+
+ pi.enabled = 0;
+ ret = ioctl(fbdev, OMAPFB_SETUP_PLANE, &pi);
+ if (ret != 0)
+ perror("SETUP_PLANE");
+
+ mi.size = 0;
+ ret = ioctl(fbdev, OMAPFB_SETUP_MEM, &mi);
+ if (ret != 0)
+ perror("SETUP_MEM");
+
+end_fb1:
+ if (fbdev >= 0)
+ close(fbdev);
+
+ kbdfd = open("/dev/tty", O_RDWR);
+ if (kbdfd == -1) {
+ perror("open /dev/tty");
+ return 1;
+ }
+
+ if (ioctl(kbdfd, KDSETMODE, KD_TEXT) == -1)
+ perror("KDSETMODE KD_TEXT");
+
+ close(kbdfd);
+
+ return 0;
+}
diff --git a/frontend/pandora/skin/background.png b/frontend/pandora/skin/background.png
new file mode 100644
index 0000000..f4b4523
Binary files /dev/null and b/frontend/pandora/skin/background.png differ
diff --git a/frontend/pandora/skin/font.png b/frontend/pandora/skin/font.png
new file mode 100644
index 0000000..707a5b4
Binary files /dev/null and b/frontend/pandora/skin/font.png differ
diff --git a/frontend/pandora/skin/readme.txt b/frontend/pandora/skin/readme.txt
new file mode 100644
index 0000000..dd83963
--- /dev/null
+++ b/frontend/pandora/skin/readme.txt
@@ -0,0 +1,8 @@
+The skin images can be customized, but there are several limitations:
+
+background.png - must be 320x240 image with 24bit RGB colors.
+font.png - must be 128x160 8bit grayscale image.
+selector.png - must be 8x10 8bit grayscale image.
+
+Font and selector colors can be changed by editing skin.txt.
+
diff --git a/frontend/pandora/skin/selector.png b/frontend/pandora/skin/selector.png
new file mode 100644
index 0000000..a439169
Binary files /dev/null and b/frontend/pandora/skin/selector.png differ
diff --git a/frontend/pandora/skin/skin.txt b/frontend/pandora/skin/skin.txt
new file mode 100644
index 0000000..1d6979f
--- /dev/null
+++ b/frontend/pandora/skin/skin.txt
@@ -0,0 +1,4 @@
+// html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc.
+text_color=ffffc0
+selection_color=808010
+
--
cgit v1.2.3