Link to editorial & letters    Link to files
Previous disk program notes    Next disk program notes


Title SCREEN$

Disk 7 program notes


                     **** PROGRAM NOTES ****                    
                                                                
STIPPLES by Simon N Goodwin (ex-CRASH)                          
                                                                
This demo includes three new commands, implemented as SAM BASIC 
PROCedures -INKS, PENS and PAPERS. The names are plural because 
each lets you set a PAIR of colours that will be used by PLOT,  
DRAW, CIRCLE, PRINT, LIST and other display commands. You get up
to 256 'stippled' colours, with a resolution of 128 x 192, from 
a MODE 4 screen.                                                
                                                                
The demo starts by showing the '127 colour per-line' screen from
SAM Supplement 2 - except this time it is generated entirely    
from BASIC. It turns out that screen needs only the usual set of
16 colours - adjacent PAIRS of pixels blur to give the effect   
of extra colours, most convincingly!                            
                                                                
The rest of the demo explains the new commands and facilities.  
                                                                
                                                                
Stipples are used on other computers to get the appearance of   
extra colours with existing modes. The QL has just 8 basic      
colours, but 256 useful stipples: four patterns of two from     
eight, using diagonal, dotted, horizontal or SAM pyjama-style   
vertical stripes. You can distinguish individual dots on a      
stippled line if you use a monitor, but the effect is still     
very convincing when you look at the whole screen.              
ST and even Amiga artists often use stipples to show more than  
16 colours on one screen, or to fade between solid colours      
without using up PALETTE positions. SAM BASIC offers PALETTE    
LINE to add new colours on successive lines, but stipples       
are often useful when varying colours across the screen. The    
animated fan at the end of the STIPPLES demo appears to use     
far more than the standard colour palette.                      
Other stipple patterns can be used to FILL areas on SAM, as you 
can define a multi-coloured 'wallpaper' as well as solid FILL   
colours. The stipple routines introduced and demonstrated here  
are most useful because they work with PRINT, DRAW and other    
BASIC routines, at the full speed of solid colours.             
                                                                
EMPTIER by Simon N Goodwin                                      
                                                                
This little program uses DOS 2.0 (or earlier, I expect) to clear
the entire 80 file directory about five times as fast as you can
with ERASE "D1:*" ! It works by re-formatting (and checking) the
20K used for the disk directory. Later sectors are released for 
use, freeing the entire 780K capacity in a couple of seconds.   
                                                                
This utility does not change the number of tracks set for either
drive, so it should suit 40 track and single-sided drives. The  
directory size is fixed at 80 files, standard for SAMDOS 1 & 2. 
                                                                
Don't try this with Masterdos. It won't work (you get 0K free!) 
and anyway ERASE "D1:*" works at a sensible speed so you do not 
need to resort to trickery to empty a disk.                     
________________________________________________________________
                                                                
                                                                
                                                                
                                                                
From:                            Sam Coupe 512k                 
     Ian D Spencer                                              
     Fichtenweg 10c                                             
     5203 Much                                                  
     West Germany                                               
                                                                
                                                                
Dear Brian and Dave,                                            
                                                                
     I  have  been using  my IBM compatible PC  and  WORD  5  to
write letter and then have been reading the IBM diskettes into  
Sam and printing  the  letters  with  Wordmaster  running  under
Specmaker. I am now sending you this suite of programs for the  
Sam Supplement.                                                 
                                                                
    The suite  consists of 3 programs,  the first allows reading
of IBM  Double Density  diskettes and  copying of  files to  Sam
diskettes  as code files or Specmaker  files.The second can then
read this code  file as a  'Basic' program.  This allows you  to
write Sam  Basic  programs  on  an  IBM PC  with  an  editor  or
wordprocessor of  your choice and  then read them  into your Sam
as  a basic program  for saving to  diskette in the  normal way.
The  third program can print any  code file you have transferred
from an   IBM PC to  the  display  or printer of   your Sam. The
instructions for the  3 programs follow and I wish all those who
have  access to  an  IBM  PC lots  of  fun  with this  suite  of
programs.                                                       
                                                                
