Pandora Rebirth >> SuperZaxxon

移植gpfce(支援中文路徑)


程式碼如下:

diff -Naur old/Makefile.pandora new/Makefile.pandora
--- old/Makefile.pandora	2019-12-30 17:08:14.883820129 +0800
+++ new/Makefile.pandora	2019-12-30 16:56:25.477570129 +0800
@@ -34,7 +34,7 @@
 	${C}cheat.o ${C}config.o ${C}args.o ${C}vidblit.o ${C}unix-netplay.o \
 	${UNZIPOBJS} \
 	ppu.o movie.o fceu098.o ppu098.o
-LDRIVER += -lm -lz -lpng `sdl-config --libs`
+LDRIVER += -lm -lz -lpng `sdl-config --libs` -liconv
 
 ifeq ($(asm_6502),1)
 TFLAGS  += -DASM_6502
@@ -66,10 +66,10 @@
 
 include Makefile.common
 
-PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
+PND_MAKE ?= /usr/pandora/scripts/pnd_make.sh
 VER ?= $(shell git describe master)
 
-rel: fceu drivers/pandora/fceu.sh drivers/pandora/readme.txt drivers/pandora/skin \
+rel: fceu drivers/pandora/libiconv.so.2 drivers/pandora/fceu.sh drivers/pandora/readme.txt drivers/pandora/skin \
 	drivers/pandora/fceu.png drivers/pandora/fceu.pxml.templ COPYING Authors.md
 	rm -rf out
 	mkdir out
diff -Naur old/drivers/common/menu.c new/drivers/common/menu.c
--- old/drivers/common/menu.c	2019-12-30 17:08:20.891632629 +0800
+++ new/drivers/common/menu.c	2019-12-30 16:50:26.618195129 +0800
@@ -158,11 +158,12 @@
 };
 
 #define MENU_ALIGN_LEFT
-#ifdef __ARM_ARCH_7A__ // assume hires device
+/*#ifdef __ARM_ARCH_7A__ // assume hires device
 #define MENU_X2 1
 #else
 #define MENU_X2 0
-#endif
+#endif*/
+#define MENU_X2 1
 
 #include "../libpicofe/menu.c"
 
diff -Naur old/drivers/common/revision.h new/drivers/common/revision.h
--- old/drivers/common/revision.h	1970-01-01 08:00:00.000000000 +0800
+++ new/drivers/common/revision.h	2019-12-30 16:30:11.602570129 +0800
@@ -0,0 +1 @@
+#define REV "r2"
diff -Naur old/drivers/libpicofe/menu.c new/drivers/libpicofe/menu.c
--- old/drivers/libpicofe/menu.c	2019-12-30 17:08:16.751007629 +0800
+++ new/drivers/libpicofe/menu.c	2019-12-30 17:11:05.563507629 +0800
@@ -28,7 +28,6 @@
 
 extern iconv_t cd;
 extern uint8_t big5font[];
-
 static char static_buff[64];
 static int  menu_error_time = 0;
 char menu_error_msg[64] = { 0, };
@@ -133,16 +132,16 @@
   char    buffer[256];
   int     maxw = (g_menuscreen_w - x) / me_mfont_w;
 
-  if (maxw < 0) 
+  if (maxw < 0)
     return;
 
   va_start(args, texto);
   vsnprintf(buffer, sizeof(buffer), texto, args);
   va_end(args);
 
-  if (maxw > sizeof(buffer) - 1) 
-    maxw = sizeof(buffer) - 1; 
-  buffer[maxw] = 0; 
+  if (maxw > sizeof(buffer) - 1)
+    maxw = sizeof(buffer) - 1;
+  buffer[maxw] = 0;
 
   text_out16_(x,y,buffer,menu_text_color);
 }
diff -Naur old/drivers/pandora/fceu.sh new/drivers/pandora/fceu.sh
--- old/drivers/pandora/fceu.sh	2019-12-30 17:08:21.782257629 +0800
+++ new/drivers/pandora/fceu.sh	2019-12-30 16:55:59.758820129 +0800
@@ -1,5 +1,3 @@
 #!/bin/sh
-
-./fceu
-
+LD_LIBRARY_PATH=. ./fceu
 sudo -n /usr/pandora/scripts/op_lcdrate.sh 60
diff -Naur old/drivers/pandora/pandora.c new/drivers/pandora/pandora.c
--- old/drivers/pandora/pandora.c	2019-12-30 17:08:21.836945129 +0800
+++ new/drivers/pandora/pandora.c	2019-12-30 16:46:08.336945129 +0800
@@ -8,6 +8,7 @@
 #include <unistd.h>
 #include <linux/input.h>
 #include <linux/omapfb.h>
+#include <iconv.h>
 
 #include "../common/platform.h"
 #include "../common/input.h"
@@ -25,6 +26,7 @@
 #include "../libpicofe/linux/fbdev.h"
 #include "../libpicofe/linux/xenv.h"
 
+iconv_t cd=0;
 static int g_layer_x, g_layer_y, g_layer_w, g_layer_h;
 static struct vout_fbdev *main_fb, *layer_fb;
 static void *layer_buf;
@@ -128,6 +130,13 @@
 	const char *main_fb_name, *layer_fb_name;
 	int fd, ret, w, h;
 
+  cd = iconv_open("big5", "utf-8");
+  printf("iconv_open: 0x%x\n", (unsigned int)cd);
+  if(cd == (iconv_t*)-1){
+    printf("failed to open iconv !\n");
+    exit(-1);
+  }
+  
 	memset(&Settings, 0, sizeof(Settings));
 	Settings.frameskip = 0;
 	Settings.sound_rate = 44100;
@@ -509,4 +518,5 @@
 	vout_fbdev_finish(layer_fb);
 	vout_fbdev_finish(main_fb);
 	xenv_finish();
+  iconv_close(cd);
 }

編譯方式如下:

$ cd
$ wget https://github.com/steward-fu/pandora/releases/download/v1.1/fceu_cht.tar.gz
$ tar xvf fceu_cht.tar.gz
$ cd fceu
$ make -f Makefile.pandora
$ make -f Makefile.pandora rel

完成


返回上一頁