1 “CBM DirArt Basics/Conceptual Stuff” PRG

Commodore computers, use the PETSCII character font and encoding. If you have to store files, it goes to either TAPE or DISK. To find out what’s on a DISK on a stock C64/1541 we enter this command from BASIC: LOAD”$”,8 and Type “List” when it finishes loading and the disks’ contents in drive 8 is displayed.

Directory listings are usually pretty boring in most computing environments, you can pretty up output of shell commands like ls in the Unix variants, but as it goes the commodore computer/disk drive family has the best-looking directories around. Below are some great examples:


1541 Test Demo Disk (pretty vanilla directory)

About a 1541 Disk and its Files:

Tracks: 35
Sectors/Track: 17 to 21 (Depends Sector)
Directory Track: 18
Bytes/Block: 256
Total Blocks: 683
Free Blocks: 644 (Directory is the rest)
Max# of Files: 144
Filename Length: 16 (<16 chars it’s padded with $a0/shifted space’s)
Filename Illegal Chars:

File Types:
SEQ – sequential file
USR – user file
PRG – program
REL – relative file
DEL – deleted file

The first disk you get is usually like the one above, the 1541 Test/Demo disk. If you bought a game or software the directory was just a listing of actual files. Most video games either were one file on a disk, which often didn’t need to have its directory read as the floppy disk label often read LOAD”*”,8,1 to start the game.

Later on, we started seeing directories have disk headers that broke the normal header rules. When you name diskette through the NEW/Format command, You can name it 16 characters name plus 2 characters for the ID. There is also another ID (often) “2A” which represents the DOS version of the format/disk. The 1541 Test/Demo disk is as standard as disk directories come. If we look at the image below, the Triad release of “TERMINAL FIGHTER”, you’ll see that the Disk ID is a 5 character ID.

A Triad release viewed in Vice Emu

Standard PETSCII Directory Style

When I say Standard, I don’t mean the 1541 Test/Demo Disk. The example images at the beginning (and the Triad release above) are Standard PETSCII Directories. They look great and can have the following components:

  • Custom DEL file type dividers
  • 0 block files
  • PETSCII GFX
  • Illegal Disk ID’s
  • false Block counts
  • uses the c64 Blue/Lt Blue colours or the Black/Green of the PET
  • less than 144 file entries
  • Standard PETSCII is limited to a subset of PETSCII characters -> Standard PETSCII charset (Limited set)

On the topic of Standard PETSCII Directory character set, it’s limited to the BASIC interpreters’ single character glyph. (Takes a deep breath) So for the UI of Basic, it has to represent control codes etc inside of the editor. The PETSCII font has 256 characters (and another for lowercase), but Editor takes some of these and uses others as control codes. If you need to wrap your head around why this is a limitation, whatever you can directly input in BASIC with a single keystroke, or is represented by a control character in Print statement is fair game to use. If you have to use a two-stroke combo (outside of a print statement) then you can’t use it — think (TURN RVS ON -SPACE) to make a solid block. You can break this limitation by using Control Codes, but it will break the directory style (each code requires some setup and eats a character.. see the next section) Below is a visual representation of what is possible, plus a version that helps see what you get left with.

DirMaster’s PETSCII Palette (what you can use)
Petmate Character Palette (The entire UPPER case font arranged for drawing)
What you loose..

The RVS ON side of the font takes a ~40% hit, but the loss of the Fill Blocks and the South East Triangle block really make it hurt. The #, % and the 2/3 the dither blocks also make certain styles difficult. It really makes one appreciate the examples at the start of this article, for making it work with what you have left.

Control Character / Enhanced Directory Style

  • Uses BASIC line editor mode, to inject control codes into the filename (CLR/HOME/SHIFTDEL/CURSORING etc)
  • Will often break the listing style of a standard directory
  • Usually, it is some kind of animation
  • One filename does not always equal one line, combinations of control codes and sequence can make the text on the screen longer than the 16 character limit
  • Triggering a specially crafted line of BASIC.

The directories are PETSCII Screen Editor modified. They can still look close to the standard, but filenames have extra codes in them to do some dramatic changes. Every code addition removes one character from the file name. With some smarty smarty, you can clear the screen, position and colour change the cursor. You can chain filenames with control characters to create animations and inject basic commands.

The Screen Editor

The C64, when booted into BASIC is running in Screen Editor Mode. Any key combination you can do in BASIC (directly with keyboard) or a print statement between the quotes can be used in a file name, well almost any.

This image has an empty alt attribute; its file name is image-28.png

This image has an empty alt attribute; its file name is image-29.png

As you can see above, the print command moved the cursor to HOME (upper left corner) changed its colour to LT RED, moved the cursor right 10 times and down 3 times. Below is the PETSCII screen editor codes, click on the image…

