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 Old Games Through DOSBox

Run glorious old DOS classics on modern operating systems.

Every now and then the urge may strike to play the game that kindled your interest in computer gaming, perhaps X-Com, Master of Orion, or something from the Ultima series. Unfortunately, today’s modern operating systems rarely play well with the relatively ancient games of the early to mid ’90s. If you’re lucky, you can convince some games to run without sound in Windows XP, but they may run far too fast to be playable. That’s where DOSBox comes in.

DOSBox (http://dosbox.sourceforge.net/) is a four-person open source project that emulates an x86-based PC running DOS. The version used for this hack is 0.61 for Windows. Don’t let the version number scare you; it features excellent support for many classic games and can provide Sound Blaster, General MIDI, or Gravis Ultrasound sound support. The DOSBox homepage has a freely downloadable installer as well as the source code and ports to various other platforms.

Getting Started

After you’ve downloaded DOSBox, run the EXE and pick a location to install to. There’s no special setup required to kick off the program at this point. If you run it, you’ll end up at a Z:\> prompt. DOSBox, by emulating a DOS PC, hands you a DOS environment just like the one you remember.

If this is your first time in DOS because you’re boning up on your game history (commendable!) or if you just need a refresher, there are some commands you need to know. mount mounts a drive under a particular letter so that you can access it from within DOSBox. On startup, by default, DOSBox will put you on drive Z:, a virtual directory it creates to start itself up. You’ll need to mount the drive in the computer on which your games reside before you can play them.

If your games are on drive D:, use the mount command as follows:

mount C D:\

This maps a C: drive within DOSBox to the contents of the current D: drive in your PC. It’s important to know how this works, but you can simplify things by editing the dosbox.conf file; I’ll explain that later.

Depending on the media you need to use for installation (floppy disks or CDs), you’ll want to mount those drives as well. DOSBox doesn’t automatically know that A: is your floppy drive, so use a similar command to set it up:

mount A A:\
mount E E:\

This makes A: your floppy drive and E: your CD-ROM. If you now type any of those letters you’ve mounted followed by a colon, at the Z:\> prompt, you’ll switch to the specified drive. You’re only an installation away from playing a game now!

Installing Games

To install, you need to know two more important DOS commands. The first is dir, which lists the contents of your current directory. The second is cd, which changes your directory (for example, to the directory containing the file you want to execute). The command dir /W displays directory contents across the screen instead of down, making it easier to find what you’re looking for. dir works on any drive and in any folder. Use cd with the knowledge you’ve gained from the dir listing. For example, to run X-Com, type:

cd MPS\UFO

This changes directories to X-Com’s default installation location. From there, type UFO, and you’re off battling aliens! DOSBox executes .BAT, .EXE, or .COM files. It works just like standard DOS, so while these simple instructions will help you to play games, there’s a bevy of commands available when you’re ready to tinker more.

Once you’ve mounted everything properly, change to the installation disk and directory and start your game’s installation program. This works just like the original, including sound setup.

Warning

If you want sound, it’s crucial that you now choose either a Sound Blaster or Gravis Ultrasound sound device. Beware that not all games have GUS support. If General MIDI is available, use it because it always provides the best sound quality.

After the installation completes, you’ll probably be in the same directory as the game executable. Type the name of the main executable—for example, UFO.EXE—and the game will attempt to start.

This Thing Runs Too Slow!

Inevitably, after mounting drives and installing a game to your hard drive, you’ll find out that performance isn’t quite as you remember. Now’s the time to tweak DOSBox for optimal performance. Before you start, though, check the web site for any known problems with your game. The DOSBox web site has an extensive and searchable list of games (http://dosbox.sourceforge.net/comp_list.php?letter=a) with a scale ranging from runable to playable to completely supported. This will help you determine if you’re better off playing something else.

Provided that you’re running a supported game, your next step is to increase the cycles DOSBox uses to run the games. As noted in the dosbox.conf file (see Start All Programs DOSBox-0.61), cycles refer to the number of instructions DOSBox tries to emulate each millisecond. A very high number can have adverse effects on the program and your PC, so prepare for trouble if you go crazy. On a midrange PC, most games seem comfortable with values between 5,000 and 10,000.

You will have to spend some time tweaking this number to find the ratio of stability to speed. X-Com locked up at 10,000 but played fine at 8,000, for example. The old Amtex pinball table conversion for Eight Ball Deluxe had a nearly transparent ball at 10,000 but played perfectly at around 7,000. Needless to say, you’ll probably spend most of your tweaking time on this setting.

Editing dosbox.conf

To make your life easier, once you’ve done some manual setup and understand how DOSBox works, you can add some lines to the dosbox.conf file to avoid having to repeat the process each time you want to play. In the [sdl] section, set the fullscreen value equal to true, because DOSBox performs best in fullscreen mode. Hit Alt-Enter to switch between the fullscreen and windowed modes.

The [cpu] section holds the cycles setting. Here you can put the value you determined earlier. Related settings are cycleup and cycledown. When DOSBox runs, the keys Ctrl-F8 and Ctrl-F12 can increase or decrease the value of cycles. Set your default at 8,000 or so to start, and change it after you’ve tried some games.

Finally, you probably want to add your mount statements to the [autoexec] portion of dosbox.conf. This allows the program to configure the drives you use for installation and game playing as soon as you come to the initial Z:\> at DOSBox startup.

There are a lot of other flags in the configuration file, but you can leave most of them alone unless you encounter trouble with a game.

It’s Easier than It Sounds

If you’re new to DOS, you’ll need some time to acclimate to its text-only interface. Don’t worry, we’ve all been there. One nice feature of DOSBox is how well it makes the needed amount of memory available to games. Back in the ’90s, when these games were new, you often had to perform voodoo, sit a particular way in your chair, and then pray to whatever deity you worship to convince a game to run. DOSBox makes this straightforward. A little DOS knowledge goes a long way, though, so don’t hesitate to bone up. See Claymania’s DOS Primer (http://www.claymania.com/dos-primer.html) for an introduction and The DOS (command) Environment (http://www.primerpc.com/dos/dos.htm) for detailed help.

You’ll have to track down the original games or pull out your old discs (or disks) to start playing. DOSBox supports most of the big names of the time with varying degrees of success, including Ultima, X-Com, Master of Orion, Master of Magic, and more. It might seem silly once you’ve installed DOSBox, but be sure to try old games under Windows XP first just in case. Sometimes you won’t need emulation, though it seems like it should be your first choice. The old Simtex classic 1830: Railroads and Robber Barons works just fine in Windows XP without emulation.

Above all, have fun exploring or reliving the golden era of PC gaming. Many of PC gaming’s most beloved games come from the DOS era. Besides buying and refurbishing an old 486 DX2/66, this is the best way to enjoy these games. Now excuse me while I stop an alien invasion for the tenth time!