Table of Contents for
Gaming Hacks

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Gaming Hacks by Simon Carless Published by O'Reilly Media, Inc., 2004
  1. Cover
  2. Gaming Hacks
  3. Credits
  4. Contributors
  5. Acknowledgments
  6. Foreword
  7. Preface
  8. How to Use This Book
  9. How This Book Is Organized
  10. Conventions Used in This Book
  11. Using Code Examples
  12. Comments and Questions
  13. Got a Hack?
  14. 1. Playing Classic Games
  15. Legal Emulation
  16. Play Commodore 64 Games Without the C-64
  17. Play Atari ROMs Without the Atari
  18. Use Atari Paddles with Your PC
  19. Run Homebrew Games on the Atari 2600
  20. Create Your Own Atari 2600 Homebrew Games
  21. Play Classic PC Graphic Adventures
  22. Play Old Games Through DOSBox
  23. Play Reissued All-in-One Joystick Games
  24. Play Arcade Games Without the Arcade
  25. Add and Manipulate a MAME Frontend
  26. Keep Your ROMs Tidy and Organized
  27. Learn Game-Specific MAME Controls
  28. Filter Inappropriate MAME ROMs
  29. Autoboot into MAME Heaven
  30. Play Emulated Arcade Games Online
  31. Play Classic Pinball Without the Table
  32. Emulate the SNES on the Dreamcast
  33. 2. Playing Portably
  34. Play Games on Your iPod
  35. Mod Your Game Boy
  36. Take and Print Photos with Your Game Boy
  37. Compose Music on Your Game Boy
  38. Explore the GP32 Handheld Gaming System
  39. Take Your Console with You
  40. Explore the Bandai WonderSwan
  41. Play Real Games on Your PDA
  42. Install a PlayStation 2 in Your Car
  43. 3. Playing Well with Others
  44. Practice Proper MMORPG Etiquette
  45. Understand MMORPG Lingo
  46. Grind Without Going Crazy
  47. Make a Profit in Vana’diel
  48. Write MMORPG Macros
  49. Build an Effective Group
  50. Catch Half-Life FPS Cheaters Redhanded
  51. 4. Playing with Hardware
  52. Build a Quiet, Killer Gaming Rig
  53. Find and Configure the Best FPS Peripherals
  54. Adapt Old Video Game Controllers to the PC
  55. Choose the Right Audio/Video Receiver
  56. Place Your Speakers Properly
  57. Connect Your Console to Your Home Theater
  58. Tune Console Video Output
  59. Tune Your TV for Console Video
  60. PC Audio Hacking
  61. Optimize PC Video Performance
  62. Build a Dedicated Multimedia PC
  63. Use a Multimedia Projector for Gaming
  64. 5. Playing with Console and Arcade Hardware
  65. Play LAN-Only Console Games Online
  66. Hack the Nuon DVD Player/Gaming System
  67. Play Import Games on American Consoles
  68. Find a Hackable Dreamcast
  69. Play Movies and Music on Your Dreamcast
  70. Hack the Dreamcast Visual Memory Unit
  71. Unblur Your Dreamcast Video
  72. Use Your Dreamcast Online
  73. Host Dreamcast Games Online
  74. Burn Dreamcast-Compatible Discs on Your PC
  75. Burn Dreamcast Homebrew Discs
  76. Buy Your Own Arcade Hardware
  77. Configure Your Arcade Controls, Connectors, and Cartridges
  78. Reorient and Align Your Arcade Monitor
  79. Buy Cart-Based JAMMA Boards
  80. Programming Music for the Nintendo Entertainment System
  81. 6. Playing Around the Game Engine
  82. Explore Machinima
  83. Choose a Machinima Engine
  84. Film Your First Machinima Movie
  85. Improve Your Camera Control
  86. Record Game Footage to Video
  87. Speedrun Your Way Through Metroid Prime
  88. Sequence-Break Quake
  89. Run Classic Game ROM Translations
  90. Change Games with ROM Hacks
  91. Apply ROM Hacks and Patches
  92. Create PS2 Cheat Codes
  93. Hack Xbox Game Saves
  94. Cheat on Other Consoles
  95. Modify PC Game Saves and Settings
  96. Buff Your Saved Characters
  97. Create Console Game Levels
  98. 7. Playing Your Own Games
  99. Adventure Game Studio Editing Tips
  100. Create and Play Pinball Tables
  101. Put Your Face in DOOM
  102. Create a Vehicle Model for Unreal Tournament 2004
  103. Add a Vehicle to Unreal Tournament 2004
  104. Modify the Behavior of a UT2004 Model
  105. Download, Compile, and Create an Inform Adventure
  106. Decorate Your IF Rooms
  107. Add Puzzles to Your IF Games
  108. Add Nonplayer Characters to IF Adventures
  109. Make Your IF NPCs Move
  110. Make Your IF NPCs Talk
  111. Create Your Own Animations
  112. Add Interactivity to Your Animations
  113. Write a Game in an Afternoon
  114. 8. Playing Everything Else
  115. Tweak Your Tactics for FPS Glory
  116. Beat Any Shoot-Em-Up
  117. Drive a Physics-Crazed Motorcycle
  118. Play Japanese Games Without Speaking Japanese
  119. Back Up, Modify, and Restore PlayStation Saved Games
  120. Access Your Console’s Memory Card Offline
  121. Overclock Your Console
  122. Index
  123. Colophon

