Friday, March 13, 2020

Here's What You Missed

The last decade or so has seen a bit of a revival in the Commodore 8-bit branch of the retro-gaming and retro-computing realm.  Prices have been rising, new hardware and software has exploded, and the chatter in all kinds of social media has multiplied.  For me, it's been fantastic.

However, I've observed a kind of awareness gap in the prodigal sons who've been returning to the fold.  I decided, therefore, to write a little essay to get everyone who was absent from the 8-bit community during the 1990s and 2000s caught up. 

For fellow die-hards: if I neglected anything, please comment below.   This will understandably be written with a U.S. bias, though I did my best to overcome it.

And with that, let's get started.

Part 1: Hardware


For the Commodore 8-bit scene, the 1990s cannot be understood at all without talking about a little company founded by Doug Cotton and Mark Fellows in Massachusetts called Creative Micro Designs.  From 1987 - 2001, CMD made us feel like our machines were more a lifestyle choice than clinging to obsolescence.  Their products included the Kernal upgrade JiffyDOS, the SuperCPU 20mhz accelerator, HD-Series hard drives, FD-Series high density and enhanced density 3.5" floppy drives, the RAMlink ram drive, Smart-series mice and trackball controllers, gamepads, 1750 ram expansion clones (with 2MB!), and don't forget the SIDSymphony sound expander, and the SwiftLink and Turbo232 high speed serial/UART cartridges they licensed from Dr. Evil Labs.



While CMD towered over the 90s, they weren't entirely alone in their efforts to give Commodore power users new capacity.   Tomas Pribyl and Jan Vorlicek developed the IDE-64 in 1994, a cartridge-based IDE controller that bragged better performance and a lower price, at the expense of compatibility, for mass storage.

Another option that emerged in the 90s was 64NET from Paul Gardner-Stephen, which allowed a PC to be used as a storage device for a C64.   Around 2000, a similar solution called 64HDD, was devised by Nick Coplin.



As the internet began to take off in the mid-90s, new products began to emerge to solve the most pressing and important problem of the day:  how to get software from the internet onto floppy disks.  This led to various cables and solutions for connecting Commodore floppy drives to internet-enabled PCs in order to transfer software, primarily using Joe Forster's Star Commander software.  These cables began with Leopoldo Ghielmetti's X1541 cable in 1992, which eventually expanded to include the XM1541, XE1541, and so forth.



Not to be left out, however, these dark ages also saw the first devices for getting 8-bits onto the internet directly.  Initially this was through dial-up modems, often involving the aforementioned SwiftLink cartridge.  Eventually, the wired-ethernet solution RR-Net was introduced by Jens Schönfeld as an add-on for the Retro-Reply cartridge, although software support has always been somewhat slim for this device.    An even stranger solution was the Palm Pilot ethernet cradle, which, when combined with the SwiftLink cartridge, also allowed wired ethernet capability.



At the beginning of the new millennium, though, the scene's attention was turned to a young self-taught engineer named Jeri Ellsworth, who promised to bring us something previously un-imagined: a new hardware reproduction of the Commodore 64.  By re-implementing each of the computer's custom chips in FPGA technology, this culminated in the CommodoreOne (C-One) computer.   Not many years later, this same technology was scaled back in the form of the C64 DTV game.  The DTV was famously designed to be hacked in such a way as to include ports for a keyboard and second joystick, and a serial port for disk drives, allowing it to be turned into a useful computer.

Part II: Software



Above is a screen shot of the Weekend World demo by Outcast.  The interregnum Commodore demo scene saw a decline in the number of releases, though not in their quality.  By the year 2000, the scene was producing 10% of what it had in 1990, but all of it building on the technological achievements of their predecessors.  Output remained steady through 2009 before finally dying off in the last 10 years.  The demo scene, especially in Europe, was the social center of Commodore 8-bit fandom.  "The Scene" as it was called, was organizing itself into yearly and bi-annual "Parties" all over the continent.

Meanwhile, the same period saw intense interest among die-hard 8-bitters in new operating systems and platforms to take advantage of new hardware, new innovations in user interfaces, and, of course to access the internet.  Chief amongst these was the graphical user interface GEOS and its Trinity of Successors.  



Although Creative Micro Designs often released patches and utilities to help users of Berkeley Softwork's GEOS 2.0 enjoy their new hardware, it became quickly apparent, even to CMD themselves, that a more integrated solution was required.  First out of the gate with such a solution was CMD themselves, with gateWay.  Written by Jim Collette, gateWay featured integral support for CMD hardware, a task switcher, and a highly customizable (albeit unattractive) deskTop.



