Skip to content

Instantly share code, notes, and snippets.

@jbarrett
Created March 18, 2013 20:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbarrett/5190597 to your computer and use it in GitHub Desktop.
Save jbarrett/5190597 to your computer and use it in GitHub Desktop.
First pass at a script to change the mayor and organisation name in SimCity 2000 for DOS
#!/usr/bin/env perl
# Change the mayor's name in SimCity 2000
#
# You should probably stick with plain ASCII if you use it.
use strict;
use warnings;
use bytes;
open my $fh, '+<', 'SC2000.DAT'
or die("Unable to open SC2000.DAT, please run from SC2000 install dir");
binmode $fh;
print "Enter Mayor Name : ";
my $mname = <STDIN>;
chomp ($mname);
print "Enter Organisation Name : ";
my $oname = <STDIN>;
chomp ($oname);
sysseek $fh, 0x1E563D, 0;
syswrite $fh, pack('a32', $mname), 32;
# Org name overflows on title screen if we fill all 32 chars.
syswrite $fh, pack('a31', $oname), 31;
syswrite $fh, pack('a1', ''), 1;
close $fh;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment