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


Title SCREEN$

Disk 15 program notes


SAMsheet by R. Lowe                                             
                                                                
The first version of a 3D spreadsheet for the SAM coupe.        
Full instructions can be obtained upon loading.                 
                                                                
S  - Save spreadsheet                                           
L  - Load a spreadsheet                                         
P  - Print spreadshet from cursor                               
Z  - Change z co-ordinate                                       
                                                                
f0 - Setup spreadsheet                                          
f1 - Replicate slot                                             
f2 - Display and re-calculate                                   
f3 - Zero format                                                
f4 - Change co-ordinates of cursor slot                         
                                                                
EDIT or . - Alter slot contents                                 
:   - Print contents as a message                               
!   - Print slot value to 2 decimal places                      
y,x - Take value from slot y,x                                  
ad  - Takes form x,yada,b - Add the contents                    
      of all slots between x,y and a,b                          
                                                                
It is possible to get a hard copy of the complete instructions  
by typing OPEN#2;"p" : LOAD"SHEET.INS". This will send all PRINT
commands to the printer.                                        
                                                                
________________________________________________________________
                                                                
ANIMATION EXPLAINED by D.Tonks                                  
                                                                
This issue, I've tried to explain the art of animation. I  can't
of course tell you how to be an artist, and draw the frames, but
only how to store and animate them. In fact you can  find  ready
done animation frames from various clip art or PD  discs,  which
solves the problem for you.                                     
The article takes you through how issue 14's title animation was
put together, and I've included the frames I've used so that you
can try for yourself.                                           
________________________________________________________________
GALLERY                                                         
                                                                
This month I've given you some background type screen$, on which
you may be able to animate small characters.  There  is  also  a
nice logo by Steve Monk, (I bet you can't work out who he  works
for).                                                           
________________________________________________________________
                                                                
MACHINE CODE by Geoff Bobker                                    
                                                                
Continuing his series of M/C lessons, Geoff,  this  issue, takes
paging in machine code a step further.                          
As always, the article can be printed out to use  with  the  Sam
and an assembler.                                               
________________________________________________________________
                                                                
LONEWOLF DATASHEET by Marc Broster                              
                                                                
This is a very unusual one especially for people who follow  the
Lonewolf series of books. These are the type where  you  make  a
decision and have to go to a certain  page,  depending  on  that
decision.                                                       
What this program does, is to print out a datasheet that can  be
used in conjunction with this to keep track of your actions etc.
                                                                
________________________________________________________________
                                                                
COMMFIX by Wayne Weedon                                         
                                                                
Simply insert the disc with your comms code on and this  program
will load it, cure the bugs that were in the original  code  and
re-save a new copy to your disc.                                
                                                                
If you own and use a comms interface, this will need to be  done
before you can use the comms software properly,  as  there  were
several bugs present in it.                                     
________________________________________________________________
                                                                
                                                                
                                                                
SCORELIN E by D.A.Lorner                                        
                                                                
A highly addictive little game, which like all good games, looks
easy, but isn't.                                                
A dice is rolled, and you can put the value of the dice into any
empty box on the grid.                                          
If you get a line of the same value, that line  is  cleared  for
use again. The trouble is that there are only  5  lines  on  the
grid, and 6 numbers on a dice.                                  
Further instructions are given within the program.              
________________________________________________________________
                                                                
SNOWFALL by Paul Skinner                                        
                                                                
A machine code routine that makes snow fall across  any  MODE  1
screen. The code is loaded in and a simple CALL will start it.  
Paul suggests that it could be modified to run in  MODE  4,  any
takers!!!                                                       
________________________________________________________________
                                                                
PATFILL by John McCabe                                          
                                                                
A full explanation and demo of how  FILL  USING  works,  as  the
manual is a bit vague on  the  subject.  Full  instructions  are
contained within the program, as well as the DEF PROC which  you
can use in you own programs. There  are  also  several  patterns
predefined and even an explanation on using random pattern  from
RAM.                                                            
________________________________________________________________
                                                                
ROUND BOX by John McCabe                                        
                                                                
If you run the PATFILL program, you will notice that the text is
contained within boxes with nicely rounded corners. This is  the
DEF PROC that gives you those boxes.                            
It works like CIRCLE, in as much as the 4 parameter are the  x,y
co-ordinates of the center of the box, D is half  the  depth  of
the box and W is half the width of the box.                     
E.G.                                                            
    RBOX 128,85,40,20                                           
would give you a box whose centre is at 128,85 and which was  80
pixels wide and 40 pixels deep.                                 
Very easy to use to make  your  text  output  just  a  bit  more
special.                                                        
________________________________________________________________
                                                                
OXO by M.D.Mackenzie                                            
                                                                