The next leg of the trinity to arrive was Maurice Randall's "Wheels" (GEOS 4.0) OS.  Wheels sported movable and re-sizable windows, and support for CMD native partitions and sub directories in its beautiful "Dashboard" replacement for deskTop.  This was quickly followed by GEOS MegaPatch3 by Markus Kanet in Germany, which included TopDesk 64, and, like gateWay, included integrated task switching.



While the GEOS patches remained a popular platform, UN*X clones for the 8-bits began arriving as well.  First up was LUNIX in 1993 by Daniel Dallmann, which featured pre-emptive multitasking, pipes, and support for SLIP, PPP, and featured several network clients.   The same year, Craig Bruce released his own ACE r9 for the C64 and C128, along with ZED-128 text editor, capable of handling enormous text files.  Greg Reidel's UNIX-128 for the Commodore 128 rounds out our list.


As the year 2000 rolled around, Jolse Maginnis brought us an OS for the CMD SuperCPU, called WiNGs.  It's object was to give the c64 support for the latest audio and video encodings, as well as extensive support for internet connectivity. 


Our final entry in the OS bundle came in 2003, when Adam Dunkels released Contiki OS for all manner of Commodore 8-bits, as well as other platforms.  Another GUI OS, Contiki was significant as a vehicle for RR-Net cartridges, by including a native tcp/ip stack as well as several internet servers and clients.  Every 8-bitter wanted to run a web server on their C64 that year.

Software which ran on the standard Commodore kernal was also plentiful during this period, and helped us stay tentatively connected with advances in the PC-world.  This included Pasi Ojala's "gunzip" in 2002 and "puzip" in 2004, Errol Smith's "UnZip64 v2" for handling pkzipped archives in 1998, and David DeSimone's "uuxfer" for decoding programs off of USENET.  




New graphic formats popularized in the 90s also got support on our little 8-bits, include JPEG with JPX viewer by Stephen Judd in 1999,  GIF files with VGIF viewer by David Jansen in 1990, and geoGIF by Randy Weems for GEOS the same year.  Photos became a particular fascination with C64 users with the invention/discovery of dozens of new video modes one could achieve with the VIC-II chip, such as FLI, IFLI, and all the derivatives that emerged between 1990 and 2010.



There were also advances in image creating and editing software for the 8-bits as well.  This includes the amazing GoDot system for the C64 released in 1996 by Arndt Dettke, as well as IPaint for the Commodore 128 in 1993 by Rick Kane.  And of course, there is no way GEOS would be outdone on image editing, which made the release of geoCanvas by Nate Fiedler in 1993 quite an event.


And lastly, as the BBS scene gave way to the internet, serial terminal programs capable of 80 column display and ANSI grew in importance for 8-bit computer users using dial-up shell accounts.  This made the release of Novaterm 9.6 by Nick Rossi in 1997 an extremely welcome development for C64 users.  On the Commodore 128, we all swore by DesTerm by Mathew Desmond in 1998.

Part III: Magazines

Magazines and other bundles of periodical content continued to play an important role in the interregnum, especially during the early 1990s when it was still our only way to find out what was going on in the Commodore world.

At first, the Glossy magazines, especially those hanging in from the 1980s, continued to keep us in the loop.  



In the U.S., these would include RUN Magazine which continued until 1993, and COMPUTE! magazine, which included an internal "Gazette" section for 8-bitters until 1994.   In their waning years, the content shifted a bit towards GEOS and the new CMD hardware, but otherwise kept their original focus.

Believe it or not, new glossy magazines also appeared after the old 1980s magazines vanished.  Although many of them didn't last very long.  



Creative Micro Design's own Commodore World, which ran from 1994-1999, picked up where RUN magazine left off and focused almost entirely on GEOS and their other products.  Meanwhile, GO64!, a German language Magazine, was published  by CSW Verlag from 1997-2000.  GO64! also began publishing an English edition in 1999, and picked up the remainder of Commodore World's subscribers.



Also in Europe, the gaming magazine Commodore Format held strong from 1990 all the way through Commodore's bankruptcy in 1995.   It remained intensely focused on cheat codes and strategies and tons of colorful screenshots all the way.

And of course, the magazine Die Hard ran for 20 issues, from 1992 to 1994, and started out as a monochrome newsletter to quickly build into a nice glossy magazine.  It was published by LynnCarthy Industries in Idaho.