PCLOAD                                                          
------                                                          
                                                                
'PCLOAD' is  a program  to  read IBM  compatible disks  on  your
SAM-COUPE,  they  must be  3.5 inch  disks  and formated  in the
Double Density  format that  is 720KB.  If your  IBM has  a High
Density  3.5 inch drive  (1.4MB) then you can  still format your
'2DD' disks to Double Density by using the command :-           
                                                                
              FORMAT /T:80/N:9                                  
                                                                
                                                                
This formats with  80 tracks/side  and 9  sectors/track. If  you
want to  format 'HD' diskettes to  'DD' then you  must cover the
'HD' hole on the diskette before formating.                     
                                                                
Run the PCLOAD  program and when  asked insert your  PC diskette
into the  selected drive. The  'ROOT' directory of  your PC disk
will be displayed withe Disk Name at the top of the listing.    
You are then asked  to select a directory or file, which you can
do  by simply typing it's  name. It's not  necessary to type the
full name,  for example,  if  the file  or directory  is  called
'ITSMINE' then typing 'IT'  or simply 'I' will select  the first
file or directory beginning with these  letters. Upper and Lower
case are treated as the same characters.                        
If you  select a  directory then  it will  be  displayed on  the
screen.                                                         
You  can then select  a further directory  or file  from the new
listing.  Typing  '..'   takes  you  back   one  level  in   the
directories.                                                    
If  you select a File then  you will be asked 'Transparent Mode'
yes or no.                                                      
In Transparent mode the complete file will be transferred to the
Sam, you can  select an offset (normally 0). This  is usefull if
for example, you know that the first 19 bytes contain no usefull
information then an offset of 20 will begin copying from byte 20
of the file.                                                    
In Text mode only printable characters and  carriage return will
be copied.  This is usefull  for transfering fles from  some 'PC
Word Processors', any control characters will be suppressed.    
You are  asked for a  start string, if  you know that  the first
sentence of your file begins 'This  is a test' then typing 'This
is a test'  will cause the file to  be transferred starting with
this text and everything before this text will not be copied.   
Simply typing return instead of entering text will copy the file
from  the first  printable character.  This mode  is much slower
than the transparent mode but nevertheless very usefull.        
After loading you will be  asked whether you want a  'Specmaker'
compatible file,  if you answer 'yes',  then the file will  be a
'Specmaker  %' file and can be loaded into the Specmaker Ramdisk
and then used by such programs as 'Wordmaster' in Spectrum mode.
If you answer 'no' then  a normal Sam CODE file will be created.
PCKEYIN                                                         
-------                                                         
                                                                
'PCKEYIN' is for use in conjunction with 'PCLOAD'.              
It allows you to write  Sam-Basic programs on an IBM PC and then
transfer them to the Sam-Coupe.                                 
                                                                
First write  your Basic  program on  an IBM  PC using  whichever
Editor  or Wordprocessor you prefer. Use  the standard format of
Line  number  follwed by  your  basic  program  statement.  Then
transfer the  file  to the  Sam-Coupe  using 'PCLOAD',  you  can
experiment  with transparent  mode  and text  mode, though  both
will probably work one may be  preferable to the other depending
on your PC Word processing program.                             
                                                                
You should now  have a 'CODE'  file on  your Sam diskette  which
starts at address 100000.                                       
                                                                
Load 'PCKEYIN' and enter the name of your Basic text file.      
'PCKEYIN' will  load the  file and  begin converting  it into  a
standard Sam  Basic Form.  If  a syntax  error occurs  then  the
failed line will be  displayed and you can reenter  the complete
line  again  in the  correct  form  or  by simply  pressing  the
'RETURN' key delete the line from your program.                 
                                                                
After converting your program ( try it with the 'pcdemo' program
on this  diskette)  'PCKEYIN' will  automatically delete  itself
from the memory and stop. You can now run  your Basic program or
save it to diskette in the normal way.                          
                                                                
'PCKEYIN' uses line numbers  above 60000 so these should  not be
used by  your program. If you  must use these  line numbers then
renumber 'PCKEYIN' to a safe area before using it.              
                                                                
