Print and Copy IBM

Developer(s): John McMichael
Type: Program
Platform(s): TS 2068

A program to support printing on the Okimate 20 printer. It loads a picture and prints it on the Okimate 20 colour printer, and lets you colour the picture first. It works with standard screens and with the TS2068’s high-resolution colour mode, in which every pixel row of a character cell has its own attribute; such a picture is stored as two files, the pixel data and the attribute data.

You first choose a small or large copy and its position across the paper (left, centre, right or a set column), then load a standard SCREEN$ or the two parts of a high-resolution colour screen. On the picture a joystick moves a cursor and the fire button paints the cell under it in the current paper and ink colours. Keys select the paper (P) and ink (I) colours, fill the whole screen with them (A), switch between the standard and high-resolution attributes (V), copy the standard attributes into the high-resolution ones (T), print (Z, with the Okimate 20 already switched on) and quit (Q), after which the coloured picture can be saved.

The cassette is labelled “PAINT & COPY – IBM version” and “© John McMichael”.

Program Analysis

Structure

The tape holds the BASIC program ibmp&c-ba (auto-run at line 10) and 1,042 bytes of machine code, ibmp&c-mc, at 62000, both saved twice.

  • Line 10: CLEAR 61999, loads the code and runs its set-up routine.
  • Lines 20–250: names the machine code entry points as variables (strt, copy, clrh, clrl and the POKE addresses for position) and asks for the copy size and position.
  • Lines 270–450: the type of screen, the file names, the key and joystick help, and loading.
  • Lines 460–550: OUT 255,2 switches the display to high-resolution colour mode and RANDOMIZE USR strt runs the painting and printing code; afterwards the attribute data (24576) and pixel data (16384) can be saved.

Notable Techniques

  • Choosing small or large print POKEs the address of the matching print routine into the code at copy, and the position is POKEd straight into both routines.
  • High-resolution attribute data is loaded to and saved from 24576, the second display file that the TS2068 uses for the extra colour information.
  • Prompts are shown in the lower screen with INPUT #0;AT, and caps lock is set with POKE 23658,8 while single-letter answers are expected and cleared for file names.

Potential Issues

  • A negative number for the variable position is not rejected.

Image Gallery

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.