Magazines based entirely on disk have been around since the 1980s, and chief among those was the mighty LoadStar by Fender Tucker of SoftDisk Publishing, and later Dave Moorman.   Known for publishing digital articles and original Commodore 64 programs, pictures, and music from independent contributors, LoadStar managed to hang on far longer than most.  In 1990, LoadStar 128 joined its older brother as a Commodore 128 only publication, and they ran until 2007.  The disk magazine was also accompanied by a paper magazine called the LoadStar Letter, which spawned another paper publication called The Underground by S. Eggleston of California.



Launched in 2001 by Joerg "Nafcom" Droege, Scene World has been publishing their interviews,  articles, and software for both NTSC and PAL users ever since.

Another important disk magazines from this period is Commodore Gazette published by Christopher Ryan of Michigan, which ran from 1995 - 2004.  It focused primarily on articles and public domain software.    



Of course, its impossible to discuss periodicals from this period without discussing the several online newsletters published during this time.  First and foremost among these was the mighty C= Hacking Magazine published by Craig Taylor, Jim Brian, and Steve Judd between 1992 and 2002.  It focused on community innovations, programming techniques, and the hidden capabilities of our little 8-bits.

And lastly, although you've probably already heard of it, the online magazine Commodore Free was started back in 2006 by Nigel Parker, and didn't cease publishing new issues until 2017.  

Part IV: Early Internet

The early days of the internet for Commodore 8-bit users could be summed up by USENET and FTP.  Web sites did exist, but tended to be more like picture galleries and references than social media.

USENET was the early internet's standard Forums protocol, and allowed for networked computers to share plain-ascii text under group categories.  It was THE social media of the 1990s for Commodore users.  

The popular USENET groups for C= 8-bitters were called "comp.sys.cbm" and "comp.binaries.cbm".

The former was for announcements, conversation, trolling, and the occasional Speccy vs C64 flame war.  It would be pretty familiar to any modern user browsing the old discussions, which you can absolutely do right now through google groups.  Common refrains there include the FAQ postings by Cameron Kaiser, and few old timers will forget the ramblings of WildStar.

"comp.binaries.cbm" is a odd medium for sharing software, but that's what it was.  Although on casual inspection it appeared to be another discussion forum, instead you'd find most of the messages were UUencoded ascii of various commodore related binaries, often broken up into several parts spanning several messages.  An early unix shell account user would download the parts of the message, combine them, and translate them back from ascii -> binary before moving it over to a floppy for execution.

FTP sites constituted a more straight-forward method for sharing binary files on the internet, and several FTP sites sprang up during the 90s to serve the 8-bit community.

One early important site was the FUNET archives at ftp://ftp.funet.fi/pub/cbm.  Maintained by Marko Mäkelä until 2005, funet was invaluable as a source of firmware for computers with dead roms, schematics for troubleshooting, as well as all the latest utilities and project documents to keep any 8-bit user busy.  Since 2005, the archive has been at ftp://ftp.zimmers.net/pub/cbm

Videocam.net.au, run by the Australians Rod and Gaelyne Gasson, was another popular general purpose file area that seemed to have a little bit of everything. 

When it comes to games, however, nothing beat arnold.c64.org and arnold.niof.no.  So popular were these enormous collections of disk images that they were known simply as "The Arnold Archives".  



Web sites, while not as important early on, were still seen as artistic monuments on a hill -- discussed when they changed, and little more.  Many of these monuments remain to this day, while some have faded into memory.  The Secret Weapons of Commodore has always been one of my personal favorites, as was the Commodore 8-Bit Server, the Commodore Knowledge Base, VIC-20 Digital Archaeology, Snakeman's page, Project 64, Zimmers.net, and the CBM-II Page -- but these are just a  sample.



Part V: Sunset, or Sunrise?

The last decade has seen impressive leaps of renewed interest in Commodore 8-bit computing.  New storage devices, new networking solutions, new display options, new computers, and piles of new games and software that seems to have come out of nowhere.  It's almost like the 1980s are completely back again.

But between 1990 and 2010, the 8-bit community marched onward, even as we watched former comrades fall away.  I think it's useful to remember that period, both to reflect on the problems we faced, and on all that was built as a foundation for what we would all enjoy today in our little 8-bit hobby.






Thursday, February 6, 2020

Return of the geoJunky

Despite having had copies of the software forever, it wasn't until the early 1990s that I became a true convert to the cult of GEOS.




I picked up every accessory, every productivity package, every Thing I could get my hands on that was related to this Mac-like GUI for the Commodore 64 and 128.  And this included geoProgrammer, the official symbolic macro assembler, linker, and debugging package from BSW.

