The following article was printed in January 1988 of the magazine „8000 PLUS".
(A correction followed in February)
A BASIC program for saving and loading the PCW screen

SCREENSAVE

by Lawrence Simons
Lawrence Simons' plot routine (printed in the August 1988 issue) created a great deal of interest, adding as it did a much needed plot command to BASIC. He has now completed the process by writing a program to save those wonderful screens you've all been busy creating to disc. By including these lines in your own BASIC programs you will add the facility to save and load screens within that program using CALL appropriately.
Once saved the screens can be loaded back in again from disc at any time. Since images can be extremely time consuming to generate in BASIC, being able to create them, save them and load them back in again when required will allow programs to do tricks with graphics previously impossible due to the time taken to draw screens. 'Help' screens and opening titles to a program are obvious applications.
The screensave program will run just as it is. It will ask it you want to Save or Load (S/L) a screen then prompt you tor a filename at the current cursor position and either save or load a screen as asked. If there is no file of that name then the load will fail so save one first.
The program is in three sections. The first part, from Line 10 to line 140 is merely a demonstration of how to use Screensave. It asks for a filename and whether you want to load or save a screen. The second part is from 54000 to 54140 and is the loader. The loader sets the top of memory to HBFFFH (this means that BASIC can't put anything at any higher address) and then reads the machine code routines into the protected part of memory. These routines don't clash with the plot routines previously written by Lawrence Simons and they can all exist together quite happily.

Exit picture stage right
The fourth part is the actual machine code routines to save and load the screen. In its present form all you can save is whatever happens to be on the screen when you invoke it. But like Lawrence Simons' earlier offerings you are intended to adapt this program to your own purposes.
How do you do that? The simplest way is to put anything you like between lines 50 and 60. For example, if you put the line 55 PRINT CHR$(27) + "E" + CHR$(27) + "H" then the screen would clear and the cursor homed before being saved. You will have a file 24k long with nothing but the cursor in it! If you'd called the file CLEAR.SCR then loading CLEAR.SCR again would overwrite everything on the screen leaving it blank (apart from the image of the original cursor and the proper flashing cursor).
Obviously the example is trivial but it shows one way to use the program for your own purposes. If you need to write a lot in between 50 and 60 then renumber the lines from 60 to 140 to give you extra room. Of course you can rewrite as much of the first section as you like just so long as you keep line 10 to set up the SCRNSAVE and SCRNLOAD routines in memory - and CALL the routines as demonstrated in line 120. The lines from 54000 onwards must be included in any program using the screen load and save routines.
No doubt there will soon be discs full of pictures doing the rounds all ready to be loaded in, worked on or simply admired. Send your best efforts to 8000 magazine for our delight and delectation.
Any program you write including these routines must include the lines from 54000 onwards.
[BASIC completed listing] and [assembler listing]

Addendum from January 1989:

Error terror
With each screen occupying 24k of disc space it's easy to make a mistake. Lawrence Simons has anticipated this and error messages are returned in E%. What you do then is up to you. No.
0
1
2
3
4
SCRNSAVE
success
bad filename
couldn't create file
disc write error
couldn't close file
SCRNLOAD
success
bad filename
couldn't open file
disc read error

Correction from February 1989

Screensaver
In last month's issue the very wonderful screensave listing was somewhat spoiled by the omission of lines 54400 through 54430. This was entirely the fault of the art department who thought the page looked better that way. Despite that here are the missing lines with apologies for any problems it might have caused (like acute anxiety)

HTML customization by Werner Cirsovius
December 2014
© 8000 PLUS