Sunday, September 18, 2016

Two Late Classic Apple II to PC Ports, Unalike in Dignity

Even though the Apple II was very long in its lifespan by the end of the 1980s, there was a fair bit of software still being released for it.  The Apple II was very strong in the educational market, computer labs across the United States had yet to upgrade to the PC platform.  The Apple II had many, many classic games.  Most of them were ported to the PC at some point, but by the end of the 1980s the number of A2-to-PC ports (that did not have the name Carmen Sandiego in the title) was dwindling.

Even so, two classics of the Apple II did make their way to the PC platform in the late 1980s and they are the subject of this blog entry.  The first is MECC's 1985 update of The Oregon Trail.  The second is Jordan Mechner's Prince of Persia, programmed on and released for the Apple IIe, IIc and IIgs in 1989.  MECC ported the Apple II version of The Oregon Trail to the IBM PC in 1988.  Mechner and Broderbund ported the Apple II version of Prince of Persia to the PC compatibles in 1990.

The Oregon Trail is the simpler game, in fact it was an update of an earlier version MECC made for the Apple II in 1980.  That version was mostly text-based and occasionally displayed simple wire-frame graphics and a little music.  Before personal computing, Oregon Trail was played on mainframes on a time-share basis.  But the 1985 Apple II version is undoubtedly the most popular version of the game.  The 1985 version requires 64KB of RAM on an Apple II.  This version was ported to the PC by MECC in 1988.  The PC port requires 512KB of RAM and at least a CGA card.

Prince of Persia is a spiritual successor to Mechner's Karateka, another big hit.  Both were published by Broderbund.  Prince of Persia takes the rotoscoped graphics and one on one combat of Karateka and combines them with running and jumping mechanics, obstacles, traps and triggers.  It requires 128KB of RAM and an Apple IIe capable of displaying double high resolution graphics, a IIc or a IIgs.  It only uses double high res graphics on the title screen and story text screens (four screens).  Mechner supervised the ports of the game to the IBM PC compatibles and the Amiga in 1990.  It supports CGA, Hercules, Tandy, EGA and VGA and a variety of sound cards and 512KB-640KB depending on the graphics mode.

When it came to porting these games to the PC, MECC did an outstanding job.  Broderbund and Mechner, not so much.




Audio

The Apple II speaker is driven directly by the CPU, which is responsible for timing the square wave. To generate a square wave at 1000Hz for one second requires the CPU to send 2000 bytes (1000 on bytes and 1000 off bytes) to a particular memory location.  While the CPU is doing this, it must be running a timing loop to ensure that those bytes are sent at the correct time, otherwise the pitch of the note will change.  By contrast, the PC's CPU need only send a couple of bytes to the 8253 timer chip to tell it to generate a 1000Hz square wave.  The timer will generate a square wave at the frequency the CPU tells it to until it is told to do something else.  There is one other timer in the 8253 that can be used by the programmer for other general purpose tasks.  This is why the Apple II Speaker music is played usually over static screens and the PC Speaker music can be played during animated gameplay.

The Oregon Trail has simple one-note music which does not really tax the Apple II speaker.  The PC Speaker hardware is more than capable of doing it justice.

When it comes to Prince of Persia, the music is more complex and therefore more taxing on the Apple II speaker.  It uses something akin to Pulse Width Modulation.  However, the PC Speaker music remains a simple square wave.  It sounds very simplistic, especially when compared to the Apple II.  If you wanted anything what would do justice to the original music, you needed a Tandy, Game Blaster, Adlib, PS/1, Covox Sound Master or (in v1.3) an MT-32.  Both the PC Speaker and Apple have relatively unsophisticated sound effects, but the PC speaker has more distinct sound effects than the Apple speaker.

Video

All Apple II games rely on NTSC color, and almost all of them take advantage of composite artifact colors in the high resolution graphics mode (280x192).  Relatively few games take advantage of the double high resolution graphics mode (560x192) which gives 15 unique colors as opposed to the 6 unique colors in high resolution graphics mode.

CGA generates NTSC color and RGB color, and some games take advantage of composite artifact colors.  Composite artifact colors can be seen in the 320x200 and the 640x200 mode, but the color palette is much more varied in the higher resolution.  As PC software grew more popular and later graphic standards like EGA and VGA began to displace CGA, fewer programs really optimized their CGA colors.  Most developers just implemented the "default" cyan/magenta/white palette and used a dithering algorithm to downsample 16 or 256 color graphics.

The original PC versions of The Oregon Trail, up to and including 2.1, do a very good job of optimizing the graphics for composite color.  To do this, they must use the cyan/magenta/white palette, but they do so in a way as to bring out the composite colors.  In fact, if you have a Tandy or EGA card or a CGA card attached to an RGB monitor, you will only see the comparatively unimpressive 4-color graphics.  Versions 2.0 and 2.1 have support for 256-color VGA graphics, but they are pretty crude reworkings of the original graphics.

>

The PC port of Prince of Persia was rather lazy when it comes to CGA.  The port uses the default cyan/magenta/white palette throughout, even on the title and text screens.  The Apple II used double high resolution for the title and text screens.  The PC port was not optimized for composite color at all.  Compare the two :




Of the six RGB palette choices, many look better than the default palette :




Even the EGA/Tandy 16-color graphics leave a little something to be desired.  The canonical Apple II Prince wears a turban, which is maintained in the CGA graphics.  In the EGA graphics he has red hair and in the VGA graphics he is a blonde.  CGA and EGA show the Prince with shoes, as does the Apple II but VGA appears to make him go barefoot.  CGA gives the Prince magenta skin and EGA gives the Prince brown skin but the Apple II and VGA give standard orange/yellow flesh tones.  The standard 16-color RGB palette usually has the light red color as the best flesh tone, so with a little Paint magic, I offer some subtle proposed improvements (original on left) :



















Performance

The Oregon Trail, which consists mostly of static pictures and text screens, runs very well on the Apple II or the IBM PC.

Prince of Persia runs reasonably well on an Apple IIe.  There is some slowdown when there is an enemy on the screen, a tile falls or a trap triggers, but the Prince moves speedily otherwise.  It does not appear to adjust itself for Apple II accelerators, everything is sped up and the game is probably unplayable at the accelerated speed (1.02MHz vs. 3.58MHz).

Prince of Persia on an IBM PC or XT is a very different story.  I picked the PC and XT to give a computer reasonably equivalent to an Apple IIe in terms of speed (4.77MHz 8088 vs 1.02MHz 6502).  Unfortunately, the game really is not playable at this speed.  The Apple II's worst speed is the PC's best speed.  Even the box recommends an 8MHz or faster processor, and the game is quite playable on a 286 at 8MHz.


1 comment:

bleuge* said...

There is also a bunch more of conversions to PC, or am i missing something?
Ancient Art of War for example.?
I love those old "linear" cga graphics in PC