Code is written for geoProgrammer using the stock GEOS word processor, called geoWrite.  This has the fun side-effect of not only allowing image assets to be integrated into the source code document, but also allows you to use all the fonts and styles and margins to make your code as beautiful as possible.

So armed, I spent the 90s and early 2000s writing numerous applications for GEOS.  You can find information about most of them on my geoProjects page.  However, my geoCoding spree pretty much came to an end in 2002 ..... until very recently.



The C64Net WiFi modem, which I've blogged about to the point of exhaustion at this point, inspired not only my 8-bit programming in general, but got me back into GEOS programming in particular.

In 2017 I wrote an 80 column ansi terminal program called geoTelnet, which I've also mentioned in previous posts before, but you can find more information about it here.

In early 2018, not long after its release, I got asked to do a color PETSCII terminal program for enjoying online BBSes from GEOS.  I figured this would be a pretty easy slam dunk, since the hardest problem, rs232 communication in GEOS, was already solved.



However, as engineers are wont to do, I decided I needed to re-architect things.  You see, geoTelnet was a VLIR application, so it theoretically could grow naturally with new swapped-in code modules.  However, it was only designed for two modules:  a GEOS 64 module with all features, and a GEOS 128 module with all features.  This left things rather squeezed, with no room for, for example, more transfer protocols or a settings screen.

This created a slew of linking issues, since the code sections for the features were already pretty integrated with each other, and weren't expecting to be separated from each other.  However, that was a straight-forward problem.  What really frustrated me for several days as I started migrating to the new architecture was hard system crashes whenever text was printed on the screen.  My interest soon waned, and a year went by when I gave no thought to it.




Then, in early 2020, on a whim, I decided to pick it back up and see if I couldn't find that bug.  And find it I did, almost immediately (it was pretty stupid).  I was so excited that I spent the entire rest of the day hacking away on my PETSCII renderer. 

To test it, the next feature I tackled was getting the Buffering system working again.  This would allow me to load PETSCII files from disk for testing.  I then generated the above test pattern in Commodore BASIC, saved it, loaded it into my program, and eventually got it to what you see above.



The first time I saw true online PETSCII art rendered correctly on the screen, I was ecstatic.  I was able to borrow from the code written for ANSI and Telnet codes to implement the cursor and other special PETSCII codes.

The last unique feature to put in place is the ability to actually input PETSCII codes from the keyboard.  Things like color codes, special graphics characters, and the ability to toggle between the two font modes (lower/upper and upper/graphics).  Surprisingly, this turned out to be trickier than I thought.

You see, the GEOS kernel doesn't care about many of the keys on the keyboard, so they simply don't scan them.  And since they don't scan them, they aren't available as keystroke events for my terminal program to act upon.  This led to me having to learn how the standard Commodore KERNAL actually accomplishes the feat, so that it can be replicated in my application.  Turns out it's not too bad -- you consult an 8x8 matrix of all possible keys, tell the 6526 CIA to pull one of the rows, and then read back an 8-bit bitmap, which tells you which, if any, keys on that row are being pressed.


Once that was done, fixing the remaining features was pretty much a down-hill process.  The phonebook, terminal options, desk accessories, and x-modem worked pretty much the same as they did in geoTelnet.   X-Modem uploads did give me a little trouble, due to the fact that serial communication must be de-activated to swap modules, causing it to "miss" the handshake character from the remote side.  This was quickly figured out though.

I'm not sure what's next at this point.  I'd considered fulfilling the promise of the re-architecteing by not only adding new transfer protocols, but by actually integrating the ascii and ansi features of geoTelnet back into this program, to create one large full-featured terminal.  Though, I might also venture into other areas -- geoFTP, geoIRC, geoETC...

We'll see.


Saturday, January 11, 2020

Attack of the Mouse Clones

In 1985 Commodore brought the Amiga into the world, with its amazing GUI interface, which required a mouse.  Also at this time, the GEOS GUI operating system was becoming quite popular for the Commodore 8-bit line of computers, such as the C64 and the brand new Commodore 128, and it also could benefit from a mouse.

The control ports that mice plugged into were not identical between the Amiga and C64/C128 line, so necessarily their mice would not be compatible with each other.  However, since both the Commodore 128 and the Amiga (1000) had identical case colors, it was reasonable to produce mice that matched each other in color at least.  What was NOT reasonable, however, was to produce mice that were completely IDENTICAL from the outside, while remaining incompatible with each other. 

Oh, and also, there weren't just two of them, but three functionally different mice in the exact same case:

