Tuesday, December 27, 2005

The Internet in a nutshell, part 2

Wookieepedia: a wiki site set up by Star Wars fans "when wikipedia users began to complain of the overabundance of minutiae related to Star Wars" on Wikipedia. (via Ned Batchelder)

My original Internet in a nutshell comment predates this blog, so I'll repeat it here: An image from Bert Is Evil, a site self-conciously created to qualify for Internet Underground's "Weird Wide Web" column is included in a pro-bin-Laden poster because the image ranked highly in a Google Images search for [bin laden].

Tuesday, December 06, 2005

Filling code in Emacs

My friend Ryan has writen a neat addition for Emacs: fillcode-mode lets you word-wrap code just like M-q already does for text. It knows how to indent parenthesized expressions, break lines at commas, etc. It's not perfect, but it gets the common cases right and sure beats fixing up the indentation by hand when you change a function signature.

Sunday, December 04, 2005

Fighting with Civilization IV's copy protection

(Note: if you're looking for information about how to get an illegal copy of Civilization 4, you won't find it here)

After downloading the Civilization 4 demo, I went out and purchased the game. Once I got it installed, I found that I immediately got a blue screen of death whenever I tried to start the game. The windows crash reporter was no help this time, but since the demo worked fine I suspected some sort of attempted copy protection. As it turns out I had an old version of the Safedisc copy protection software on my system (c:\windows\system32\drivers\secdrv.sys, dated 2002), that I think may have been broken by Windows XP SP2. Civ4 apparently won't install its version of Safedisc when it sees another version already installed. Macrovision publishes an update to Safedisc, although it's not easy to find on their site. Unfortunately, attempting to install the update directly triggers another BSOD in the old version. The procedure for upgrading looks something like this:
  1. Go to Device Manager and turn on "Show Hidden Devices".
  2. Under "Non-Plug and Play Drivers", find "Secdrv" and double-click it.
  3. On the "Driver" tab, change "Startup Type" to "Disabled".
  4. Reboot.
  5. Run the Safedisc update installer. You'll get an "error 101" because the driver is disabled, but the installation still works as far as I can tell.
  6. Go back to Device Manager, change "Startup Type" back to "Automatic" and reboot.
Now I try the game again. The CD spins up and I see the splash screen this time, which says "Loading" even though it really means "Please wait while we waste your time and verify that you still have this otherwise-unneded CD". A dialog pops up and says "Please insert the correct CD and try again", with a link to the official support website. The website says the CDs are mislabelled - the CDs say "Disc 1/Install" and "Disc 2/Play", but you're actually supposed to use Disc 1 to play. Oops.

I swap discs and try again. Same message. Some searching reveals that Safedisc tries to detect CD emulators like Daemon Tools and Alcohol 120% and refuse to start if it sees them (of course, now that it's caught a pirate red-handed, it doesn't want to give you any hints about how to evade the protection, so it just says "please insert the correct cd"). I've never used either of those programs, and I'm pretty sure I don't have anything like them installed (If I did, I'd probably be using it, since I can see plenty of non-piratical uses for such a piece of software). The solution is a little program called sd4hide, which temporarily removes a few registry keys that Safedisc looks for. The registry keys it removes in my case are entries in the SCSI section of the registry, entries for my hard drive and DVD drive. I have no idea what they're doing there (both drives are IDE) or why SCSI would be taken as evidence of piracy (does no one use SCSI drives anymore?), but it did the trick, and now I'm able to play the game.

It's things like this that make me about ready to give up on PC gaming. The consoles may be closed systems with their own copy-protection schemes, but at least I know that up front, and the games still work.