higan(bsnes)游戏模拟器的编译和试玩

12 篇文章 0 订阅

higan 是一款开源的游戏模拟器实现,这里直接引用英文介绍:

higan (formerly bsnes) is a Nintendo multi-system emulator that began development on 2004-10-14.

It currently supports the following systems:

  • Nintendo Famicom
  • Nintendo Super Famicom
    • Super Game Boy
    • BS-X Satellaview
    • Sufami Turbo
  • Nintendo Game Boy
  • Nintendo Game Boy Color
  • Nintendo Game Boy Advance
  • Sega Master System
  • Sega Game Gear
  • Sega Mega Drive
  • NEC PC Engine
  • NEC SuperGrafx
  • Bandai WonderSwan
  • Bandai WonderSwan Color

higan focuses on accuracy and clean code above all else. It never uses speed or compatibility hacks. As a result, the minimum system requirements are higher than with other emulators.

higan可以在ubuntu下编译运行, 下面列出详细过程.

step 1: 获取源码

     higan采用GPLV3协议,源码托管在gitlab. 执行git clone https://gitlab.com/higan/higan.git 下载源码到本地

     本测试使用的commid id号为: 23dd28952b20de9c47dd4619214019beaad2fc93

step 2: 安装环境依赖文件:

sudo apt-get install build-essential libgtk2.0-dev libpulse-dev \
    mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl1.2-dev \
    libxv-dev libao-dev libopenal-dev libudev-dev

step 3:

    修改两个个文件,否则编译不过

    modified:   higan/GNUmakefile
    modified:   nall/random.hpp

GNUmakefile:

  higan支持两个编译目标,默认是bsnes, bsnes支持的游戏文件较少,不支持GBA游戏文件. 所以这里改为higan目标。

diff --git a/higan/GNUmakefile b/higan/GNUmakefile
index b74420d..03d2fb3 100644
--- a/higan/GNUmakefile
+++ b/higan/GNUmakefile
@@ -1,4 +1,4 @@
-target := bsnes
+target := higan
 binary := application
 build := performance
 openmp := true

random.hpp:

  删除getrandom调用和头文件引用,否则编译不过。

diff --git a/nall/random.hpp b/nall/random.hpp
index 1684996..7d01f0f 100644
--- a/nall/random.hpp
+++ b/nall/random.hpp
@@ -8,7 +8,7 @@
 #include <nall/cipher/chacha20.hpp>
 
 #if defined(PLATFORM_LINUX)
-  #include <sys/random.h>
+  //#include <sys/random.h>
 #elif defined(PLATFORM_WINDOWS)
   #include <wincrypt.h>
 #endif
@@ -38,7 +38,7 @@ protected:
     #if defined(PLATFORM_BSD) || defined(PLATFORM_MACOS)
     for(uint n : range(8)) seed = seed << 32 | (uint32_t)arc4random();
     #elif defined(PLATFORM_LINUX)
-    getrandom(&seed, 32, GRND_NONBLOCK);
+    //getrandom(&seed, 32, GRND_NONBLOCK);
     #elif defined(PLATFORM_WINDOWS)

step4:

 编译 higan:

  执行 make -C higan/

编译 icario:

  执行make -C icario/

其中icario是一个游戏加载程序,用来加载游戏文件。 higan是模拟器本身可执行程序。

step 5 安装:

  执行

make -C higan/ install

 make -C icario/ install

step6 :设置环境变量:

  默认情况下可执行文件安装在~/.local/bin,需要设置PATH环境变量导向这个位置.

在.bashrc末尾追加一行

export PATH=~/.local/bin:$PATH

step6: 安装bios.rom

  GBA游戏需要bios.rom文件引导. 模拟器本质上是一个虚拟机,bios.rom用来引导虚拟机到正确的工作状态。

 下载bios.rom文件,地址:All BIOSes - Down10.Software

 下载过来后,解压重命名伟bios.rom, 并copy到

  ~/.local/share/higan/systems/Game Boy Advance.sys/  目录

~/.local/share/higan/systems/Game Boy Advance.sys$ ls -l
total 20
-rw-rw-r-- 1 czl czl 16384 11月  9 10:57 bios.rom
-rw-rw-r-- 1 czl czl    68 11月  9 10:56 manifest.bml

step 7:

 执行 higan命令,出现模拟器 GUI 界面

step 8: 加载gba游戏:

step9: 运行

step10: 设置GBA游戏ROM路径

step 11: 设置游戏文件路径,在系统下载目录存在game.gba拳皇游戏文件

setp 12: gaoji shezhi , select the display backedn and other settings.

step 13:重新加载bios,进入游戏:

参考资料:

https://higan.readthedocs.io/en/stable/install/linux/

General - higan

Game Folders - higan

  • 9
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

papaofdoudou

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值