Let me introduce you to the Commodore 1350, Commodore 1351, and the Commodore 1352, also known as the Amiga "Tank" Mouse.

Released around Sep of 1985, the 1350 is the most odd of the three mice, as it's really a directional (non-proportional) Joystick stuck in a mouse case.  It works with both the C64/C128 and the Amiga, but only as a joystick, and not as a very good one, since a mouse is a terrible way to persist directional movement.

In March/April of 1987, the 1351 mouse was released.  This is a true proportional mouse for the Commodore 64 and 128, and it works very well for that purpose.  GEOS was greatly enhanced by this product, and its design earned Commodore some sort of patent!  The 1351 is also special in the fact that it can emulate the 1350 as a joystick by holding down the right button on boot.

In November of 1985, the Amiga became available for purchase, and that's when we first saw the Amiga "Tank" mouse in its original form.  It wasn't until 1988, however, that it was marketed to Commodore PC users as the 1352.  Like the 1351, it is a good and proper proportional mouse for Amigas and Commodore brand PCs.  It is not compatible with PC "serial" mice, however.

The big question: 
If you get handed one of these things, how do you tell them apart?


Well, let's start with the easiest thing to check:  as you can tell by the picture above, they are absolutely identical from the top, so that's not the answer.

What about the cable ends?  Since all three have different pinouts, perhaps the connector is different:


Here you can see two kinds of connectors pictured: A pair of fat-but-shorter connectors on the right, and a longer-thinner connector on the left.  All three of those are from Commodore 1351 mice.  So-- not entirely helpful.  Amiga mice tended to have the long-thin connectors, and the 1350 tended to have the short-fat connector, but as you can see, the 1351 could have either.

While the above is disappointing, there is ONE connector that is a dead giveaway:



The original Amiga 1000 mouse had a large angled connector designed to fit snugly into the side connector of the Amiga case.  When you see one of these connectors, you can be sure you are looking at an Amiga mouse.

OK, so what about the bottom labels?  Surely Commodore put the model information on the bottom!  Heck, we should have looked there first, so let's take a look:




Except for the odd 1351, and the giant AMIGA letters on a few A1000 mice (not pictured), there is no model information.  Believe it or not, however, there are at least some patterns.  You see, the top row are all 1350s, the middle are 1351s, and the bottom are Amiga mice.

Amiga mice seem to usually have similar looking bottom labels, even if there isn't any model information.  They have those dark bold black letterings, the C= commodore lowercase logo, and a serial number beginning either with an A or B.   However, there are exceptions to this as well. Pictured above is an Amiga 1000 mouse, with a lighter colored labeled and serial beginning with TM.  Such labels have also been seen on non A-1000 mice.

The 1351s, when you are lucky, actually say 1351 on them.  When you aren't lucky, you get the lighter colored C= Commodore logo and lettering with a simple numeric serial number.  But mine is a small sample size, so who knows what variations are out there.

The 1350s are the only ones that say Commodore Business Machines on the bottom, again with lighter colored lettering than the Amigas, and a serial number beginning with X.  Although, again, that's just my small sample size.

But...

.
.. maybe you aren't comfortable with this method.  After all, there's no way I can survey every single Commodore mouse.  Suppose I made a mistake above, and some 1351s have labels that look like the Amiga, or some Amiga mice have labels like the 1350 or 1351s?  Surely we can just pop the top off and look inside to tell the difference:



Now we are getting somewhere.  This picture is the 1350, and it has a separate button board above the main board.  So, that's how we can tell those from the 1351 and Amiga mice below, right?  Wrong.  The raise "button board" seems to be more a sign of when the mouse was made than the model.  Since the 1350 and the Amiga mice were made earlier than the 1351, the early revisions will often have this raised button board. Meanwhile, later versions of the 1351 and the Amiga mouse will all be single-boards, as shown below.  As far as I know, the limited run 1350s do all have that raised board, but I could be surprised.





The later boards on the 1351 and Amiga mouse respectively, pictured above, have their components consolidated to a single board.  The later 1351s don't seem to have any resisters along the left-hand-side of the board, while the later Amiga mice always do -- either three or five, depending on revision.

The biggest difference, however, and the one certain SURE-FIRE way to tell the difference between these three mice is the chip inside.

So that's the answer!

Except that it's a little complicated.


The Commodore 1351 mouse is easy.  It almost always has a C= CSG 5717 chip in it.  In fact, that same chip also appears in several 1351 clones I ran across, such as the CMD SmartMouse.  So, if you see the CSG 5717 inside, you know you are looking at a 1351, period.  Although, I found a 1351 online with a chip labeled "390209-01" -- so I guess that one too?




