mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
[translated] 20140624 Super Pi Brothers.md
This commit is contained in:
parent
955c61413d
commit
fa51ce2ee7
@ -1,71 +0,0 @@
|
||||
zpl1025
|
||||
Super Pi Brothers
|
||||
================================================================================
|
||||
I don't game as much as I used to. Although I've certainly spent countless hours of my life in front of a Nintendo, SNES, or after that, playing a first-person shooter on my computer (Linux only, thank you), these days, my free time tends to go toward one of the many nongaming hobbies I've accumulated. Recently though, I found myself dusting off my Wii console just so I could play an NES and SNES game I re-purchased for it. The thing is, those games require using a somewhat strange controller, and I already have a modified SNES controller that can connect over USB. That was enough to encourage me to search for a better solution. Of course, I simply could connect three or four consoles and stack up games in my living room, but I've grown accustomed to ripping my CDs and DVDs and picking what I want to listen to or watch from a central media center. It would be nice if I didn't have to get up and find a cartridge every time I wanted to switch games. This, of course, means going with emulation, but although in the past I'd had success with a modified classic Xbox, I didn't have that hardware anymore. I figured someone must have gotten this set up on the Raspberry Pi, and sure enough, after a brief search and a few commands, I had a perfect retro-gaming arcade set up on a spare Raspberry Pi.
|
||||
|
||||
One nice thing about the Raspberry Pi project is the large number of people out there with identical hardware. For me, that meant instead of having to go through someone else's instructions, knowing I'd likely have to tweak it to suit my setup, I basically could follow someone else's guide verbatim. In my case, I found the RetroPie project, which wrapped up all of the commands you would need to install everything on a Raspberry Pi into a single large script. At the end, you have the RetroArch project fully installed and configured, which includes all of the major emulators you'd want and a centralized method to configure them, plus an EmulationStation graphical front end the Pi can boot directly into that makes it simple to navigate to the game you want, all from a gamepad.
|
||||
|
||||
### Install RetroPie ###
|
||||
|
||||
Before you install RetroPie, you will want to make sure your Raspbian distribution (the default Linux distribution for a Raspberry Pi, and the one this project assumes you will use) is completely up to date, including any new firmware images. This just means a few common `apt` commands. Although you certainly could connect a keyboard to your Raspberry Pi for this step, I've found it more convenient to `ssh` in to the device so I could copy and paste commands:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get -y upgrade
|
||||
|
||||
Now that the Raspberry Pi is up to date, make sure the git and dialog packages are installed, and then use git to download RetroPie:
|
||||
|
||||
|
||||
$ sudo apt-get -y install git dialog
|
||||
$ cd
|
||||
$ git clone --depth=0
|
||||
↪git://github.com/petrockblog/RetroPie-Setup.git
|
||||
|
||||
This will create a RetroPie-Setup directory containing the main setup script. Now you just need to go inside that directory and execute it:
|
||||
|
||||
$ cd RetroPie-Setup
|
||||
$ chmod +x retropie_setup.sh
|
||||
$ sudo ./retropie_setup.sh
|
||||
|
||||
This script presents you with an in-terminal menu (Figure 1) where you can choose to perform a binary installation or source installation, set up RetroPie, or perform a series of updates for the RetroPie setup script and binaries. Choose either the binary or source installation. The binary installation won't take as much time, but you may risk running older versions of some of the software. The source installation requires you to compile software, so it takes longer, but at the end, you will have the latest possible versions of everything. Personally, I opted for the binary install, knowing I always could re-run the script and go with the source install if I found any problems.
|
||||
|
||||
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/medium-350px-centered/u1002061/11576f1.png)
|
||||
|
||||
#### Figure 1. RetroPie Setup Menu ####
|
||||
|
||||
This part of the process will take quite some time on a vanilla Raspbian image, as there are a lot of different packages to download and install. Once the installation completes, go back to the main RetroPie setup screen and select SETUP from the main menu. In this submenu, you can tweak settings, such as whether to start EmulationStation from boot (recommended) and whether to enable a splash screen. In my case, I enabled both settings as I intended my device to be a standalone emulation machine. Note that if you do allow EmulationStation to start up from boot, you still can always ssh in to the machine and run the original RetroPie configuration script to change the settings.
|
||||
|
||||
### Adding ROMs ###
|
||||
|
||||
You also can add ROMs within the RetroPie setup screen. If you choose the Samba method in the menu, you then can locate a local Samba mountpoint on your network, and you can copy ROMs from that. With the USB stick method, RetroPie will generate a directory structure on a USB stick that you plug in to your Raspberry Pi that represents the different emulators it supports. After this point, you can take that USB stick to another computer and copy ROMs over to the appropriate directory, and the next time you plug it in to the Raspberry Pi, it automatically will sync the files over. Finally (and this is what I did), you just can use scp or rsync to copy over ROMs to the appropriate directory under ~/RetroPie/roms/. So for instance, NES games would be copied to ~/RetroPie/roms/nes/.
|
||||
|
||||
Once you are done with the configuration and exit out of the RetroPie setup script, you will want to reboot back into EmulationStation, but before you do, you should reconfigure the memory split on the Raspberry Pi so that it is set to 192 or 128, so run:
|
||||
|
||||
|
||||
$ sudo raspi-config
|
||||
|
||||
and go to the Advanced Settings to change the memory split setting. Now you can reboot safely.
|
||||
|
||||
### EmulationStation ###
|
||||
|
||||
Once you reboot, you should be greeted with the initial EmulationStation screen, which will prompt you to set up your joystick, gamepad or keyboard buttons so it can work with the EmulationStation menu. Note that this doesn't affect how your controllers work within games, just within the EmulationStation menu. After your controller or controllers are set up, you should be able to press right and left on your controller to switch between the different emulator menus. In my case, all of the buttons on my gamepad were going to be used within games, so I made a point to bind a key on a separate keyboard to the menu function so I could exit out of games when I was done without having to reboot the Raspberry Pi.
|
||||
|
||||
EmulationStation will show you only menus that represent emulators for which it has detected ROMs, so if you haven't copied ROMs for a particular emulator yet, you will want to do that and potentially restart your Raspberry Pi before you can see them. Also, by default, your controller will not be configured for any games, but if you press the right arrow enough times within EmulationStation, you will get to an input configuration screen that allows you to map keys on your controller to keys inside a game. The nice thing about this setup is that after you configure the keys, it will apply appropriately within each emulator.
|
||||
|
||||
That's it. From this point, you can browse through your collection of games and press whatever button you bound to Accept to start playing. At first I was concerned the Raspberry Pi wouldn't have the horsepower to play my games, but so far, it has been able to play any games I tried without a problem.
|
||||
|
||||
### Resources ###
|
||||
|
||||
The RetroPie Project: [http://blog.petrockblock.com/retropie][1]
|
||||
|
||||
RetroPie Installation Docs: [https://github.com/petrockblog/RetroPie-Setup][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/super-pi-brothers
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://blog.petrockblock.com/retropie
|
||||
[2]:https://github.com/petrockblog/RetroPie-Setup
|
70
translated/tech/20140624 Super Pi Brothers.md
Normal file
70
translated/tech/20140624 Super Pi Brothers.md
Normal file
@ -0,0 +1,70 @@
|
||||
超级树莓派兄弟
|
||||
================================================================================
|
||||
我已经不象以前那样玩那么多游戏了。虽然之前我当然花费了生命里的无数时间在任天堂,SNES,或是之后在我电脑上的第一人称射击游戏(只在Linux下,谢谢),如今,我更愿意把空余时间花在我累积起来的许多其他非游戏爱好上。但是最近,我发现自己又抹掉了Wii手柄上的灰尘,这样就可以玩一玩我重新购买的NES和SNES游戏了。不过问题是,这些游戏需要用到一些特别的控制器,而且我已经有一个修改过的SNES控制器可以通过USB连接。这已经有足够的理由让我去寻找一个更合适的方案。当然,我也可以简单地接上三个甚至四个手柄,然后在客厅里面堆满游戏。但是我已经习惯于把我的CD和DVD都提取成文件,然后在中心媒体服务器上挑选着听或是看。所以如果每次我想换游戏的时候,不用起身去翻游戏卡带,那就完美了。当然,这意味着得使用模拟器。尽管之前我在一个改动过的Xbox上成功过,不过可惜它已经不在我手上了。然后我觉得一定有什么人已经在树莓派上实现过这种平台,结果是肯定的,在简单地搜索和一些命令之后,我在一个剩下的树莓派上搭起来一个完美的怀旧游戏中心。
|
||||
|
||||
树莓派项目的一个优点是,有大量的用户在使用相同的硬件。对我来说,这意味着我不用完整地参考别人的指引再根据自己的需求做出必要的改动,而只需要简单地完全按照别人的指导做就行了。在我这件事情上,我找到了RetroPie项目,它把你安装时需要用到的所有命令都包到了一个单一的大脚本中。在执行完后,你就完整地安装并配置好了RetroArch,它集成了所有的主流模拟器以及一个统一的配置方式,再加上一个在树莓派上开机启动的EmulationStation图形界面,通过它可以只用手柄就能方便地定位到你想玩的游戏。
|
||||
|
||||
### 安装RetroPie ###
|
||||
|
||||
在安装RetroPie之前,你可能需要确认一下你的Raspbian版本(树莓派默认的Linux发行版,这也是这个项目假设你在用的)是不是最新的,包括有没有新的固件。这只需要几个通用的`apt`命令。虽然,在这一步里你当然可以接个键盘到树莓派上,不过我觉得用`ssh`登录到树莓派上更方便。之后直接复制和粘贴下面的命令:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get -y upgrade
|
||||
|
||||
现在树莓派已经更新到最新了,再确认一下是否安装了git和dialog,然后可以通过git来下载RetroPie:
|
||||
|
||||
|
||||
$ sudo apt-get -y install git dialog
|
||||
$ cd
|
||||
$ git clone --depth=0
|
||||
↪git://github.com/petrockblog/RetroPie-Setup.git
|
||||
|
||||
执行完上边的命令后会创建一个RetroPie-Setup目录,里面有主要的安装脚本。之后你只需要进去这个目录,并运行安装脚本:
|
||||
|
||||
$ cd RetroPie-Setup
|
||||
$ chmod +x retropie_setup.sh
|
||||
$ sudo ./retropie_setup.sh
|
||||
|
||||
这个脚本会在终端里显示一个菜单(图1),在里面你可以选择二进制安装或是源码安装,配置RetroPie,或是更新RetroPie安装脚本和执行文件。之后选择二进制安装或是源码安装,任选一个。二进制安装会快一些,不过有些软件版本可能不是最新的。源码安装需要编译软件,所以用的时间会比较长,但是完成之后,所有的一切都是最新版的。我个人会选择二进制安装,因为我知道在碰到任何问题之后,随时都可以重新执行这个脚本再选择源码安装。
|
||||
|
||||
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/medium-350px-centered/u1002061/11576f1.png)
|
||||
|
||||
#### 图1. RetroPie安装菜单 ####
|
||||
|
||||
在vanilla Raspbian固件版本中,这一步会需要很长时间,因为有大量不同的包需要下载和安装。在安装完成之后,返回在RetroPie安装主界面中,在主菜单里选择SETUP,在之后的二级菜单里,你可以调整设置,例如是否开机启动EmulationStation(推荐打开)以及是否允许欢迎界面。在我这里,我两个都允许了,因为我希望这个设备是一个独立的模拟游戏机。不过你需要了解的是,如果你确实允许了EmulationStation开机自动启动,你仍然可以ssh登录到机器上然后执行原始的RetroPie安装配置脚本来改变这个设置。
|
||||
|
||||
### 添加ROM ###
|
||||
|
||||
你也可以在RetroPie设置界面添加ROM。如果你在菜单里选择了Samba方式,就可以在网络上找一个Samba共享目录,然后从里面拷贝ROM。如果通过U盘的方式,RetroPie会在插到树莓派的U盘上创建一个目录结构,分别对应不同的模拟器。在这之后,你就可以把U盘插到其他电脑上,然后把ROM拷贝到合适的目录里,当再插回树莓派的时候,它会自动同步文件。最后(我就是这么做的),你还可以使用scp或者rsync来拷贝ROM到~/RetroPie/roms/的合适目录下。举个例子,NES游戏需要拷贝到~/RetroPie/roms/nes/目录里。
|
||||
|
||||
当你完成了配置并退出了RetroPie的设置脚本后,应该会想重启并进入EmulationStation,但是在那之前,你应该重新配置树莓派的内存空间,设为192或者128,运行命令:
|
||||
|
||||
|
||||
$ sudo raspi-config
|
||||
|
||||
然后选择高级设置,调整内存空间设定。之后就可以安全地重启了。
|
||||
|
||||
### EmulationStation ###
|
||||
|
||||
重启完之后,当看到EmulationStation界面时应该会很高兴,之后它会提示你设定控制杆,游戏手柄,或键盘按键,这样就可以控制EmulationStation菜单了。不过注意一下,这并不会影响手柄在游戏里的按键定义,只是用于控制EmulationStation菜单的。在设定完手柄后,你应该可以按下向右或向左方向键来切换不同的模拟器菜单了。在我这里,我将会在游戏里用到手柄上的所有按钮,所以我特别将另一个键盘上的键映射到菜单功能,这样在我玩完一个游戏后,不用重启树莓派就可以退出来。
|
||||
|
||||
EmulationStation只会显示已经侦测到ROM的模拟器,所以,如果你还没有拷贝ROM的话,得先做这件事情,然后可能还得重启一下才会有效果。而且,默认情况下,你的手柄没有为任何游戏做配置,但是,如果你在EmulationStation里一直按向右键足够多次以后,会弹出输入设定界面,你可以在里面映射手柄按键。有一个亮点是,当你设定好按键后,它会相应地应用到其他模拟器中。
|
||||
|
||||
就是这些了。在这之后,你可以浏览你收藏的各种游戏,然后按下绑定到确定的那个按键开始游戏。一开始我还担心树莓派可能不够强劲来玩我的游戏,但是直到现在,我试过地所有游戏都可以完美地运行。
|
||||
|
||||
### 资源 ###
|
||||
|
||||
RetroPie项目主页:[http://blog.petrockblock.com/retropie][1]
|
||||
|
||||
RetroPie安装文档:[https://github.com/petrockblog/RetroPie-Setup][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/super-pi-brothers
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://blog.petrockblock.com/retropie
|
||||
[2]:https://github.com/petrockblog/RetroPie-Setup
|
Loading…
Reference in New Issue
Block a user