This game gives you the  option  of  either  playing  against  a
friend of the Sam.                                              
If you play against the Sam you are given the options of hard or
very hard, and even on the hard setting the  Sam  plays  a  mean
game.                                                           
Nice big graphics and good game play make this a good  afternoon
waster.                                                         
________________________________________________________________
                                                                
                                                                
                                                                
                                                                
POKES/CHEATS compiled by Bob Evans                              
                                                                
Anothe batch of pokes and cheats to make  your  playing  easier.
Also on this issue are all the passcodes for "TRILTEX"  by  Fred
magazine. These were worked out by Dave Pritchard,  and  can  be
found on the ODDS/ENDS menu.h                                   
________________________________________________________________
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
.                                                               
SAM SPRITE                                         20/10/91     
                                                                
                                                                
Peter Johns                                       071 987 2365  
27 Fairfoot Rd                                                  
Bow, London E3 4EG                                              
                                                                
                                                                
Sam  Sprite  is simply  a  mode  4  sprite designer,  however I 
decided to spend quite  some time on writing this program  in an
effort not only  to produce a fairly decent  sprite designer but
also  to learn  the  ins and  outs  of the  SAM  itself, this  I
consider is the best  way to learn about  the SAM and I have  to
say that apart from  a few small ommissions in  the Tech Manual,
the SAM is quite  an  exceptional  computer.  Anyway  I  mustn't
ramble  on  since  there's  rather  a  lot  to  get  through  in
explaining how to use SAM SPRITE, so here we go.                
                                                                
                                                                
                                                                
           The designer is an  icon-driven,  drop  down  windows
razz-a-matazz program, it has the ability to store  255  sprites
in memory although this depends on the size of your sprites  and
the memory available. The grid can be adjusted in size for  each
sprite from 2 pixels wide by 1 pixel deep up to 60*60 pixels.   
                                                                
         There is a  menu bar across  the top of the  screen and
simply by using the cursor keys to point the  arrow at an option
and pressing the space bar to select you can bring  in to play a
fairly complex set of options.                                  
                                                                
        By pressing space bar and cursors you can move a pointer
over the grid filling in the squares, pressing  Symbol and space
bar will erase it again.                                        
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
DISK ....                                                       
                                                                
        The  first option is disk  access to load and  save your
files. Before selecting this option you should ensure that there
is a disk in the drive, since the program will attempt to obtain
a directory from your disk when  first using this option. Once a
directory is  obtained then  it will be  stored in  memory, this
saves wear and tear on  your disk drive, if you forget  to place
a disk in the drive then the program will simply wait for you to
do so. The first  15 names in the directory will be  placed in a
window, as you move the pointer over the names they will each in
turn  be highlighted, pressing space will then place the current
name into the filename box, alternativly you can select the NAME
icon and  type the name  in   directly. To scroll  the directory
then simply  point to the up/down pointers and press space. Once
you are happy with the name then select the LOAD/SAVE icons, you
can obtain a new directory by selecting the DIR icon.           
                                                                
                                                                
                                                                
         Two further icons are available,  these are ANL and ANS
and  are  used in  conjunction with  the  animator which  I will
explain more about later.  Once you are  finished with the  Disk
option then simply select QUIT to return back to the designer.  
                                                                
LOG...                                                          
                                                                
The  log option produces a drop  down window with six selections
simply  move the arrow  over the selection  and press space, the
selections are as follows :-                                    
       STORE NEXT.. will store the sprite  at the next available
space in  memory, you will be given info  on where the sprite is
stored and its size, if you are happy with this then select OK. 
       OVERWRITE.. will produce a screen with three boxes at the
top and  one  at  the bottom.  The  top  three boxes  will  hold
previous,  current and next  sprites in  memory, by  placing the
pointer  on  the arrows  you  can  scroll through  the  sprites,
remember however that the centre box is the  current sprite. The
box at  the bottom of the screen holds  the sprite you have just
designed.  When you  have moved the  sprite you  wish to replace
into the  centre box then select OVER,  the sprite in the centre
box will then be replaced with the new sprite                   
        INSERT.. acts in the same  way as overwrite, except that
the centre box will be empty, the left and right boxes represent
the sprites you wish to insert your new sprite between.         
        SWAP.. allows you  to swap two sprites in  memory, there
are two boxes, each with  their scroll options. Simply place the
two sprites (one in each box) and select swap, they will then be
move into each other's place.                                   
                                                                
       DELETE.. acts again in the same way in that the sprite in
the centre box will be removed  from memory when the delete icon
is selected.                                                    
            SEARCH.. allows  you  to edit  a  previously  stored
sprite, again move the required sprite  into the centre  box and
select edit, you will then be returned to the design screen with
the sprite in the grid.                                         
          CUT & STORE..  produces a  window holding a  magnified
