Make an Apple // disc for BASIC week at Reddit RetroBattlestations

Apple //e for BASIC weekBASIC week at Reddit /r/retrobattlestations is over but you can relive the fun on your Apple // without any typing! Simply follow these steps to download the disk image to a new disk for your machine.

  1. Connect your laptop, tablet or phone’s headphone jack to the tape input jack on the back of your Apple // using a 1/8″ mini headphone cable.
  2. Turn the volume up to maximum.
  3. Turn on your machine and hold control and hit reset to get to a ] prompt.
  4. Insert a blank disk into drive 1 (it will be erased!).
  5. Turn on caps lock and type LOAD and hit return.
  6. Begin playing the .WAV file below on your device.

If all goes well, in about 2 minutes you should have a floppy that you can now boot from. When it’s finished, hit return to reboot your machine. ProDOS should load BASIC. Once it does, type LOAD REDDIT and then RUN.

[Apple // .WAV file to disc for BASIC week program 5.5MB]

Credit for creating the .WAV file from a .DSK image goes to C2T found at ASCII Express.

Enjoy!

 

 

Create a local web-based Apple II disc server

Here are the steps I used to create a local web-based Apple II disc server. This method uses the c2t tool for converting .dsk disk images to .wav audio files suitable for playback into the tape in jack of the Apple II. The Apple Disc Server site does this with preexisting disk images already converted to .wav files. I thought it would be nice to create a web-based service that would allow you to convert .dsk images to .wav files on the fly. This enables you to browse Apple II software with your iPad and instantly convert it to a disk.

 

  • Enable Apache server on your Mac
  • Create a directory (default is “c2t”) for the new service in /Library/WebServer/Documents
  • Create a new temporary directory (default is “tmp”) inside this new directory
  • Change ownership and permissions
     sudo chown www:www /Library/WebServer/Documents/c2t/tmp
     sudo chmod g+w /Library/WebServer/Documents/c2t/tmp
  • Download c2t and wget and install in your path

Adding S-Video to an Atari 800XL

Recently I setup a few of the computers from my retro computing collection. Along with the Amiga 2000, Apple IIc, and Macintosh Plus was the Atari 800XL.



I’ve not used it all that much and thought it deserved a little hands on time. When I acquired it I also purchased a 5 pin DIN plug for the video jack on the rear to bring out stereo RCA audio (although it’s just mono) and s-video. I was puzzled when I plugged it in and turned it on to find that the video was only in black and white. I switched to the RF modulator and saw color so I knew the computer was working fine. I searched and discovered that some (maybe all?) Atari 800XL’s have provisions for s-video, namely separated luma (brightness) and chroma (color) but Atari neglected to connect the chroma to the plug. This explains why the image has no color.



I searched and was surprised that I didn’t find all that much information on the subject. One site called the seemed to have the most information but I found the directions confusing and images that were hard to see. I kept searching and found a clear forum posting on AtariAge (post #8), also summarized below.

  1. REMOVE C56 capacitor (if present)
  2. Lift C54 right-hand side, preferably by inserting an on-off switch (if you want to preserve composite out).
  3. On the underside of the motherboard, solder chroma-signal wire from R67/R68 junction, to chroma pin in video DIN port pin 5. Follow the cable pathway exactly as shown so the RF shielding fits back on.
  4. Adjust brightness/contrast/saturation on your monitor. Don’t underestimate this step as I did at first. It’s important and made all the difference in the quality of the final picture.




With those small changes, I now have crisp s-video output from my Atari 800XL to an LCD monitor. The picture looks fantastic!

DIY C64 Diagnostic and Dead Test Carts

If you’ve ever attempted to repair a dead Commodore 64 beadbin, you know how frustrating it can be. You’re lucky if the machine turns on and shows something on the screen. This at least gives you some clues as to the problem. However, more often and not, you’re stuck with a blank screen. It doesn’t tell you much other than just about any chip in the computer is bad, or even a bad power supply. After checking the obvious things like missing chips, reseating socketed chips and checking the power supply voltages, the next place to go would be one of the two diagnostic carts that were available from Commodore service technicians.

The two test carts that were available are the C64 Diagnostic cart and the C64 Dead Test cart. Together, these carts are very useful in identifying problems. In order to use them, you need them in a cartridge. The diagnostic cart also had a cable harness that would test certain ports– it’s not required but will report false problems if not present. If you’ve followed my posts, you’ll know that I have a tutorial on how to convert an existing cartridge into a EPROM carrier board. In this case, instead of creating a 24 to 28 pin adapter, I’ve purchased the Retro Innovations 2364 Adapter for $5. It’s well worth the price.


In both cases, I’ve used a Commodore cartridge with ASSY # 326173-01. The thing you’ll find odd about the picture is the carts look completely different but have the same ASSY number. The good news is they behave the same way.

There are solder jumpers on the cart labeled J1 through J5. These control certain lines on the cartridge port that tell the C64 what type of peripheral is connected. Below is a table of the settings for the two carts.

C64 Diagnostic Cart Jumpers
J1: Closed (ROMH)
J2: Open (ROML)
J3: Open (GAME)
J4: Closed (EXROM)
J5: Open (I/O 2)

C64 Dead Test Cart Jumpers (Ultimax Mode)
J1: Open (ROMH)
J2: Closed (ROML)
J3: Closed (GAME)
J4: Open (EXROM)
J5: Closed (I/O 2)

Raspberry Pi And A Personal Weather Station

Ambient Weather WS-1090 and Raspberry PiI’ve had the Ambient Weather WS-1090 personal weather station for about a year and it’s worked well. It has a base station receiver that wirelessly receives the data from the sensors outside. The unit stores about 5 days worth of data but goes no further. It would be nice to be able to archive this data and also have real time data accessible from outside the home. It has a USB port and includes software but I’m not keen on keeping a PC on 24/7 just for that mundane task.

Enter the Raspberry Pi, a $35 credit-card sized computer that runs a variant of Debian Linux with HDMI, USB and Ethernet ports built in. A quick search revealed that Peter Mount has done all of the hard work already in a part 1 and part 2 tutorial. The tutorials are excellent, well written and unlike most Linux projects I try, there were no errors. I used a 4GB SD card that I had laying around and began with the Raspbian “wheezy” image from 2012-08-16. I expanded the partition to fill the card and enabled SSH so I could do the work from another machine.

I’m now pushing data every 5 minutes to Weather Underground were it automatically builds historical graphs of the weather from the PWS. I still need to get a proper solar radiation shield for the temperature sensor as it tends to read much warmer on sunny days.

DIY Cynthcart for Commodore 64

I’ve wanted to create my own cartridges for the C64 for a while now. I have a few old Commodore cartridge games like Clowns and Kickman that would better serve me as, say, a diagnostic cartridge or Cynthcart. These boards are ASSY 326173-01 and seem to be common so you should be able to pick one up cheap.




The first hurdle was burning EPROMs. I took a chance on eBay and bought a TOP 853 universal programmer. It was shipped from China and arrived in about 3-4 weeks. I was struggling to get it working over USB on my Mac to Virtual Box to a Windows XP VM but I figured it out (hint: disable USB 2.0 (EHCI) Controller for the VM).

I erased the chips using a Pocket Purifier battery operated hand held UV light that I picked up from Amazon. It took anywhere between 30 minutes to 2 hours (most 1 hour) to completely erase the EPROMs. I’m using 27c256 (32 kilobyte) chips which are 28 pins. Cynthcart is an 8 kilobyte ROM so I copied the ROM four times on the chip– only one of the copies will be used. You could add four different 8k ROMs and select one with dip switches on the higher address lines (A13 and A14 I believe).

The C64 cartridges I’m going to use have 24 pin chips on them. This presents a problem. Luckily the pinout is almost the same that it’s rather easy to reroute the pins. I followed the C64 ROM guide on Symlink.dk which had the pinout from the board to the new socket.

24 to 28 pin EPROM

You’ll need to desolder the old chip at U1. I used a 28 pin socket, bent out pins 1, 2, 20, 23, 26, 27, 28 on the socket. I soldered in small wires (from an 80 pin IDE cable) into the board on pins 18, 21, 24. See the schematic above to know which pins connect to which wires. Pay attention to the pin numbering– it will get confusing with the socket on top with different pin numbers. Also, make sure you orient the socket and the chip in the right direction. Pin numbers start upper left of the chip notch, down to bottom left, then to bottom right, then up to upper right.

There are 5 “jumpers” (solder bridge pads) on the board. This forum post on Lemon 64 was a great help but turned out not to work for me 100%. I opened J2, J5 and closed J1, J3, J4. The EPROM is too tall for the case to close completely but the screw will hold it together enough.

There you have it. This should work for any 8 kilobyte game that maps to $8000. Best part is since you’ve used a socket, the software can be easily swapped with something else. Enjoy!

Code for DIY NES Game Pad to Arduino to iPad Adapter

As promised, here’s the code to connect your NES game pad to an Arduino via USB to an iPad emulating an iCade controller (whew!).

// NES to USB iCade emulation to iPad
// Paul Rickards
// rickards@gmail.com
// January 15, 2012
// Tested with Arduino 1.0 IDE
// Add V-USB for Arduino to your Libraries folder
// http://code.google.com/p/vusb-for-arduino/
//
// Changes I made to the library (usbconfig.h):
// * changed USB_CFG_DMINUS_BIT to 3
// * commented out defintions of USB_CFG_PULLUP_IOPORTNAME and USB_CFG_PULLUP_BIT
//
// Arduino pin 2 = USB+
// Arduino pin 3 = USB-
// Don't forget the small circuit (3 resistors and 2 diodes) needed to connect
// USB to the Arduino. See the library for more info.
//
// Other controllers are possible. I first designed it for use with an Atari/C64 joystick
// The pins needed to be debounced (the bounce.h library will not work with the V-USB stack)
// and I needed more buttons on the joystick so I scrapped the idea.

#include "UsbKeyboard.h"

// Define NES pins
int latch=8;
int clock=9;
int datin=10;

bool t = 1, prev_nes[8] = { 1,1,1,1,1,1,1,1 };

// iCade key mapping http://www.ionaudio.com/downloads/iCade_Dev_Resource_v1.3.pdf
// NES controller mapping      A      B    select start   up    down   left   right
const int key_press[8]   = { KEY_O, KEY_L, KEY_Y, KEY_H, KEY_W, KEY_X, KEY_A, KEY_D };
const int key_release[8] = { KEY_G, KEY_V, KEY_T, KEY_R, KEY_E, KEY_Z, KEY_Q, KEY_C };

void setup() {
  // Setup NES controller
  pinMode(latch,OUTPUT);
  pinMode(clock,OUTPUT);
  pinMode(datin,INPUT);
  digitalWrite(latch,HIGH);
  digitalWrite(clock,HIGH);
}

void loop() {
  UsbKeyboard.update();

  digitalWrite(latch,LOW);
  digitalWrite(clock,LOW);
  digitalWrite(latch,HIGH);
  delayMicroseconds(2);
  digitalWrite(latch,LOW);

  for (int i=0; i<8; i++) {
    t = digitalRead(datin);
    if (prev_nes[i] != t) { // button changed
      if (t) UsbKeyboard.sendKeyStroke(key_release[i]);
      else   UsbKeyboard.sendKeyStroke(key_press[i]);
      prev_nes[i] = t;
    }
    digitalWrite(clock,LOW);
    delayMicroseconds(2);
    digitalWrite(clock,HIGH);
    delayMicroseconds(2);
  } 
}

DIY NES Gamepad to iPad Adapter

In my last post, I showed that I could use my homebrew C64 USB keyboard with the iPad using the Camera Connection Kit. What was interesting was when I opened iMAME (you were lucky enough to snag it, right?) and accidentally pressed keys on the keyboard. iMAME said it was enabling iCade mode. I thought this was interesting and looked it up.

iCade connects via Bluetooth and acts as a Bluetooth keyboard. My keyboard was connected via USB. Could a USB keyboard work to control games on the iPad? Maybe the connection type didn’t matter? Could I create an adapter that connects via USB and lets you use standard game controllers in iMAME?

iCade sends key strokes when a button is pressed and once again when it’s released. The keys are documented for developers. I launched iMAME again with the USB keyboard plugged in to confirm and as expected the keys worked to control the games.

The next part was pretty straight forward. Make a USB keyboard with an Arduino (see previous post on how this was done) but instead of an actual keyboard matrix, use a game pad. I chose to use my trusty original NES game pad since they’re so easy to interface with.




I threw together a quick case from LEGO and hot glued in two jacks, one for the NES controller and one for USB. The iPad powers the Arduino and the NES controller so no power supply is needed.

And there you have it, a DIY NES Gamepad to iPad via USB adapter. I’ll post the code later when it’s been cleaned up a bit. The only other game I’ve tested was Atari’s Greatest Hits and it seemed to work fine. In theory, any game that supports the iCade should work.

C64 USB Keyboard works with iPad


Just a follow up to the C64 USB keyboard Arduino project that I made last week. I was curious if it would work on the iPad using the iPad Camera Connection kit. So I tried it out and was greeted with the error “Cannot Use Device” and “The connected USB device is not supported.” I dismissed the window and tried anyway and it worked! I was able to type in any application.

Any application that is except the Manomio C64 emulator on the iPad/iPhone. I doubt that any USB keyboard would work there, not just mine. Maybe support for USB keyboards could be added?