Deaccelerating The Apple IIc Plus

The Apple IIc Plus is arguably – very arguably from my experience – the best Apple II computer ever made. It’s portable, faster than the IIe, had a much higher capacity built-in drive, and since the Plus could run at 4MHz, it was faster than the strange eight or sixteen bit Apple IIGS. Recently, [Quinn] has been fascinated with the IIc Plus, and has gone so far as to build a custom gamepad and turn the IIc Plus into a laptop. Now, she’s turned her attention to the few things Apple got wrong with the Apple IIc Plus – the startup beep and defaulting to 4MHz on every boot instead of Apple II’s standard 1MHz that’s used in the Apple II, II Plus, IIe, and IIc non-Plus.

The original Apple II is surprisingly primitive. Apart from writing a loop of NOPs and counting cycles, there’s no way to keep time. There is no clock, no timer, no tick counters, and no interrupts. If you’re writing a game for the Apple II that depends on precise timing, the best you’ll be able to manage is a delay loop. This worked for a time, until the Apple IIc Plus was released with a default clock of 4MHz. It was a great idea for AppleWorks and other productivity apps, but [Quinn] is doing retrocomputing, and that means games. Booting the Apple IIc Plus into its 1MHz mode means turning it on and holding escape while resetting the computer every time. It’s very annoying, but a mod to make the IIc Plus run at 1MHz by default would turn her into one of the most accomplished currently active Apple II developers.

The process of booting into the IIc Plus’ 1MHz mode requires holding down escape while restarting the computer. This should tell you something: it’s not a hardware switch that changes speed. It’s in the ROM, and that means diving into the Technical Reference Manual, looking at the listings in the ROM monitor, and figuring out how everything works.

The IIc Plus ROM is incredibly complex – it’s 32k of hand assembled code with jump tables bouncing everywhere. After a ton of research, [Quinn] successfully reverse engineered the ‘slow down if the ESC key is pressed’ routine, allowing her to boot the machine at 1MHz by default, and 4MHz if there’s a soft reset with the option key pressed. Everything works great, and [Quinn] has the video to prove it

This isn’t [Quinn]’s first attempt at hacking the lowest levels of the Apple IIc Plus ROM. Because the IIc Plus ran at 4MHz by default, the startup beep was so very wrong. She fixed that, and with two very useful patches under her belt, she burned a few new chips with her ROM patches. In total, there’s only a few dozen bytes of hers in the new 32k ROM, but that’s enough to make her one of the top current firmware developers for the Apple II platform.

