NES.app NES Emulator for iPhone Version 1.00_RC2 SVN: http://svn.natetrue.com/nesapp Core: InfoNES Project (based on pNesX) Code: nervegas Cool: nightwatch (CoreSurfaces), bwhitman (CoreAudio), dshadow (General) ABOUT NES.app is a Nintendo Entertainment System emulator for Apple's iPhone. NES.app uses a modified InfoNES emulation core to mimic the 6502 processor in a Nintendo Entertainment System, allowing you to play ROM dumps of games designed for the NES console. ROM dumps are files containing the dumped instruction code from a physical cartridge. In many cases, you are legally entitled to posess a ROM dump of any game that you presently own. ROM images for NES are widely available online, or with the appropriate hardware, you can dump them yourself directly from the cartridge. NES.app began life as a fork of iPhoneNES v0.01, but has been completely rewritten and re-engineered to run very fast, and with many additional features such as those below. Please do not confuse NES.app with iPhoneNES. FEATURES MULTITOUCH NES.app uses the iPhone's multitouch sensor to deliver a controller environment very similar to the original NES controllers. This allows you to "Run with B", and so forth. The multitouch programming also allows you to drag your finger to a different direction or button. FRAME SKIP Using the frame skip option, games that otherwise might run slightly slow on your iPhone can be made playable. Most games run fine at FrameSkip 1, however certain games such as Mike Tyson's Punchout and Super Mario 3 run best at FrameSkip 2. FULL SCREEN MODE Using the enlarged screen option, you can zoom in on your favorite game as close to "full screen" as the NES aspect ratio will allow. NOTE: Using the enlarged screen mode slows down the display a bit, so it is recommended that you bump your FrameSkip by one more if using it. SAVE STATE NES.app can save the state of your game when you leave the game. You can choose to start a fresh game from the "All Games" menu, or tap "Saved Games" and load your previously saved game. The game state is stored separate from SRAM, so if you are playing games like Zelda, where your game is automatically saved within the game, you will not need to save state unless you want to save an exact snapshot. The SRAM from the game is automatically saved regardless of whether you save state. GAME GENIE Up to three game genie codes can be specified per game via the preferences menu. Load a ROM, then back out into preferences to edit the genie codes. NOTES: Game genie slows down the game somewhat, as the CPU is constantly having to match read addresses with genie codes. It is recommended you bump your frameskip by one when using the genie, and leave the genie switch "off" when not using it. It's also a good idea to turn off full-screem mode if you're using game genie. For complex codes to start on a particular level, you can enable the code, then save your game after beginning, disable the code, and run at full speed again. COMPILING FROM SOURCE 0. You will need to install the latest arm-apple-darwin toolchain. Revision 139 or above should work. See: http://iphone.fiveforty.net/wiki/index.php/Toolchain_Project Set your HEAVENLY environment variable to point to your iPhone environment. For example:: export HEAVENLY=/usr/local/share/SUHeavenlyJuly1C2S.UserBundle 1. Compile using 'make'. This will create a new NES.app package in ./build. Upload entire NES.app directory into /Applications on the iPhone and reboot the iPhone. It should automatically detect the application and add it to the springboard. 2. Place your ROM files in /var/root/Media/ROMs/NES You will need to use a tool such as iPhoneInterface, iFuntastic, or SSH KNOWN ISSUES SOUND ----- NES.app supports sound, but an iPhone process called mediaserverd locks the audio channel by default. The first time you run NES.app, you'll be prompted to place the iPhone's audio into "on-demand" mode. This is a system change to the iPhone which will allow NES.app to take control of the audio channel when playing a game. NES.app will release the audio back to the system should you receive a phone call, or exit NES.app. It is recommended you allow NES.app to make this change. If you choose 'Yes', the file /System/Library/LaunchDaemons/coreaudiod.plist will be backed up into /var/root/coreaudiod.plist.bak. This is the only file changed in the process. NOTE: Since NES.app is friendly towards other applications needing sound, you might want to place the iPhone in "vibrate" mode to avoid letting Mail and SMS alerts take back control of the sound. This will NOT affect your ability to take phone calls. Turn vibrate on before launching NES.app and off after exiting. If you don't want to allow NES.app to set "on-demand" audio on your iPhone, you will need to manually enable/disable mediaserverd in order to have sound. Aliases can be added to your .profile to do this using MobileTerminal: alias nosound="launchctl unload /System/Library/LaunchDaemons/coreaudiod.plist" alias sound="launchctl load /System/Library/LaunchDaemons/coreaudiod.plist" IMPORTANT: Disabling/Enabling mediaserverd must be done through a GUI application such as MobileTerminal, and will not work using SSH. MORE ON SOUND ------------- ANOTHER CAVEAT when dealing with sound is that you must disconnect your ear buds when first starting a game with NES.app (or killing mediaserverd). If you start a game with the earbuds in, the speaker will fail to initialize. If your default audio output is set to 'Headset' in NES.app preferences, you don't need to worry about this as much, unless you plan to switch to the speaker. EVEN MORE ON SOUND ------------------ If at first you don't get sound, try a forced-power-down of the phone. Hold Home + Power until the system shuts itself off... keep holding even after the "slide to power down" shows up, and it will completely shut down on its own. Let up, wait ten seconds, then push and hold he power button until the unit powers on. This will reset the sound hardware (among other things). DEBUG Debugging writes debugging output to /tmp/NES.debug. Debug also causes the hotspots on the screen to be drawn in vivid colors, for debugging the controls. LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.