PCPRINT                                                         
-------                                                         
                                                                
'PCPRINT' is a program to print out on your screen/printer   the
text parts of any code file you have  transferred from an IBM PC
using 'PCLOAD'.                                                 
First write   your file on   a PC  word-processor or   select an
existing PC text  file and transfer  it to your  Sam-Coupe using
'PCLOAD'. You can use either transparent or text mode  'PCPRINT'
will work  correctly  with  both types  of  transfer.  Now  load
'PCPRINT' and select 'hard copy' with 'y' if you  require it and
type in  the name of the file you want to  print (try 'pcdemo').
Typing  a '$'  causes a  directory  of your  Sam diskette  to be
displayed.                                                      
                                                                
'PCPRINT' will automatically  load your  file and print out  any
parts which contain printable characters.                       
                                                                
* THIS  PC SUITE OF PROGRAMS  ARE FOR PERSONAL USE  ONLY AND MAY
NOT OFFERRED FOR SALE WITHOUT THE PERMISSION OF THE AUTHOR *    
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
Samscratch ver 2.3 by Simon N. Goodwin                          
                                                                
This was  typed into my modified  version of  SAM SCRATCH, which
accepts characters  several times faster than the ones published
so far.  I have  have  to alter  the keybeep  sound to  use  the
SA-1099 instead  of the BEEP output  - you can set  the pitch of
the click by altering the last number on the SOUND set-up line. 
                                                                
The  menus  and  facilities  of   SAM  SCRATCH  are  essentially
unchanged from version 2.0, but dozens of small tweaks mean that
version 2.3 is much faster in use.                              
                                                                
Character  input  now takes  advantage  of  the eight  character
type-ahead buffer in  the ROM  - the earlier  code used  INKEY$,
which was the obvious thing to do, but unfortunately clears  the
keyboard buffer whenever it is called (like GET).               
                                                                
A few of the ZAPs and suchlike effects make it even  more likely
that keys  will be missed, as they  use the Spectrum BEEP output
and therefore run with interrupts disabled. The SA-1099 can make
noises  while  the Z80-B  gets on  with other  things  (like the
keyboard-reading routine,  executed every  20 milliseconds  when
interrupts  are enabled). I have left the original sound effects
whenever  they  do  not  interfere with  the  operation  of  the
program, so it still sounds fun to use!                         
                                                                
The new  keyboard polling routine  is so fast and  reliable that
characters  are not  lost  even  when word-wrap  is most  busy -
there's a short delay while Darren & Andy's code thinks, but the
ROM  carries  on  reading characters  in  the  meantime, and  my
modification  ensures that they  appear as soon as  the BASIC is
ready. The buffer size is fixed at eight characters, so problems
may still arise if  you try to word-wrap long German  words, but
you have to be unlucky, even then!                              
                                                                
Incidentally version 2.3 is the first that  accepts the standard
accents  and  non-UK  characters supplied  on  the  Coup‚ master
disk or  tape. If   you load these characters before Sam Scratch
2.3 they should display and print correctly on any PC-compatible
printer - which means most made in the last 7 years or so.      
I have  also accelerated line  insertion and deletion  by moving
the array contents  en masse rather  than a line  at a time,  or
avoiding the  need to  move empty lines.  I have added a way  to
SPLIT lines, and managed to speed up the word counter a lot!    
                                                                
The split line option uses F6 on Menu 2 so F5 can now justify OR
unjustify a  line, depending  on its  current state. Spaces  are
added  randomly  to  pad  out  lines,  so  you  can  change  the
distribution of space if you like by pressing F5 repeatedly.    
                                                                
Small  changes  increase  the  speed  of  paging  and  character
insertion or deletion - particularly near the end of lines.  The
routine used to  find the end of the file has been accelerated a
little, but  it  is still  rather  slow on  short  files, as  it
searches backwards from the 320th line to find the last in use. 
                                                                
Some of the new routines move the entire  file in memory, rather
than waste  time finding the end. This means that more temporary
memory is used up, but it makes changes much faster.            
                                                                
