Building the Original Commodore 64 KERNAL Source

I just found this post over @pagetable.com, the source code to a bunch of old Commodore 8 bit products have been located and recovered, and place online over on github.  Even better there is detailed instructions on cross assembling from a suitable PET machine for building your own KERNAL ROM.

Other sources include:

  • BASIC_C64 reindented BASIC_C64, KERNAL_C64 and DOS_1540 to approximate the LST
  • BASIC_CBM2_A reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • BASIC_CBM2_B reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • BASIC_PET2001 added BASIC_PET2001
  • DOS_1540 reindented BASIC_C64, KERNAL_C64 and DOS_1540 to approximate the LST
  • DOS_1571 added DOS_1571
  • DOS_1581 added DOS_1581
  • DOS_4040 reindented DOS_4040 to approximate the LST output of the assembler
  • DOS_8070 reindented DOS_8070 to approximate the LST output of the assembler
  • DOS_8250 reindented DOS_8250 to approximate the LST output of the assembler
  • DOS_D9065 reindented DOS_D9065 to approximate the LST output of the assembler
  • EDITOR_CBM2 reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • KERNAL_C64_01 added KERNAL_C64_03 and renamed the existing KERNAL_C64 to KERNAL_C64_01
  • KERNAL_C64_03 fix disclaimer of C64 KERNAL -03 to reflect the LST printout
  • KERNAL_CBM2_A reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro
  • KERNAL_CBM2_B reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to appro

Super late, but pretty cool too!

Of interest is the PET2001 Basic sources.  While there have been reversed efforts dating back for years, this is the actual source code.  Namely the header.


TITLE BASIC M6502 8K VER 1.1 BY MICRO-SOFT
SEARCH M6502
SALL
RADIX 10 ;THROUGHOUT ALL BUT MATH-PAK.

$Z:: ;STARTING POINT FOR M6502 SIMULATOR
ORG 0 ;START OFF AT LOCATION ZERO.
SUBTTL SWITCHES,MACROS.

REALIO=4 ;5=STM
;4=APPLE.
;3=COMMODORE.
;2=OSI
;1=MOS TECH,KIM
;0=PDP-10 SIMULATING 6502

Which is pretty damned interesting. The infamous “WAIT6502,1” feature is also included!

SimCity under Windows 3.0

In this case, I’m looking at the ultra-popular Sim series, and their Windows releases.  While I was a big fan of SimCity, especially having played it on an Amiga, when I found out that there was a Commodore 64 version, I had bought it immediately as I wanted to play it at home.  And let me tell you, it was a severely underwhelming experience.

SimCIty C64

From the logo it’s all down hill.  I know that SimCity is actually from 1985, and as the first version, the Commodore 64 version is basically the prototype.

SimCity C64

Which was just graphically underwhelming, but I still played the hell out of it.  And then I saw the Spectrum 48k version.  Yes, the blocks are ‘buildings’ as the units fill up, they will turn into black with only the letter remaining.  Despite the ultra-minimal graphics, the game play is there.  And once you get used to the bizarre combination keyboard+joystick controls it is addictive.  I mean it is SimCity!

SimCity Spectrum 48k

But going to the PC, I kind of grew out of SimCity.  DooM was the hot game, and the whole immersive 3d thing.  And of course during that era being on the PC I only knew of the MS-DOS version.  While there was a version for OS/2 Warp released much much later, and by then if I felt the urge there was SimCity 2000 for Windows.

But after getting the kick for SimEarth, and finding the Windows 3.0 version, I was much surprised to find out that there was a version of SimCity of Windows 3.0 as well!

And I can see why I never had seen this for retail, or knew anyone who had it.

Maxis Order Form

That’s right in the included form, the price was $59.95.  And SimEarth was $69.95!  To put that in perspective that would be now $107.17, and $125.04 respectively.  And people think $60 for a game today is expensive!

To get the full experience I went ahead and loaded up PCem, with a 386 and EGA graphics to get that original feel.

Since this requires Windows 3.0, with either EGA or VGA graphics, and 2MB of RAM, I figured I would go with a ‘top of the line’ souped up 386DX.  I tried to load it up with the Wyse700 driver, and the game fails to load resources.  I don’t know if its even possible to make black and white or four colour resources, as I live in the future, and I have millions of colours!

That said, I tested and it has no issues with 8bit depths either.

Installation is pretty smooth, the game is shipped on either two 360k 5 1/4″ diskettes, or a single 720kb diskette. While modern games have so much more, there is many things this game is lacking.  But Maxine isn’t one of them.

Maxine the cow

No really, she is listed as a feature.

The music is through the PC speaker.  Just like the sound effects.  Multimedia integration with Windows that we take for granted today just wasn’t a thing back then.  The version I have is 1.0, Although a pirated version 1.1 that was sent in actually includes WAV sound effects, and a single midi track. However it doesn’t run on Windows 3.0.  So lucky me!

Unrecoverable Application Error

Ah the UAE, the bane of Windows 3.0.  They were so unpopular that Microsoft had to rename the dialog.

SimCity on EGA

Living in the constraints of EGA feel absolutely claustrophobic in today’s world.  640×350 just isn’t enough screen rel estate.  Even 640×480 is far far too small.  And that lead to one issue I found

SimCity SVGA

While using a SVGA driver so I can get that impossible to afford experience of 1280×1024 in 256 colours, but the application was never meant to run in something that wide.  You can easily put child windows ‘behind’ the dead space, and you can never recover them.  You have to save and re-launch. bummer.

Which leads me to perhaps the most famous reputation of SimCity for Windows.  As mentioned on Joe’s site, there was a massive struggle to get games like SimCity running on Windows 95. As Raymond Chen says:

If any application failed to run on Windows 95, I took it as a personal failure. I spent many sleepless nights fixing bugs in third-party programs just so they could keep running on Windows 95. (Games were the worst. Often the game vendor didn’t even care that their program didn’t run on Windows 95!)

Yes, they basically knew it had problems.  In the box they even had this cute flyer:

I sure hope Raymond got something for his efforts!

And yes, rest assured it actually does work.  It even works on Windows 3.00a under Citrix MULTIUSER 2.0 Pointless as there is no way to have remote graphical displays but nice to see it work.

So what went wrong?  Where was all the follow up games for Windows?  Obviously, the hardware needed was incredibly expensive.  A 386 or even a 286 with a few megabytes of RAM was expensive.  VGA or EGA monitors were also very expensive.  Even mice were expensive!  Putting together a low end PC basically barred you from this high end premier experience.  I can’t imagine that Maxis sold many copies of this.  As mentioned above I’m pretty sure there is a reason why I never saw this in the wild.

Awesome Windows 386/486 machine prices February 1992

Spending $3000 in early 1992, which is $5197.95 in today’s money. I can’t even begin to imagine spending over $5,000 to play a game.  It’s no wonder when older machines show up on eBay people want far too much for them.

In a strange way I like to watch SimCity animate in the background.  It’s like a fish tank or staring out into a busy street.  With the advantage that I can summon a giant lizard to destroy it at my whim.