39 thoughts on “Deaccelerating The Apple IIc Plus

  1. >The original Apple II is surprisingly primitive. Apart from writing a loop of NOPs and counting cycles…
    Yet fanboys will pay thousands just because it’s “Designed by Apple, Made in China”.

    1. I don’t think Apple products were fashion products until the early 2000’s when the ipod came out. Apple almost died in the late 90s until Microsoft bailed them out with a $150 million investment in 1997. Even Mac OS X had a lot of techie cred when it first came out, with its BSD pedigree. Though they’ve been slowly locking that down ever since and these days it’s little more than the AOL of computer systems. I credit the walled garden of the iphone with that progression.

    1. Microsoft held the patent for the BASIC interpreter that Apple and just about everyone else was using at that time. They were never “together”, though the rivalry had yet to heat up as Bill, Woz, and Steve were still playing around in the same computer club at that time, if I’m not mistaken. I might be a year or two off.

      1. It was’t a patent, Apple licensed the code that was the basis for Applesoft from Microsoft. If you want a good story, track down the comments made by the Apple developers who were working with this code.

      2. No, they weren’t at the same computer club.

        The to Steves were in California, and Steve Wozniak went to the Homebrew Computer Club. I have doubts Steve Jobs attended, he was less interested in technical things, and maybe was in India at the time.

        But Bill Gates was in Boston, attending Harvard. When the Altar 8800 hit, he went down to New Mexico to sell his BASIC to MITS. I think MITS thought he was working for them, but Bill saw it otherwise. Then Microsoft moved to Seattle, Swiftwater Bill’s home town.

        So he was never in the Bay area.

        It was the Homebrew Computer Club that seemed to be the place where Microsoft BASIC was copied. Bill Gates issued “An Open Letter to Hobbyists” and sent it to various clubs, complaining that MS BASIC was not to be freely distributed.

        Microsoft had no patent on BASIC, it was an existing language out of Dartmouth College. But it was desirable since it was a language that many were familiar with, through timeshare, and there were all those computers that needed some practical use. So Bill stepped in, and generally was the source of BASIC for many early home computers.

        The Apple II came with Integer BASIC, which was by Steve Wozniak, but when they wanted a better BASIC, thy went to Microsoft, just like other companies did. They’d get a BASIC which was customized to their specific hardware.


  2. I’m pretty sure it has been extensively debated, but I always wonder why companies like Apple wouldn’t release their documentation on those very old hardware and ROM.
    It’s not like they hold any industrial secret anymore, as they are 40 year old and very primitive.
    It would’nt hurt anyone and make a lot of happy campers.

      1. Across technical domains, it has been my experience that a surprising number of companies have such poorly organized archives of older products’ documentation that they often cannot find complete copies, or they have been destroyed, lost, or misfiled. Unless legal liability issues or industry regulations demand otherwise these records are a very low priority in most cases.

        1. In 30+ years I have many times encountered computer products where the instant they went EOL the company destroyed all records, software, instructions and other documentation about it. It’s especially irritating to get a piece, go to the website to discover that *the day before* was the day the company did the purge. As Agent 86 said “Missed it by that much!”.

          But that’s not the worst. I’ve had companies flat out deny ever making a product with their current address, phone number, logo and URL on it. Media Vision “We never made a sound card model called ‘Jazz 16′”. Bull Poop. Yes they did. US Robotics told me they no way, no how made the US Robotics 28.8 PCMCIA modem with X-Jack that I was holding while on the phone with them, because US Robotics doesn’t make modems with X-Jack. (Nevermind that the modem was originally purchased in Scotland and was still under warranty!)

          Trident Micrososytems “never made” video cards, but they did make a gigantic number of “reference kits” with their FCC ID numbers and other info printed on the PCB, sold off to other companies to assemble. Nice way to not manufacture (or provide support for) video cards while actually manufacturing video cards. Very few Trident GPUs ended up on PCBs not designed or manufactured by Trident. An even smaller number had video BIOS that wasn’t simply Trident’s own with a text string replaced to change the name.

          The one that really takes the cake as a reason for not providing information, not even the barest specifications, was a monitor manufacturer that removed information on discontinued models “because someone might want to buy one”. Had the opposite effect on me. Won’t tell me the resolution and scan rate capabilities on last year’s model, I don’t want to buy your new one.

          1. Thank you very much for your insight.
            That’s worse than I thought.
            I had hopes, big companies were natrually organised to keep track of their product.
            I guess I was wrong, meh…

    1. From the article: “– diving into the Technical Reference Manual — “. I don’t have the IIc+ reference manual, but for the IIc, the manual actual has very detailed information about the hardware and ROM. IIRC it has full ROM listings with comments.

      It might be that Apple itself doesn’t have much more documentation than this. As you might know, not many software projects are that well documented..

    2. Not only did Apple provide full documentation on the ROMs for the ][ and ][plus, they included a full source listing in the manuals that were shipped with them. The only thing not documented was Applesoft, most likely because that was used under license from Microsoft.

        1. 99.44% sure the ][ was hand taped. The Gerber file format didn’t come out until 1980, and wasn’t heavily adopted until later. These guys built in their garage, and unless they had access to the rather limited and expensive CAD software that was running on PDP-15’s and PDP-11/34’s, it would have had to have been hand taped.

          There were several spins of the ][ motherboard, and in subsequent versions may have been done on a CAD system.

    3. “I’m pretty sure it has been extensively debated, but I always wonder why companies like Apple wouldn’t release their documentation on those very old hardware and ROM.”

      Why do you claim they didn’t?

      The source code to the firmware ROM is in the back of the user manual included with the computer.
      The technical reference manual with full computer schematics and hardware details was published only a couple of years after the computer itself was on the market.

    4. The hardware schematic for my Apple II was in the back of the manual. The ROM was directly readable by BASIC. If you wanted a annotated assembly code printout, you could get a third-party program called SOURCEror, which decompiled your own ROM (for copyright reasons, they couldn’t provide you with a copy, but had to use the copy of the ROM in your own Apple) with its own human-readable labels/comments.

  3. A lot of old hardware is fun to play with. You get into the nuts and bolts of the thing. No windows hardware abstract layers.. You did every every thing you could think of to get as much speed as you possibly could. Many of us would dircecly load the video card becuase it was faster then doing it the “approved way” bypassing the bios for example. You should see some of the Spaghetti Code i wrote back in the day.

  4. i was actually a huge fan of old skool macs. i kind of wanted to pilfer one of the mac se computers from a shed in my highschool. but the teacher went and let me have an old ti computer instead. it had one game and a basic interpreter, so in retrospect i should have shoved that mac into my backpack.

  5. I’m surprised the II didn’t even have interrupts. Can that be true?

    I have to disagree with this though: and since the Plus could run at 4MHz, it was faster than the strange eight or sixteen bit Apple IIGS. The IIGS had a 2.8MHz clock rate to keep it from making the new Macs with their 68K processor look bad, even though its 65816 was capable of much more. However, my 65816 Forth runs two to three times as fast as my 65c02 Forth at a given clock speed, because the ‘816 handles 16-bit quantities so much more efficiently, and also has more instructions to streamline even some of the 8-bit operations. That would translate to a 2.8MHz IIGS being 1.4 to 2.1 times as fast as the 4MHz IIc+.

    Regardless, congratulations to Quinn Dunki.

    1. The majority of software available is 8 bit 65C02 code. Your typical user back in the day would have most likely experienced the //c+ being faster than a stock GS for that reason.

      The //e outsold and sold longer than the GS did too. That huge body of 8 bit only software really mattered.

    2. Is html allowed in the comments? Something in my comment above got thrown out, apparently because the software thought it looked like an html tag, but was invalid as one. I don’t see any way to edit the comment to try things. Any help would be appreciated. Anyway, the sentence I was quoting from the article was: “and since the Plus could run at 4MHz, it was faster than the strange eight or sixteen bit Apple IIGS.”

  6. Actually on the 8-bit apple II models (not sure if it worked on the GS), you could pull off a trick to get a very primitive VSYNC by reading an unused memory address. During refresh cycles the bus would hang onto the bytes in the memory holes present in the video memory. By stuffing values in those holes and reading CFFFh (when no card was using the area) you could get a usable VSYNC. Several games did this, and wouldn’t work on emulators that didn’t simulate the effect.

  7. Thanks for all the comments, everyone, and thanks to Brian for his nice synopsis of the article. To answer a few questions people had:

    1) All Apple II models have complete ROM source code provided in the manuals, EXCEPT the IIc Plus, maddeningly. This is the machine where Apple decided to start providing less and less of that kind of information. In the second edition of the Apple IIc Technical a Reference Manual (which documents the IIc Plus), the ROM is documented in the style of a modern binary-only SDK. Only entry points and parameters are provided. Aside from some really bad scans of the schematics, very little technical information exists in the wild on the IIc Plus. Even basic ROM dumps were very hard to find (I made my own), never mind documented disassembles. The IIc Plus has a bunch of custom chips in it that are undocumented as well.

    2) The Apple IIc models actually do have a vertical blank interrupt, used for the newfangled “mouse” thing that you could buy. However, game programmers couldn’t use the VBL interrupt, because no other II model had it. Other Apple II models do have a bit you can poll to determine when the VBL is currently active. This can be used along with careful cycle counting to approximate rendering in sync with video refresh. However, that is not at all the same as having an independent time base, which all modern computing and software design depends on.

    3) Apple IIs were made first in America, then in Signapore and probably Hong Kong (which of course was a British colony at the time), but never China as far as I am aware.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s