The Commodore 1350 has a chip which is probably a little "CMOS 4 bit microprocessor with A/D converter".   This would make sense, since the analog signal from the wheel sensors are converted into simple on-off signals for the various directions.    In this case, I'm seeing the Mitsumi MP01 and the MB88201


Lastly, the Amiga mice have an analog quad comparator of one sort or another.  I think the 339 at the end is probably the giveaway here.



So!

That's the best I could come up with.  Clues in the labels and the connector, and then a final answer in the chip, if you are able to find the model number online to figure out what kind of chip it is.  If you have a Commodore or Amiga mouse with a serial label different from the ones discussed above, please drop me a line.

There might also be a way to check for the right-mouse-button on pin 9 of the Amiga mouse, but I was aiming for more visual inspection methods, so I didn't investigate this.  Still, if you want to pursue that, here is a pinout comparison.  The 1350 is labeled here as "1351 Joystick Mode".



Clearly Commodore should have thought about the confusion that might erupt around three products that look so similar, but which are functionally so different.  Hopefully this post can help anyone faced with the frustrating situation I found myself in today trying to distinguish between a pile of tank mice from someone else's collection.



Monday, August 20, 2018

C64Net WiFi Modem Filter State Machine

So, believe it or not, work continues on the C64Net WiFi Modem firmware.  Especially since the same firmware is being used in a traditional RS-232 version of the modem based on the ESP32 module.

Some of the newer features include:
  1. New AT+CONFIG configuration menu
  2. Ability to set the hostname
  3. X-Modem and Z-Modem downloads
  4. AT+SHELL to access an SD-card interface.
  5. NTP client with configurable timezone.
  6. New configurable socket filtering state machine.
That last feature is what I wanted to document here.

The use case was the ability to have the modem filter or transform bytes coming either from a socket connection, or from a web page via the AT&G command.  There were already existing commands to mask out specific bytes, but users needed something more complex.  I searched the web the best I could to find an existing language definition for doing such a thing, and couldn't come up with anything.  I therefore chose to invent a really simple filtering code/language.  

My requirements were that it had to be completely definable in ascii, using only characters available for the AT command set in quotes.  It needed to be as compact as possible for memory constraints, and needed to handle cases like filtering out everything inside html comments <!-- -->, or possibly filtering out everything NOT inside html comments.

Here is what I came up with:

State Machine entry format:
MMcCCNN
MM - byte value to match, in hex. The value 00 matches ALL.
c - Command character: e)at char, p)ush to que, d)isplay char, r)eplace char, q)ue display and empty, x)empty que
CC - if c == 'r', then hex value of replacement byte
C - if c != 'r', then same as 'c', or '-' to do nothing further.
NN - next state, in hex, starting with state 00.

The machine starts with state 00, and, for each character byte, increments the state until a match is made, at which point is executes commands and proceeds to state NN.

Example:
Suppose you wanted to filter out everything in a web page EXCEPT the contents of the comments.

Important chars and their hex values:
< 3c
! 21
- 2d
> 3e

So, to grab only the stuff from <!-- -->, your state machine would look like this:
## -CODE--  COMMENT
00 3Ce--02  <-- if a '<' go to state 02
01 00e--00  <-- anything else, ignore it, go back to state 00
02 21e--04  <-- if '<!', go to state 04
03 00x--00  <-- anything else, ignore it, go back to state 00
04 2de--06  <-- if '<!-', go to state 06
05 00x--00  <-- anything else, ignore it, go back to state 00
06 2de--08  <-- if '<!--', go to state 08
07 00x--00  <-- anything else, ignore it, go back to state 00
08 2dp--0a  <-- now inside the <!--.  If '-', then state 0A
09 00qd-08  <-- anything else, display que & char, go to state 08
0a 2dp--0c  <-- if '--', then que the char, go to state 0C
0b 00qd-08  <-- anything else, display que & char, go to state 08
0c 3ex--00  <-- if '-->', dump the que, ignore char, go to state 00
0d 2dqd-0a  <-- anything else, display que & char, go to state 08


So, to do the AT&Y command, we just combine the codes in order:
AT&Y"3Ce--0200e--0021e--0400x--002de--0600x--002de--0800x--002dp--0a00qd-082dp--0c00qd-083ex--002dqd-0a"

Then any subsequent packets received from an open socket, or from the AT&G command (which dumps a web page to the modem) will use the above filter.