Play Arcade Games Without the Arcade

Unless you’ve been living in a classic-gaming bereft hobbit hole for the past few years, you’ve probably heard of MAME, the Multiple Arcade Machine Emulator. Nicola Salmoria started the project in late 1996 and early 1997. It’s since expanded to an immensely popular 100-person hydra. As the official MAME FAQ (http://www.mame.net/mamefaq.html) explains:

When used in conjunction with an arcade game’s datafiles (ROMs), MAME will more or less faithfully reproduce that game on a PC. MAME can currently emulate over 2,600 unique (and over 4,600 in total) classic arcade video games from the three decades of video games—’70s, ’80s and ’90s, and some from the current millennium. The ROM images that MAME utilizes are “dumped” from arcade games’ original circuit-board ROM chips. MAME becomes the “hardware” for the games, taking the place of their original CPUs and support chips. Therefore, these games are NOT simulations, but the actual, original games that appeared in arcades.

MAME’s advantages over the original hardware are obvious: you don’t have to deal with bulky boards that may or may not work with your extremely bulky arcade machine and won’t fit into your PC or portable PC-like devices. Even recent home conversions (or TV game versions; see [Hack #9] ) of classic titles aren’t necessarily perfect versions of the original, due to controller constraints if adapting to consoles or, in the case of TV games, adapted, not emulated, conversions.

MAME Basics

Let’s start with the obvious steps. The latest versions of MAME for Windows and DOS live at the official MAME download page (http://www.mame.net/downmain.html). MAME runs on a whole host of other platforms, including such interesting options as the Dreamcast, OS/2, Sharp Zaurus, and even the Xbox, so see Mame.net’s list of ports (http://www.mame.net/downports.html). Installation is a snap; uncompress the archive into your preferred directory.

To launch a game, fire up a command prompt and type mame gamename, where gamename is a game you’ve placed in the ROMS subdirectory of your main install directory. You don’t need to unzip the game; MAME extracts the appropriate files automatically.

Warning

Be sure to see the official MAME FAQ section explaining how to use the emulator completely legally ( [Hack #1] ). This is particularly important, because you can play many games without even considering downloading any potentially suspect ROMs.

Alternative Tips for MAME Goodness

It would be pretty tedious to recite the entire MAME FAQ, pointing out various typos that might not apply when this book reaches your hands. Instead, I advise you to peruse the FAQ. Done? Okay—let’s explore some MAME facts that can confuse even the experienced emulator entourage.

Hardware specs sometimes matter

Some MAME-emulated games have drastically different hardware requirements from others. This may seem counter-intuitive to anyone who’s used to playing, say, a Super Nintendo emulator, where most titles will run at the same speed. Remember, MAME emulates hundreds of different types of hardware in one. In particular, 3D-totin’ games need fairly up-to-date system specs to run well.

The official MAME site recommends a 700-MHz PC with 64 to 128 MB of RAM to run about half of the MAME games. For the most sophisticated titles, such as Cruisin’ USA, even the latest top of the line multigigahertz machine isn’t enough. Also beware that some games need large amounts of RAM to run. This particularly affects consoles.

Some games have dependencies

Having one ROM bundle may not be enough to make the game work if the hardware platform requires additional ROMS. The Neo Geo, PlayChoice-10, and, fortunately, few other systems are examples of this. If MAME complains of missing files, you may not have a dud ROM.

Fortunately, only a few games and systems have this problem. Another reason you may have full ROM sets for one particular title but are missing files is if the game is a clone, an often unofficial Asian third-party ripped off from the original title. A Pac-Man clone ROM set probably doesn’t include the ROMs that it shares with the original. You’ll need to find the original ROM set to fix this.

You can sometimes stop the world

Because so many modern games have save features (except for old arcade ports, grr . . . ), you might think that MAME must have an embedded universal save function. Not so: few arcade games even have pause buttons, for obvious quarter-crunching reasons. These games sometimes don’t like stopping partway through only to restart mid-game at some point in the future. It’s tricky to implement save states without altering the original ROM code—tricky, but not impossible.

Try pressing Shift-F7 and any key to save a state, and F7 and the same key to reload that particular state. You can have as many save states as you have keys.

Fixing Framerate Woes

Suppose that you have a wimpy, underpowered 200-MHz PC to use with MAME. It can handle simple games such as Pac-Man but choke on newer games for the Sega System 16 or even CPS2. What can you do to run gorgeous new games on your puny machine?

Increase frameskip

Reduce the amount of calculations the emulator has to perform by increasing the number of frames to skip between screen updates. Use the F8 and F9 keys within MAME itself to increase and decrease frameskip, respectively. This may have evil, bad effects such as less controllable main characters and odd animation results, but the effect on overall game speed can sometimes mean the difference between playable and unplayable.

Disable sound

Turn off sound altogether. The MAME FAQ suggests using -soundcard 0 in the DOS version or -nosound for the Windows version as a command-line parameter. Sound isn’t always essential to gameplay, so avoiding complex waveform manipulations can free up cycles to render more frames. It’s definitely worth trying a vow of silence.

Choose a lower resolution

Run with a lower resolution, selectable before you start up the game on the command line. The only problem with this approach is that many resolutions won’t display the entire game area correctly. Some resolutions may not display properly on your monitor, either. Also, many arcade games from early in gaming history already run only at low resolutions anyway. Still, you can wring extra speed out of things this way. The command-line switch for this is -resolution w x h [x d ], where w is width, h is height, and d is color depth, which is optional. For example, -resolution 640x480x32 is a valid choice.

This basic stuff is all well and good, but how about looking at some more complex, more intriguing things you can do with MAME and its various add-ons?

Arcade Monitor-Like Output

One of MAME’s earliest implemented features was a scanlines effect that emulated the appearance of classic arcade machines with gaps between each vertical scanline on the monitor. Aside from its cool appearance, this also doubles the apparent size of the screen with little effect on performance. You can enable the feature from the command line using the -scanlines option.

You can also use the -effect command along with some intriguing effects that include scan75 (75% scanlines that make it look like an arcade monitor). Many MAME variants go several steps further, especially the AdvanceMAME adaptation (http://advancemame.sourceforge.net/). Its advanced display modes include:

RGB effects

These combine either vertical or horizontal scanline effects with triad effects. The result averages out pixel coloration to produce impressively cool blend-styled effects from normally nonblended output (http://advancemame.sourceforge.net/rgb.html).

Scale2X

Originally invented for AdvanceMAME, many emulators support this feature, including Raine and ScummVM ( [Hack #7] ). As the description explains: “Scale2x is [a] real-time graphics effect able to increase the size of small bitmaps [by] guessing the missing pixels without interpolating pixels and blurring the images.”

In other words, this effect can improve the look of old, pixelated, low-resolution graphics by making intelligent choices on how to use extra available resolution. The Scale2X homepage (http://scale2x.sourceforge.net/) has screenshots from multiple games, including the seminal Metal Slug series.

Blit effects

Enables a feature that averages colors over missing pixels in stretched images, so as not to erase vital parts of the playfield despite drawing with fewer pixels. Combine this with a blurring effect that emulates aging arcade monitors to coax a great picture out of your emulator. See http://advancemame.sourceforge.net/blit.html.

Contributing Back to the MAME Community

Suppose you’re playing one of your favorite obscure games, and you see some behavior that definitely didn’t happen in the original arcade version, such as glitchy sprites, odd AI, or whatever. Why not make the world a little better place while you’re looking for a solution? The MAME Testers site (http://www.mametesters.com/) has a giant, continuously updated list of known problems with specific ROM sets. You can add your own descriptions of what you think is wrong and why.

To report a problem, first consult the MAME Testers current bugs page (http://www.mametesters.com/currentbugs.html) to see what’s amiss. Remember that someone probably coded the driver for a particular game in the first place, so that coder might be working on the problem.

One of my very favorite pages on the MAME Testers site is the “Bugs That Aren’t Bugs” page (http://www.mametesters.com/notbugs.html). In itself, this provides fascinating information on problems with the arcade games releases themselves. Most of the reports are genuine problems, but they were either present in the arcade version of the game or expected features that just didn’t exist in the arcade game.

Highlights include complaints about the Pac-Man Plus:

Sometimes one of the ghosts doesn’t turn blue when you eat an energizer. Sometimes the maze disappears when you eat an energizer.

to which an indignant bugworker responded:

That’s the Plus in Pac-Man Plus!

I also like one report of Atari’s version of Tetris:

There’s no second button to rotate pieces clockwise.

with the response:

Many ports of Tetris (notably the Gameboy version) have two rotate buttons, but the Atari versions do not.

MAGE for MAME burnouts

The Multi Arcade Gambling Emulator (MAGE) (http://magenet.tk/) emulates gambling titles that MAME no longer supports and simulates (not emulates) other popular gambling machines. Either download the Windows executable from this site, or check out the MAME Plus! emulator (http://mame.emu-zone.org/), a project that originally started to add Unicode support to MAME and has since integrated MAGE code.

To see which slot and fruit machines MAGE supports, see the history.dat file currently hosted at Mametesters.com (http://www.mametesters.com/elcondor/files/history.dat) for more information. Only a few games have official support (as vendors worry that clever gamblers will figure out how to game the system through emulation and harass the emulator authors). Fortunately, the number of supported systems and titles will only increase in the future, even though emulating video is trickier.

If you’re looking for images; information on what’s available; or even fan-made, custom slot machines, start with the PoundRun site (http://www.poundrun.org). For more emulation-specific discussion, consult the MAGE board at FruitForums (http://www.fruitforums.com/forums/forumdisplay.php?s=&forumid=73).