version of  the sprite in the  sprite box. A dotted  box will be
placed  around the  image.  Using cursor  keys will  contract or
expand the box, pressing space will produce a pair of lines, one
vertical and  one horizontal, where  they cross is  the top left
corner of the  area you wish to  cut, again pressing  space will
return the  box. Once you  are satisfied  with the position  and
size of the area you wish to cut then press RETURN and the image
will be stored at the next available place in memory.           
                                                                
GRAB..                                                          
       When selecting the grab option you should ensure there is
a  disk in  drive since  this option  will attempt  to  obtain a
directory from disk unless of course you  have accessed the DISK
option,  in  which  case  the directory  will  be  accessed from
memory. Again  this option  works in  the same  way as  the DISK
option, however this time you  can load a SCREEN$ or FLASH  file
and grab a 60*60 pixel square from the screen by moving the  box
around the screen and pressing space. You can decide if you want
the palette  of the  new screen ON  or  OFF before  loading  the
screen. Once  you have grabbed a  section of screen you  will be
returned  to directory  screen. If  at this  point you  turn the
palette off again  then the previous  palette will be  restored,
however  once  you return  to  the design  screen  then  the new
palette is  permanent. When returning  to the design  screen the
grabbed section will be placed in the grid.                     
                                                                
PAL..                                                           
           On   selecting PAL  you will  see a   row of  sixteen
coloured  blocks across the  top of the  screen representing the
sixteen pens and their current inks, the current pen will have a
box  around  it.   The  rest  of  the  screen  holds 128  blocks
representing the total colours on the SAM. By pointing the arrow
at the top row  of blocks you  can select the  pen you  wish  to
change then move  the arrow to the  colour you wish to  place in
the pen and press space. Pressing space when the arrow is either
side of the screen will return you to design grid.              
                                                                
INFO..will  give  information about  the  current palette,  free
space  in memory, the number of  sprites stored plus a few other
details.                                                        
                                                                
ANIM..                                                          
       The animator can only be entered when there are  at least
two sprites stored in memory.                                   
        On entering  the animator there  will  be three boxes at
the top of the  screen pointing to sprites in  memory, again the
centre box is  the current sprite. Another box in  the middle of
the screen is the  animation box, below this box are arrows that
allow  you  to single  step  through  your  frames backwards  or
forwards. When secting these arrows they will light  up  on  the
first press  of  the  key,  this  will  determine  whether  your
animation runs forward or reverse. Pressing the space key  again
whilst still on the arrow will single step through  the  frames.
Below this are another set of arrows  that  allow  you  to  move
through the sprites in memory.                                  
                                                                
       The ADD icon will add the current sprite to the animation
frames.                                                         
         The DELETE  icon will delete the  current frame in  the
animation box.                                                  
         The  REP icon will  replace the current frame  with the
current sprite in the center sprite box.                        
        The INSERT icon will insert the  current sprite ahead of
the current frame.                                              
          The  LOOP icon  decides if  the frames  when run  will
continue to loop until a key is pressed.                        
       The CLEAR icon will clear all frames from memory, however
this icon will  flash for several  seconds, so pressing any  key
during the flashing period will abort this option.              
                                                                
        The WIPE and OVER icons decide, when you add a sprite to
the animation  sequence, whether  the previous   frame is  wiped
from the animation box  before the next frame appears or whether
it simply prints over the top of the previous frame. Each  frame
has its  own WIPE  or OVER  switch therefore  each frame can  be
selected to act differently from each other in this respect.    
                                                                
    The  POS icon  will, providing  the sprite is  below maximum
size, allow you to add and position where the sprite will appear
in the animation box, simply  selecting  ADD  on  its  own  will
centre the sprite in the animation box  however. POS  gives  you
more control over its screen position in the box, using this  in
conjunction with WIPE and OVER allows you  to  animate  a  small
section of a larger sprite                                      
          The  RUN icon  will run the  animation sequence  until
either it has reached the end (if the LOOP icon is off) or until
a key is pressed.                                               
           At  the bottom  of the  screen is  a speed  bar which
determines  how  fast your  animation runs,  moving  the pointer
along the speed bar and pressing space will adjust the speed.   
                                                                
         It  is possible to  save an animation sequence  to disk
using the  ANS as  mentioned earlier in  the DISK  option, using
ANL  will load  it back again,  I must stress  however that this
animation sequence only works within  the animator and cannot be
used in your own programs.                                      
                                                                
         On entering the Animator  a warning message may  appear
telling  you that  the animation  file is  incompatable with the
sprites stored  in  memory. This  may happen when  the animation
sequence  belongs to  another sprite file, or when  you may have
altered a sprite in  the sprite file i.e  increased its size  or
even deleted it from memory, either way it will stop you running
the animation sequence which may result in the program crashing.
                                                                
