Introduction Meetings Members Magazine Articles Programs

SQLUG

SCOTTISH QL USERS GROUP

Cptr The C68 Pointer Environment Interface

By JOHN SADLER

Introduction

CPTR is a suite of programs and routines developed by George Gwilt to make writing C Programs for the pointer environment easier.

It main advantage is that it use the pointer environment routines and so operates in the same way as Assembler programs written for the pointer envronment.

Hence a proper window definition is created and no duplicate functions are requred. Smooth resizing of windows is available.

The TPTR (Turbo Compiler Pointer suite of programs) are needed to create the window definitions. SETF is a program for creating a set of windows and saving them to wda file. ALTER is a program for altering the wda file to make minor corrections rather than go through the SETF procedures.
Sprites are produced in a simple text file. Sprites can be chained together with CHSPR to produce animated sprites.
SEEWIN1 enables one to view a wda file which is in ram1_.
All these tools enable one to produce the windows and sprites for a pointer environment.

So what use is this for C68 programmer. CPTR suite enables the programmer to create a proper window definition header file. It provides him with the routines open close, put to sleep these windows. It enables him to resize windows smoothly. It also enables him to write pointer programs for mode 4 and mode 8 with any QL colour system

Technique

  1. The windows have to be planned .
  2. The correct window wda file is made with SETF etc.
  3. The wda file is converted to transition for with a suffix z using a program WintoC (written with TPTR).
    Setz now combines setf and wintoc.
  4. This z file is converted into a program window definition file withALIGN="center" a C program spr which calculates the actual pointers for the window definitions from the relative pointers and writes the header file.
  5. The C program uses getsze_o to calculate the actual pointers before reserving ram for storing the window definitions used by the program.

At the current state of development the suite uses a modified version of litem_c for handling loose items and a C file sleep_c to send the program to sleep in a button.

Sample Program

To give you a taste of what can be done here is hello_z the Z file for a program to create the ubiquitous hello world program and a

Introduction Meetings Members Magazine Articles Programs