Thursday, 2 July 2015

pet microSD user guide

Here are some general instructions for using the pet microSD. To start with you need a pet microSD, a Commodore Pet IEEE-488 drive replacement which uses a microSD card.
This plugs into the back of a Commdore Pet 2001 / 30xx / 40xx / 80xx, power is supplied by clips or a datasette power connector, or see fitting instructions for 80xx-SK models.
With that, you need a standard microSD card. Nothing particularly special, I now supply the pet microSD with a 2GB microSD card with some software on. The microSD card should be formatted FAT or FAT32. If the card has been used elsewhere first, and the best option is to use the proper SD card format utility. Then copy on any .prg or .d64 files you want to use.
There are various ways to access the disk drive, some of which depend on the version of BASIC installed in your Pet. If you have an original 2001 series pets with BASIC 1, I'm afraid that doesn't support IEEE-488 disk drives.
You could upgrade it to the BASIC 2 'NEW ROMS' using one of my 6502 ROM/RAM boards (which could also be used to give you an upgrade to 32K RAM as well).
All other Pets can use the standard disk commands, similar to those used on the Commodore 64. These are variations on the LOAD and SAVE commands used for tape, but with ,8 on the end to specify the drive - the default address of the pet microSD is 8, as with most Commodore disk drives.
  • LOAD "test",8
  • LOAD "$",8
  • LOAD "*",8
  • LOAD "inv*",8
  • SAVE "hello",8
"*" refers to the first file on the disk, this can be useful for loaders or menus. Wildcards can also be used, so use "inv*" would save typing "invaders" if that was the first match for the pattern. The standard Commodore BASIC 2 file listing command is via LOAD "$",8
Note these screenshots are from the VICE Pet emulator, and the files are shown with extensions hidden. This option is not enabled by default on the pet microSD, so that will show "MAZE.PRG" rather than "MAZE".  See later for instructions on changing this.
40xx and 80xx series Pets have BASIC 4, which alongside the existing BASIC 2 commands, also introduced some new commands:
  • DLOAD "filename"
  • DSAVE "filename"
You do not add ,8 on the end of these commands, you can also miss off the closing quotes if you're feeling lazy. With BASIC 4, you can also load and run the first program on the disk by pressing SHIFT and RUN/STOP. On earlier BASICs, this loads from the cassette. DIRECTORY now also displays the listing without needing to do a load and list, and does not affect the current program.
Further commands are given to the pet microSD via the standard Commodore command mechanism, although this can be a bit longwinded. The format is
  • OPEN 1,8,15,"command" : CLOSE 1
The fill list of commands can be found in the NODISKEMU readme. The main use here being to change directory or load a disk image using the CD command.
To change directories on the microSD card use
  • OPEN 1,8,15,"CD/games" : CLOSE 1
To open a d64 disk image, use
  • OPEN 1,8,15,"CD:image.d64" : CLOSE 1
To close the disk image, or go back to the parent directory, use
  • OPEN 1,8,15,"CD" : CLOSE 1
That can be a bit tedious to type, so I use Nils Eilers DOS Wedge to make things easier. I normally place this as the first program on the microSD card, so it can be loaded quickly, with LOAD"*",8 and RUN on BASIC 2.
And on BASIC 4 machines, you just need to press SHIFT and RUN/STOP to load and run it.
Once that is loaded, you can do things like
  • @  - get status
  • @$ - get directory listing
  • @command - run a command
  • @cd/directory - change directory
  • @cd:image.d64 - load a D64 image
  • @cd← - return to parent directory / close disk image
  • /filename - load a program
  • ↑filename - load and run a program
  • # - show the current device number being accessed (default is 8)
  • #9 - change the device number being accessed (8-11) 
This means there is a lot less to type, @$ shows a directory, as with the BASIC 4 DIRECTORY, this does not affect the currently loaded program.
You can load with just /filename. Wildcards can be used, so /inv* could load invaders etc.
You can also skip the extra step and load and run in a single command with ↑filename
Where you save most typing is with commands, so the image loading is now just @cd:diskimage.d64, so for example just @cd:adv.d64 .d80 and .d82 file are also supported.
Once the disk image is loaded, you can then run the appropriate program, SHIFT+RUN/STOP or ↑* will load the first file on the disk, or use ↑filename to load a file. In this example, ADV.D64 is a disk image containing Colossal Cave adventure, a (possibly incomplete) port for the pet. To start this, use ↑svntr
This is soon to be replaced by a version in development by Bill Bright which is a fuller version and has support for 40 and 80 columns Pets. Update: see more info on this text adventure.
To close the image and go back to the previous directory, use @cd←  As mentioned earlier, the .prg extensions can be hidden using an option. Without the dos wedge, the command you need is
  • OPEN 1,8,15,"XE+" : CLOSE 1
With the dos wedge, this is just
  • @XE+
The device number of the PET microSD by default is 8. This can be changed by using the U0 command, so for example to change to device number 9, use
  • OPEN 1,8,15,"U0>"+chr$(9) : CLOSE 1
When changing options like these, they will be lost when power is removed. To make them permanent, use "XW" to store these settings, e.g. in wedge type
  • @XE+
There are many other things you can do, this is just an introduction to the most used features. However, you could just put whatever game you want (e.g. Down from Revival Studios) as the first program on the microSD card and then SHIFT+RUN/STOP and you're straight into the game.
The new blue pet microSD with improved datasette power connectors will be available soon, but I still have a few of the original green board versions.

Various versions of the PET microSD are now available to suit various models of PET. More info on Which PETs support which PET microSD, and buy it now links.