FILL..allows  you to fill an  area with the  current ink, simply
place  the pointer within the grid and  press space. One word of
warning is  that if the fill leaks through a gap in the enclosed
area then not only will  the grid be filled but also  the entire
sprite box,  no matter what  size your grid  is set to.  If this
happens then simply select the UNDO option.                     
                                                                
KILL..will ask you if you wish to erase all  sprites from memory
if so then press Y, else press any other key.                   
                                                                
GRID...will produce a  drop down window  containing four  arrows
pointing  N,S,E and West. Placing the  pointer on the west arrow
will reduce  the size of  the sprite area two pixels at  a time.
The  X Y values at  the right hand side of  the screen will show
you the  depth and width of  the area. Once the  values go below
thirty then the grid itself will begin to grow smaller.         
       East willincrease the width of the grid two pixels a time
       South will increase the depth one pixel at a time        
       North will reduce the depth on pixel at a time           
When  you are finished adjusting the  grid then move the pointer
away from the box and press space.                              
                                                                
ICONS...On the  right hand side of the screen are a set of icons
for  rotating,  mirroring,  scrolling  etc.  your  sprite.  When
selecting  rotate for example  then the whole  sprite is rotated
45 degrees clockwise, however if you select the ICON option  the
icons will change colour and any use of them  will  only  affect
the area within the grid, this means you can rotate,  mirror  or
scroll a small section of your sprite.                          
                                                                
MISC..produces a drop down window similar to the LOG option with
five possible selections, they are as follows:-                 
       SCREEN OFF turns the screen off until a key is pressed   
       MASK creates a mask of the current sprite  (see technical
       manual concerning masks.                                 
                                                                
       STORE PAL  stores the current palette in memory (handy if
       you mess up your palette with the PAL option)            
       RESTORE PAL restores the previously stored palette.      
       QUIT PROG quits the SAM SPRITE program.                  
                                                                
UN is the final  option in the menu  bar and this will undo  any
operation concerning the icons or fill option.                  
                                                                
Below the icons  are four arrows  that allow you  to scroll  the
grid around the sprite area, since only a quarter of the area on
a  full  60*60 pixel  is visible  within  the grid,  this option
allows  you  access  to other  areas  of your  sprite.  There is
however a  faster way of  getting to an  area of your  sprite by
simply pointing to  an area in the  sprite box at the  top right
hand corner of your screen and pressing space.                  
Finally at the  bottom right hand corner  of the screen are  the
sixteen  pens with their current inks,  below this is a coloured
bar showing the current pen selected.  By placing the pointer on
any  of the  sixteen colours and  pressing space  will change to
that pen.                                                       
                                                                
TECH INFO                                                       
                                                                
When sprite files are saved  to disc the first 841 bytes  of the
file  hold  info  for the  sprite  designer,these  bytes  are as
follows:-                                                       
                                                                
       Byte 0 - Number of sprites in file                       
       Bytes 1 to 799 - sprite index table                      
       Bytes 800 to 839 - palette                               
       Byte 840 animator variable                               
                                                                
                                                                
The sprite index table consists of 255 blocks of three bytes,   
one block for each sprite, the first of these three bytes is the
page number the sprite is stored in,  the next two bytes are its
address. The  first  page starts  at  page two  with  the  first
sprites address at 0000.                                        
           For  the sprites  to be  loaded in  at  their correct
positions in relation to the  sprite index table they should  be
loaded in at &8000-841.                                         
         I  realise that this  may be too  low for  longer basic
programs so the solution is  to load it in at a higher  page and
adjust the  sprite table, the  following basic  program will  do
this.                                                           
                                                                
      10 LET page=6: REM example of users choice                
      20 LET address=(((page-1)*(16384))-841)                   
      30 LOAD "sprites.SP" CODE address                         
      40 LET num=peek address                                   
      50 FOR l=(address+1) to ((address+1)+(num*3)) STEP 3      
      60 LET a=peek l                                           
      70 LET a=((a-2)+page)                                     
      80 POKE l,a                                               
      90 next l                                                 
                                                                
This program is on the disk under the name of MOVEINDEX.        
       I am working  on some code for basic users to make use of
the sprites designed on SAM SPRITE and will have it ready within
the next  two issues  of Sam Supplement,  until then I  hope you
enjoy messing about with it.                                    
If you find any  problem with the program then  dont hesitate to
call me (anytime after 7 p.m.) on 071 987 2365.                 
                                                                
                                                                
                                               Bye...           
                                                                
P.S I nearly forgot, there is  a demo file on the disk under the
name  of  DEMO.SP and  DEMO.AN.  Go  to disk  option  and select
demo.sp and  then LOAD,  then load the  animation file  with ANL
(there,s no need to select DEMO.AN as the program will sort this
out for you  when you select ANL), once you've done this you can
go to LOG and select SEARCH or go to ANIM and select RUN.       
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
                                                                
.                                                               

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