The SAVE  and LOAD options  are faster and  let you put  a drive
number (D1: to D7: at  present) in front of  the file name. CODE
files are now  loaded and saved  directly into the array,  using
LENGTH(0 to  find  the base  address.  This  is fast  but  means
that CODE files of more than 320 64 byte lines could corrupt the
variables area. If this is a problem you could increase MAXLINES
or use  the alternative code which loads  to an arbitrary buffer
and transfers the text with MEM$, at intermediate speed.        
                                                                
The underlying structure of the program has NOT been  changed. I
have left the old routines in REMs, for reference, and  kept the
original  line numbers and  routine names.  This should  make it
easy to mix my alterations with improvements and extra  features
added in other versions of SAM Scratch.                         
                                                                
Congratulations  to   Dave and   Darren  for  packing   so  much
functionality into  a small SAM  BASIC program.  I have  enjoyed
editing it  and hope you like the changes I  have made - they do
not alter the  operation of the program, but they make it  a lot
faster, without losing the other features.                      
SECTOR EDIT by K.Montgomery                                     
                                                                
This progam will allow the user to read in a sector of  a  disc,
display it on screen, and if required, alter it.                
It is very straight forward to use, with most  of  the  relevant
information on the work screen.                                 
After any alterations, the sector may be saved back to the disc.
                                                                
ALL CHANGE by W.Mcgrugan                                        
                                                                
This type of puzzle game is one of my favourite types. It  looks
deceptively easy, yet in actual fact is quite hard.             
The idea of the game is to exchange 2  sets  of  counters  by   
moving 1 counter at a time into the vacant square.              
Full instructions are given within the game.                    
                                                                
________________________________________________________________
                                                                
                                                                
                                                                
CLIPART anon                                                    
                                                                
Another screen full of bits and pieces to help you liven up your
programs.                                                       
This issues graphics all depict  dinosaurs,  with  2  stages  of
animation for each one.                                         
________________________________________________________________
                                                                
PALETTE LESSON by Dave & Brian                                  
                                                                
Once again the dynamic duo try to explain a new BASIC command.  
This issue we are dealing with the PALETTE command, and  how  to
tell the Sam which of it's 128 colours you want it to use.      
________________________________________________________________
                                                                
SAM TUNE by M.Collinge                                          
                                                                
A multi-channel tune, programmed in BASIC so that  you  can  see
how it's done. Each note has been given a seperate line, so that
you can see what each one does.                                 
REALWRITE by G.Bobker                                           
                                                                
This program takes the  form  of  a  series  of  tips  on  using
alternative characters sets in the Sam. The set supplied  by  Mr
Bobker for demo purposes, is a rather nice "double writing" set,
which he makes good use of during his explaination.             
________________________________________________________________
                                                                
SLIDESHOW                                                       
                                                                
As a change from all the  usual  ST/Amiga  screens,  this  issue
includes some screens that were drawn by our own members.       
I think it's so must nicer to see original work rather than  the
endless "ripped off" stuff. Keep sending your screens in.       
________________________________________________________________
                                                                
OVER TABLE by K.Montgomery                                      
                                                                
A very useful program that list out the  colours  that  you  get
when using the various OVER commands.                           
COLOUR PROC by D.Hall                                           
A small PROCedure to  use  in  your  own  programs  which  makes
changing the colours simplicity itself.  The  program  has  full
instructions on use, and some demos to let you see what's  going
on.                                                             
________________________________________________________________
                                                                
ALF THE APPLE EATER                                             
                                                                
A nice little game that will test your reactions to the limit.  
It's nice to see the Sam's MODE 4 graphics used,  and  good  use
has been made of the extra commands that the Sam  has  over  the
Spectrum.                                                       
Full instructions are given within the program.                 
________________________________________________________________
                                                                
COLOUR MIXER                                                    
An unusual program, which lets you "mix" colours  to  get  other
colours. Very easy to use, and a nice screen layout.            
..                                                              

Link to the top of this document    Link to the main index
Link to editorial & letters    Link to files
Previous disk program notes    Next disk program notes