T113 tina linux 移植 gpsp 模拟器
-
gpsp 依赖 SDL 和 SDL_TTF
- SDL 1.2.5 的移植可以看这篇文章 d1s移植sdl1-2-15版本,makefile中需要关掉 directfb 和 tslib
CONFIGURE_ARGS += \ --enable-static=no \ --disable-video-directfb \ --enable-input-tslib=no \
同时在 menuconfig 中也关掉 directfb
- SDL_TTF 可以在 openwrt 的 package 中找到 https://github.com/robbie-cao/openwrt-packages-kyak 直接将 libsdl-ttf 复制到 tina linux 的 package/libs 目录下,这个 makefile 里面是 2.0.9 的版本,可以修改到 2.0.11 ,对应修改 md5sum 为 61e29bd9da8d245bc2471d1b2ce591aa
PKG_NAME:=libsdl-ttf PKG_VERSION:=2.0.11 PKG_RELEASE:=2 PKG_SOURCE:=SDL_ttf-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.libsdl.org/projects/SDL_ttf/release/ PKG_MD5SUM:=61e29bd9da8d245bc2471d1b2ce591aa PKG_BUILD_DIR:=$(COMPILE_DIR)/SDL_ttf-$(PKG_VERSION)
编译好之后 开始编译 gpsp
- 修改 CFLAGS 添加头文件路径
-I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include/SDL -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include
- 修改 LDFLAGS 添加库文件路径
-L/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/lib
- 修改 LIBS 添加需要链接的库文件
-lfreetype -lbz2
完整的 makefile
TARGET = gpsp CC = arm-openwrt-linux-gnueabi-gcc-6.4.1 VPATH = .. ../arm OBJS = main.o cpu.o memory.o video.o input.o sound.o cheats.o zip.o arm_stub.o warm.o cpu_threaded.o video_blend.o sha1.o imageio.o gui_xboy.o #gui.o CFLAGS = -DARM_ARCH -DPC_BUILD -march=armv7-a -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon -ffast-math -Ofast -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include/SDL -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include LDFLAGS = -L/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/lib LIBS = -lSDL -lSDL_ttf -lz -lpng -lfreetype -lbz2 all: $(TARGET) $(TARGET): $(OBJS) $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET) %.o: %.S $(CC) $(CFLAGS) -c -o $@ $< clean: rm -f *.o $(TARGET)
导入环境变量后编译
export PATH=$PATH:/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/toolchain/bin/ export STAGING_DIR=/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/
OK了
因为 t113 的屏幕驱动没有调,所以还没办法验证
完整的 gpsp 代码 https://github.com/hsinyuwang/gpsp 切换到 t113 分支
过程遇到了很多问题,感谢司徒大佬指点! -
补充:sdl_ttf 的 makefile 需要把 DEPENDS:=+libsdl 改成 DEPENDS:=+sdl +libfreetype
-
sdl_ttf 的完整 makefile
# # Copyright (C) 2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=libsdl-ttf PKG_VERSION:=2.0.11 PKG_RELEASE:=2 PKG_SOURCE:=SDL_ttf-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.libsdl.org/projects/SDL_ttf/release/ PKG_MD5SUM:=61e29bd9da8d245bc2471d1b2ce591aa PKG_BUILD_DIR:=$(COMPILE_DIR)/SDL_ttf-$(PKG_VERSION) PKG_INSTALL:=1 include $(BUILD_DIR)/package.mk include $(BUILD_DIR)/nls.mk define Package/libsdl-ttf SECTION:=libs CATEGORY:=Libraries TITLE:=Simple DirectMedia Layer True Font URL:=http://www.libsdl.org/projects/SDL_ttf/ DEPENDS:=+sdl +libfreetype $(ICONV_DEPENDS) $(INTL_DEPENDS) endef define Package/libsdl-ttf/description SDL_ttf is a TrueType font rendering library that is used with the SDL library, and almost as portable. It depends on freetype2 to handle the TrueType font data. It allows a programmer to use multiple TrueType fonts without having to code a font rendering routine themselves. With the power of outline fonts and antialiasing, high quality text output can be obtained without much effort. endef PKG_FIXUP:=libtool TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/SDL CONFIGURE_ARGS += \ --with-sdl-exec-prefix=$(STAGING_DIR) \ --without-x \ LIBS="-lSDL -liconv" TARGET_LDFLAGS+= \ -Wl,-rpath-link=$(STAGING_DIR)/usr/lib define Build/InstallDev $(INSTALL_DIR) \ $(1)/usr/include/SDL \ $(1)/usr/lib $(CP) \ $(PKG_INSTALL_DIR)/usr/include/SDL/SDL_ttf.h \ $(1)/usr/include/SDL/ $(CP) \ $(PKG_INSTALL_DIR)/usr/lib/libSDL_ttf*.{a,so*} \ $(1)/usr/lib/ endef define Package/libsdl-ttf/install $(INSTALL_DIR) \ $(1)/usr/lib $(CP) \ $(PKG_INSTALL_DIR)/usr/lib/libSDL_ttf*.so* \ $(1)/usr/lib/ endef $(eval $(call BuildPackage,libsdl-ttf))
-
@hsinyuwang 请问 GPSP 源码从哪里下载呢?
-
@whycanservice2 一楼最下面有链接
-
-
@hsinyuwang
请问一下 gba_bios.bin要去哪里找
编译完没出现root@imx6ull14x14evk:/tmp# ./gpsp
Sorry, but gpSP requires a Gameboy Advance BIOS
image to run correctly. Make sure to get an
authentic one, it'll be exactly 16384 bytes large
and should have the following md5sum value:a860e8c0b6d573d191e4ec7db1b1e4f6
When you do get it name it gba_bios.bin and put it
in the same directory as gpSP.Press any button to exit.
-
-
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号