A few extra utility arguments were added for convenience:
AT&Y     with no arguments clears the state machine definition entirely
AT&Yn   where n is a decimal number, will set the state machine state.

All of this will be in 3.4 of Zimodem.


Amiga Recaps, Pt. 1

Lately I've been recapping Amigas with a fellow from the CTCUG group.  That's been going pretty well.  I've been practicing on spare Amiga 600 boards, of which I had 3 non-booting boards.  All 3 began booting after the recap, which is amazing happiness.  Once I've recapped all my spare boards, I'll move on to the computers in my collection.

Some lessons I've learned:
1. Use hot air to remove surface mount caps with tin-foil to isolate the cap and the damage.  Be super-careful not to disturb nearby components for several minutes after removing the hot air.

2. Remove those tiny-legged through-hold electrolytics with a soldering iron on max heat by applying heat to the bottom pin while carefully pulling that pin up through the board.  Once you've exposed the top-side of the pin, resume pulling it up from the top of the board to make sure you aren't pulling up any traces on the top.  Then repeat for the second pin.

3. Clean the area with alcohol and q-tips afterwards, and carefully clean the through-holes with solder-wick.

4. When applying the surface mounted caps, do one leg at a time after tinning the pads.

5. Check the smd caps for a short afterwards.


Thursday, May 17, 2018

My new friend KIM.


I've had a pair of Commodore KIM-1 computers for at least 15 years now, but never really did anything with them.  That all changed over the last few weeks, and now I feel sorry for how much fun I've been missing out on.



The KIM-1 is a single board, 1mhz, 1 kilobyte computer (the green thing in the picture above) with a 23 key hexadecimal keypad for input, and a 6 digit LED display for output.  It also has two edge connectors on the left-hand-side.  One is called the Expansion port, and the lower one is the Application port.  The computer is powered by applying 5V to a pin on the Application port.  This port also includes a Current-Loop RS232 interface and cassette interface for saving/loading programs.

It may be a very minimal micro-computer, and it is definitely not a Home/Personal Computer, but it is certainly a computer!




The screen is divided into two segments.  The left four hex-digits are the current working Address, and the right two hex-digits are the contents of that address.  The address can represent the program counter when stepping through a program, or just the address currently being read or written to when using the KIM-1s built-in monitor.



The keyboard has the sixteen hex digits for entering addresses or data.  The AD button selects "Address" mode, where any entry on the keyboard will change the current working address.  The DA button selects "Data" mode, where any entry will change the contents of the address shown on the LED screen.  When in either Data or Address mode, the + key will advance to the next address byte.

The switch in the upper left selects between SST mode (on), which allows you to step through an executing program one instruction at a time, and normal mode (off), which allows a program to run freely to completion.  In both modes, the GO button will begin executing the program from the current address shown.  In SST mode, the GO button is then used to execute the next instruction, and then immediately return to the monitor program.

The RS button will reset the CPU and cause the KIM to re-enter the built-in monitor.  It is the first button you must press after powering-on the KIM-1.  Lastly, the PC button does nothing except replace the current address with the program counter address.



The KIM-1 is powered by three principle chips.  One, of course, is the MOS 6502 cpu/processor.  The other two are a pair of MOS 6530 RRIOT chips.  Each has 64 bytes (!) of ram, a pair of 8-bit bi-directional I/O controllers, timer registers, and 1k of ROM.  On one of the 6530s is the ROM code for the ml-monitor and cassette interface, while the other has the paper-tape interface.



I have a couple of Corsham expansion boards hooked up to my KIM, which are awfully convenient, and part of the reason why I finally dug the KIM-1 out for play.  Pictured above is their I/O board, which provides a standard 9-pin RS-232 port, which converts to the KIM's strange current-loop port.  It also has convenient interface for regulated 5V, 12V, and ground (the colored wires you see above), as well as an audio input and output jack for plugging in a standard cassette deck.  The little switch on the bottom lets me pick between TTY input, and using the KIM's keypad.


On the Expansion port is a Corsham 60k ram expansion card, gives the computer ram from $2000 all the way through $FFF7.



Once I got it working, I hooked the KIM-1 up to my VIC-20 through the VIC-1011A TTL interface and used the VIC's keyboard and monitor to program the computer.

One of my first programs was a memory-page address tester to make sure that the Corsham 60K ram expander was working correctly.  The program simply puts the page number into every byte in every page above $2000, and I then use the monitor to spot-check the results.

The first program I wrote on it was done by writing the assembly on paper for address $0200, and then translating the mnemonics into the machine language op-code numbers, and the branch addresses into one byte 6502 offsets.

