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

Keep Your ROMs Tidy and Organized

Keep your mass of homebrew emulated games tidy and safe.

One of the joys of collecting ROMs and disc images—even freeware and homebrew ones—is that your collection will soon grow. With that accumulation comes the issue of how to keep them in order. You might even have multiple copies of the same file with different naming conventions from different sources!

With ROM management tools and game databases such as the TOSEC database, you can autorename, checksum, and organize your game image files easily and efficiently.

ROM Management Tools

Your first step is to pick a tool to use. Most of the best ROM managers are available for Windows, but there are decent managers for other systems too. We’ll concentrate on the two leading Windows-based managers, CLRMamePro (http://www.clrmame.com/) and ROMCenter (http://www.romcenter.com/). Both are extremely fully featured.

Tip

CLRMamePro, although originally named after MAME, which deals only with arcade games, actually works for multiple DAT files—even those not for MAME.

Unfortunately, these two utilities have different datafiles, which makes metadata compatibility a little tricky. We’ll discuss that later. For now the place to start is MrV2K’s web-based CLRMame tutorial (http://www.mameworld.net/easyemu/clrmameguide.htm).

The .DAT files used in these management tools are basically standalone text files. You can download and import new versions and even customize your own copies. Their complexity varies greatly, but at the most basic level, they include the correct filename, the correct size, and the correct CRC checksum for each included game. The tools compare ROMs by checking their file sizes and CRCs. These checksums are alphanumeric values that are guaranteed to be unique for each individual ROM. This allows the system to detect duplicates, even if the filenames have changed.

Because running the tool may cause complex chains of renaming and deletion operations, you may want to back up your entire directory before starting up. Although these utilities generally behave well, most ROM files are small enough that it makes sense to keep your old configuration in case you like things better that way.

After you have the correct DAT file to scan against the ROMs you currently have on your hard drive, run the Scanner option from the main menu of CLRMamePro to cross-check everything against your master DAT. There are several scanning criteria, including whether to check if the ROMs are completely missing, whether there are duplicates, and whether certain files are unnecessary.

At the end of checking, a detailed error report tells you exactly which ROMs failed their CRC check, which have partial missing files, and which need renaming and deleting because of duplicates. Some people suggest that you perform a simple name/case/duplicates check before performing a deeper CRC scan; you’re much more likely to have duplicate ROMs than corrupted ones.

If you don’t have a suitable DAT file, you can hook existing emulators into CLRMamePro, though this works only with command-line emulators such as MAME. This clever part of the program uses the command-line Information options for the emulator to derive and retrieve information about existing ROMs on your machine. It can then create its own database file from scratch.

Analyzing DAT File Details

Many experts recommend the CLRMamePro format as the master format. Let’s explore the DAT file for a real game to see how it works. Here’s the metadata for a freely distributable Neo Geo homebrew game, an adaptation of a famous bat-and-ball game you might have heard of:

game (
    name neopong10
    description "NeoPong (v1.0, non-MAME)"
    year 2002
    manufacturer "NeoDev"
    cloneof neopong
    romof neopong
    rom ( name pong0_p1.rom size 131072 crc 31b724d7 )
    rom ( name pong_s1.rom merge pong_s1.rom size 131072 crc cd19264f )
    rom ( name sfix.sfx merge sfix.sfx size 131072 crc 354029fc )
    rom ( name sp-s2.sp1 merge sp-s2.sp1 size 131072 crc 9036d879 )
    rom ( name sp-s.sp1 merge sp-s.sp1 size 131072 crc c7f2fa45 )
    rom ( name usa_2slt.bin merge usa_2slt.bin size 131072 crc e72943de )
    rom ( name sp-e.sp1 merge sp-e.sp1 size 131072 crc 2723a5b5 )
    rom ( name asia-s3.rom merge asia-s3.rom size 131072 crc 91b64be3 )
    rom ( name vs-bios.rom merge vs-bios.rom size 131072 crc f0e8f27d )
    rom ( name sp-j2.rom merge sp-j2.rom size 131072 crc acede59c )
    rom ( name sm1.sm1 merge sm1.sm1 size 131072 crc 97cf998b )
    rom ( name pong0_m1.rom size 131072 crc 9c0291ea )
    rom ( name 000-lo.lo merge 000-lo.lo size 65536 crc e09e253c )
    rom ( name pong0_v1.rom size 524288 crc debeb8fb )
    rom ( name pong0_c1.rom size 1048576 crc d7587282 )
    rom ( name pong0_c2.rom size 1048576 crc fefc9d06 )
)

As you might have noticed, many ROMs are variants of other ROMs. This goes for translations and modifications as well as officially released commercial games, which often reuse individual chips on a cartridge or ROM board. The cloneof field here allows you to track all the myriad ripoffs of a particular title (in the previous case, a slight variant of NeoPong; a better example is that of the mess of Pac-Man variants). This allows easy organization and grouping within ROM managers, among other things.

Most cleverly of all, the merge command within certain of the ROM files allows multiple clones to use the same ROM files if only a few ROMs differ between clones. This can save a lot of space by eliminating useless redundancy.

If you’d like to know a lot more about the various formats, the LogiqX site has an exemplary FAQ section (http://www.logiqx.com/FAQs/DatFAQs.shtml) which goes into much greater detail, especially regarding more complex maneuvers such as adding samples and resource files to your database.

Emulator DAT Conversion with DatUtil

Because it stores versions of its databases for both CLRMamePro and ROMCenter versions, LogiqX (http://www.logiqx.com/) is one of the best places to look for emulator-compatible DAT files. Since the guys at LogiqX don’t merge updates between the databases by hand when things change, they must have some way to convert between the different database formats.

It comes in the form of DatUtil (http://www.logiqx.com/Tools/DatUtil/DatUtil.shtml), a four-year-old project. This DOS command-line utility converts between multiple formats. It even performs clever comparisons of two different DAT files that may have slightly altered content, spewing out the differences to a logfile.

The DatUtil executable also comes with the C source code, should any ninja coders wish to make custom alterations. You may never need to convert DAT files if you stick with something like CLRMamePro all the way, but if a newer, better ROM naming manager ever supersedes it, it’s nice to know that you’ll have a way to convert your legacy databases.

Analyzing the Best Master ROM Databases

There are several different ROM databases to explore. The ROMCenter page (http://www.romcenter.com/) has a good sampling. However, the most famous two are the previously mentioned LogiqX (http://www.logiqx.com/) and the TOSEC team (http://www.tosec.info/).

LogiqX is one of the preferred sources for MAME DATs, especially because of their involvement in CAESAR, the Catalogue of Arcade Emulation Software—the Absolute Reference (http://caesar.logiqx.com/). They have fewer files in the more obscure formats outside the most popular emulation platforms, but the DAT files they do have for the latest versions of MAME, Kawaks, Nebula, and others (http://www.logiqx.com/Dats/Dats.shtml) are impressively up to date.

On the other end of the spectrum, TOSEC’s work in sorting out and compiling massive databases of ROMs is impressive. They’re the only people with details on more obscure formats; they keep a list of all Amiga public-domain software or Intellivision ROMs, for example. The TOSEC team is slowly moving from simple, static DAT files to an ambitious web site where you can create DAT files from a master database on the fly—a laudable, if much more complex work. The TOSEC authors explain:

Eventually [TOSEC 2.0’s Database Generator] will fully replace the “solid” data archives we use now and will give you the possibility to generate and download combined and custom dats, making it possible to make dats only containing the files you want them to contain.

It’s also worth pointing out that the TOSEC team makes an effort to separate public-domain and redistributable software from ROMs that may have more dubious right issues. This is great news if you want to use ROM database software with legitimate ROMs. For example, the ROMCenter TOSEC page (http://www.romcenter.com/datafiles/tosec/list.php) has specific, standalone DAT files for legitimate Atari Jaguar and Atari Lynx PD/demonstration software.

It’s likely that TOSEC 2.0 will continue this, making it possible to create custom DATs of every single public domain or freely distributable ROM for any console or computer on the fly. That would be an amazing accomplishment.