https://www.c64-wiki.com/wiki/control_character

Tools / Cross Development

Modern tools for a modern era, below is DirMaster: a D64 disk image editor/creator. It has a drag and drop UI (which is handy). When I program in a cross compiler on my modern computer and generate a PRG file, I can take it and drag onto a disk.. edit the names and make some pretty pictures.

DirMaster for Windows

So DirMaster is the standard these days for making and editing D64 disks (and other Virtual Disk formats). A .D64 is a virtual disk representing a 1541 disk. You can use an emulator like Vice and mount a D64 in an emulated Commodore computer. There are ways to write D64’s back to actual physical hardware (see ZoomFloppy and various mass storage Carts). So in reality (and virtually), you can start in either world and use tools from both. For standard PETSCII going with DirMaster is the first choice. If you are reading this and have another tool, drop me a line.

Making a Quick PETSCII Directory

  • I created a D64 disk in DirMaster (Using File > New > D64)
  • Then Edit the Name and ID of the Disk (Edit > Rename Disk) “TEST” and (Edit Disk ID) “WB ’20” (you will have to delete the ID text before you can overwrite it)
  • Turn ON the Separators dialogue, its Toolbar button on the right side of the Spade ICON, Select the square box top and drag it onto the disk, do the same for the middle and bottom. You can drag the files around to change the order.
  • I then dragged a PRG file over “FIREBALL-NECRO.PRG” from a windows file folder.
  • Save the file (File>Save)

That was pretty easy. You can turn on the PETSCII Character palette and do some real damage. The Spade icon in the toolbar should show that then Insert a new file (File > Insert) and then clicking on the PETSCII glyphs to add them to the file. Some times the highlighted file gets in the way visually.. so click on the corner of the disk title and it should turn off the selection.

Example Quick and Dirty Directory


Using Control Codes / Line Editor Mode

So I’ll show how to setup an simple Extended Directory, using control codes to clear the screen, change text colour and move the cursor around.

This image has an empty alt attribute; its file name is image-31.png
This image has an empty alt attribute; its file name is image-32.png

In DirMaster we can place any GFX character in the file name but if you put a reversed capital “E” you should get White. The directory listing needs to be tricked into editor mode, which can be done by first typing Reversed “M” or Reversed “\”.

Reversed “\”
This image has an empty alt attribute; its file name is image-34.png
DirMaster black and white colour code adjustment

This image has an empty alt attribute; its file name is image-35.png
VICE Emu shows the D64 results

We end up with a hard return, then the colour activates and the filename continues to the file type and then another return. This looks pretty ugly, so I’ll do some quick stuff to clean this up a bit.

Now, we are pretty far from a Standard Directory now. Each file name does the following (some do a little extra)

Editor Mode > Move up X2 > Set a colour > Turn on RVS Mode > 9 characters > Editor Mode > Set colour to the background (Blue)
Setting the foreground colour to the background means any text after the double quotes ex: ‘” PRG’ will melt into the background. If we set the background to black before listing, using POKE 53281,0 we see:

Because I made the text full spaces to the end a lot of the PRG text doesn’t show. If I make RED only “RED” not “RED +” you would see it bleed through.

When you are done editing the disk, you’ll probably have deleted files etc in the process of making it. If you Press the DEL button in the toolbar you’ll see all the deleted files. To get rid of them, go (File > More > Compact) will clean out those unwanted files.

You can get the example directory here:

If you are thinking, how do I get a full page PETSCII in there, it’s possible but requires a little smarty smarty…

Links

PETSCII Info
Standard PETSCII charset (Limited set)
1st CSDb Dir Art Compo
PETSCII WORLD
DirMaster
DirMaster Docs

Notes / Thanks

You really can’t do this alone, so I’d like to thank everyone who keeps an eye on me (including my partner). There are a few people over at PETSCII WORLD and in the scene that have helped out with typos and maybe add x to make y better. Thanks, Johan Nordström for the chats and technical debate (while watching Mibric64‘s twitch live stream) and also Jaakko Luoto for the Standard PETSCII font subset suggestion. For Andy and Benny running the PETSCII WORLD FB Group and my teammates at Triad, who got my blood pumping again 🙂

Changelog

  • Typos / wording
  • Added the Font Subset section
  • Fixed the Extended PETSCII pictures they had an extra entry 🙂
  • Cleaned up the D64 example disk (extra entry and DEL files)
  • added a note about cleaning up DELETED files from the disk in DirMaster
  • added DirMaster Links
  • The file name is 16 character max, not 17. (thanks for the catch Ken Nielsen) — getting old

2 Comments

  1. Pingback: Dirart: katalogi dyskietek jako dzieło sztuki – tylko w rodzinie Commodore'a | PIXELPOST

Leave a Reply

Your email address will not be published. Required fields are marked *