Later, I realized that I could simply write the code in assembly, assemble it on the c64, and then key in the generated bytes onto the KIM's keyboard.

I am seriously interested in translating Microsoft BASIC for the KIM, and have discovered numerous resources on the web for doing that.  Check back here in the future for progress on that project.













Thursday, November 2, 2017

PETs are my Business



For a long time, I've been trying to get my hands on one of the U.S. PET 2001-B 'Business' series computers.  And boy are they rare!  I've seen at least two go through eBay, but over-confidence and under-estimations caused me to lose them. :(

But finally, I struck gold .. well, sorta.  A 2001B-16 turned up on eBay, but was advertised as non-functional.  It was still an opportunity worth taking, so I took it:



So, let's talk about this computer and what makes it unique!

At first glance, it appears to be just another PET with a 9" screen, just like it's Home series brother, the 2001N.  However, look closer and you'll see that the keyboard keycaps are not only different, but the entire arrangement of the keyboard has changed! There are no PETSCII graphic symbols on the front of the keys, the punctuation symbols and number keys are arranged together at the top row, just like a typewriter, and the numeric keypad is smaller.   This keyboard would go on to be used in the PET 8032 also.



Under the hood is another important difference.  The standard Editor ROM, which handles screen editor control and keyboard mapping, is replaced with a 'Business series' editor ROM, whose model number is 901474-01 (second rom from the left in the above picture).  This rom not only handles the new keyboard arrangement, but forces the computer to boot into Uppercase/Lowercase character set mode, instead of the Uppercase/Graphics mode the other PETs booted into.  The computer otherwise has the standard BASIC-2 Kernal and BASIC.



And lastly, of course, if the above was not convincing that this is not a 2001N series, the model number is "PET 2001-16B".


When I first got the machine, the computer did not boot, which the seller did warn me about.  Luckily, I had the Tynemouth 6502 PET diagnostics chip, v1.1!



This chip replaces the 6502 on the motherboard, and performs several tests on main ram, video ram, and provides a hash and identification of the roms.


The first run showed the video ram and ROMs in good shape (the -UNKNOWN- rom is the business editor, which is pretty rare, and the BASIC-4 was just a silly add-in I removed later).  However, it also shows ALL of the main ram as DOA.  One or two bad chips, and I might have started replacing them, but when they are all gone like that, something more fundamental was wrong.

And I quickly determined that the 12V rail was grounded.  The 4116 ram chips require +5VDC, -5VDC, and +12VDC.  So, starting at the regulator, I began removing and testing every damn component in the 12V circuit.



First up was this regulator, and the two caps and diodes you see here around C24 and C25.   The electrolytic was out of spec (it's a 47uF, but reported 68uF), so I replaced it with a high quality long-lasting modern one that was closer to spec.  Still, none of the components were shorted, so I followed the 12V rail down to the ram.



The 4116 ram chips I desoldered, socketed, and then re-inserted, after checking each one for a short at the 12V pin.  I broke one of the 4116s during this process, but had plenty of replacements.  Otherwise, I kept the original chips.

Next, on the advice of a friend, I moved to the tantalum capacitors (the larger blue caps on the LHS and RHS -- not the tiny blue ones next to the ram).  Turned out that was it!  TWO of the three tantalum capacitors I removed were shorted.  I therefore replaced all three.  The Tan colored capacitors you see intermingled with the blue ones were the ones I replaced.


And Walah! Now I have working RAM! Woohoo! You can see from the test screen that I also removed the silly BASIC-4 chip I had added for no reason other than the socket looked lonely.


You can see the char rom test is also good.

However, when I put the working 6502 processor back in, the computer still would not boot!

For giggles, I next tried the "PET tester ROM", which replaces the standard PET kernal instead of the processor, and runs a few simple memory tests.



As near as I can tell, those also came back with good results.

So, well, I thought about it.  When the computer starts, the CPU is reset, and it reads a location from the Kernal ROM at the bottom of memory and starts executing code.  So the CPU needs to work, and the Kernal needs to be readable.  Since the Pet Tester ROM test worked, I know it is doing those things.  After that, it will starting writing to main ram, and eventually screen ram.  I know all the RAM is good also, and that the CPU can read from and write to it.  What else does the PET do on startup?  I wasn't sure, but I imagined it also had to initialize the I/O chips so it can read from the keyboard.

So, I swapped out the 6522 VIA, and the two 6520 PIAs.  After swapping the PIA closest to the keyboard, BOOM:




And they lived happily ever after!