Apple II Web Server Written In BASIC

The Apple II was the machine that many say launched Apple as a company. As with many popular computers of the 1980s, the Apple II maintains a steady following to this day who continue to develop new hardware and software to keep the platform alive.

[deater] had scored an Uthernet II Ethernet interface for his Apple IIe, based off the venerable W5100 chipset. He decided to have some fun and wrote a webserver for the Apple II in BASIC. The program sets up the Ethernet card with a series of PEEKs and POKEs, and then listens out for incoming packets before responding with the requisite data loaded from floppy disk.

The server can deal with HTML, text, and even JPEG and PNG images. It’s even compliant with RFC 2324. It does suffer from some limitations however — the disk format used can only hold 140 kB, it can only serve an 8kB file at a time, and due to using a lot of string manipulation in the code, is painstakingly slow.

Before you get too excited, the machine is running on a local network only, so you can’t check it out from here. However, [deater] has kindly released the source code if you wish to run it for yourself.

If you’re thirsty for more 8-bit action, check out this Apple II playing animated GIFs.

A New OS For Apple II Computers

Although this sort of work is usually reserved for KansasFest and other forums for highly technical and very skilled Apple enthusiasts, [John Brooks]’s release of a new version of the ProDOS operating system is no less important. It is, without a doubt, the greatest release the Apple II platform will see for the next few years. This swan song of the Apple II platform is simply ProDOS 2.4, an update to the last version of Apple’s ProDOS, last released in 1993.

For a bit of historical context, ProDOS was not the operating system that shipped with the Apple ][ in 1977. That OS was simply called DOS. ProDOS, released in 1983, included support for the new 3.5″ floppy drives, allowed for hierarchical directories, supported hardware interrupts, and kept the Apple ][ line going well into the 90s. Despite these improvements, not all Apple ][ systems were supported. The original ][ and ][+ were out in the cold. Now, with the ability to add Compact Flash and USB devices to an Apple ][, even the latest version of ProDOS is horribly out of date.

[John]’s release of ProDOS 2.4 fixes all of this. This release is the most important development in the Apple ][ ecosystem in recent memory, and will remain so for at least a decade. The only person who still uses an Apple ][ as a daily driver agrees, and ProDOS 2.4 is now enshrined in The Archive for all eternity.

prodos-2-4-bitsy-bye-768x543New features abound, although most of them are geared toward the now thirty-year-old Apple IIGS. These features include enhanced utility in GS/OS – the Apple equivalent of the Commodore GEOS – slot remapping, and an OS that is both smaller and loads faster. Older machines aren’t left out, and ProDOS includes the usual features and improvements found in ProDOS 2.x that weren’t available in the Apple ][, Apple ][+ and un-enhanced Apple //e.

The killer feature and one more thing of this release is the BitsyBye utility, a small ($300!) system program that allows you to boot various Apple II devices and programs. Think of this as the Norton Commander of the Apple II ecosystem, allowing slots to be selected, booting the most recently used ProDOS device, and basic file system exploration. BitsyBye also includes an easter egg. A few utilities are also included on the ProDOS 2.4 disk image including ADTPro, Shrinkit archive expander, and disk utilities.

A 140k ProDOS 2.4 disk image is available on [John]’s site and on Archive.org. Since you’re probably not downloading directly to an Apple II disk, grab ADTPro and load it over audio.

Streaming Video On An Apple IIc

Some of the projects we feature solve a problem. Others just demonstrate that they can be done. We’re guessing that it’s the latter that motivated [Joshua Bell] to write a VNC client for an Apple IIc. To fully appreciate how insane this is, have a look at the video below the break.

There’s more than one thing amazing about this hack. Somehow, [Joshua]’s VNC program runs entirely in the memory of an Apple IIc, as he demonstrates at the beginning of the video by downloading all of the code into the Apple over a serial cable. After the initial bootstrap, he runs the code and you see (in full four-color splendour!) a low-res Windows XP appear on the IIc.

2440964467_decb0daf10_oWhat’s more incredible, but is unfortunately not demonstrated in the video, is that he appears to have not just mirrored the PC’s screen on the Apple, but has actually managed to get a one-frame-per-second bi-directional VNC working at 115,200 baud. In this snapshot from his flickr gallery, he appears to be playing Karateka on the IIc and watching it on his laptop.

If you’ve got a IIc kicking around, and you want to show it yet more new tricks, don’t neglect this browser written for the Apple IIc. Or if you’ve only got an Apple IIc+ and you’re totally ticked off that the beep is different from that of the IIc, you can always go on an epic reverse-engineering quest to “repair” it.

Continue reading “Streaming Video On An Apple IIc”

An Apple ][ Emulator On An Arduino Uno

April Fools’ Day may have passed, but we really had to check the calendar on this hack. [Damian Peckett] has implemented an Apple ][, its 6502 processor, and a cassette port, all on an Arduino Uno. If that wasn’t enough, he also uses a PS/2 keyboard for input and outputs analog VGA. [Damian] is doing all this with very few additional components. A couple of resistors, a capacitor and some very clever hacking were all [Damian] needed to convince an Arduino Uno that it was an Apple.

Making all this work boiled down to a case of resource management. The original Apple ][ had 4KB of RAM and 8KB of ROM. The ATmega328 has only 2KB of RAM, but 32KB of Flash. The only way to make this hack work would be to keep as much of the emulation and other routines in Flash, using as little RAM as possible.

The core of this hack starts with the MOS 6502, the processor used in the Apple. [Damian] wrote a simple assembler which translates the 6502 opcodes and address modes to instructions which can be executed by the Arduino’s ATmega328. To keep everything in ROM and make the emulator portable, [Damian] used two large switch statements. One for address modes, and a 352 line switch statement for the opcodes themselves.

A CPU alone is not an Apple though. [Damian] still needed input, output, and the ROM which made the Apple so special. Input was through a PS/2 keyboard. The PS/2 synchronous serial clock is easy to interface with an Arduino. Output was through a custom VGA implementation, which is a hack all its own. [Damian] used the lowly ATmega16u2 to generate the video timing. The 16u2 is normally used as the Arduino Uno’s USB interface. The only external hardware needed is a single 120 ohm resistor.

The original Apples had cassette and speaker interfaces. So does this emulated Apple. [Woz’s] original cassette and speaker interface accurate loops to generate and measure frequencies. One of the trade-offs [Damian] accepted in his 6502 was cycle accuracy, so he couldn’t use the original routines. Not a problem though, as he was able to write simple functions to replace these routines and drop them in place of the Apple’s own ROM calls.

The Apple ][ ROM itself is handled as one giant character array. This includes the system monitor, Mini-Assembler, Sweet-16, and [Woz’s] own Integer Basic. [Damian] caps off this incredible project by booting his new computer, loading a  Mandelbrot set program from cassette -or in this case an audio file stored on his cell phone, and running it. The well-known fractal is displayed in all its glory on a modern LCD monitor, driven by a microcontroller, emulating a computer from nearly 40 years ago.

Continue reading “An Apple ][ Emulator On An Arduino Uno”