Link to editorial & letters
Link to files
Previous disk program notes
Next disk program notes
Disk 8 program notes
Peter Johns Member 212
27 Fairfoot Rd or maybe 141
Bow,London E3 4EG
071 987 2365
Prog. SCRABBER
Scrabber is a mode 4 screen grabbing routine that has been
designed to allow you to grab, manipulate and store sections of
screens drawn with Flash or by other methods.
The storage area for these grabs (or if you
prefer, sprites) is divided into 32k pages of which there are
four pages in a 256k machine or twelve pages on a 512k. Each
page holds its own palette as well as a sprite address table.
Pages can be saved and loaded as a whole file or
individually and these pages can be used in conjunction with my
second program called SCRUSER of which I will explain more of
later.
Scrabber is written in part Basic and part machine code
of which the basic keeps track of everything whilst the M/c
does some pretty nifty juggling of pixels i.e see how fast it
takes basic to rotate a 16k image on screen (don't hold your
breath) and then try counting up to two before the machine code
can do it
The main menu on Scrabber offers eight options, the
first of these being to load a screen. Simply use cursor keys to
move the box to the option you require and press space.
If when selecting LOAD SCREEN you wish to see the
directory then simply type "d". Once a screen has been loaded
you can then select GRAB SCREEN, the screen will appear with a
small dotted box in the top left hand corner, using cursors will
expand or contract the box, press space and the box will
disappear and a horizontal and vertical line will appear. The
point where these two lines cross is the top left corner of the
image you wish to grab, again use cursors to move the lines.
Pressing space again will make the box return, holding
down the control key whilst using cursors will slow down the
rate of movement allowing you to place your box or lines
accurately.
Once you are satisfied with the position of the box then
press return, the screen will disappear and the image will
centre itself on the screen for you to view, pressing any key
will produce a drop down menu, again using cursors and space you
can select to rotate, mirror, scroll, abandon or store.
Once you have selected store, you will be returned back
to the main menu. On the lower half of the screen will be
information as to the size, width and depth of the last grabbed
image as well as how much room is left in the current page.
Other options in the menu allow you to save or load files
previously saved. When saving files you will be asked if you
wish to save just the current page or a file containing all used
pages, again when loading a page it will be loaded into the
currently selected page.
A word of warning when storing and saving sprites in
different pages, if you store sprites in the first page and
then skip pages and say, store sprites in the last page then
when you come to save a File then any empty pages in between
will also be saved, if however you use the pages consecutively
then only those pages used will be saved.
Another option allows you to scan through sprites in the
current page using left and right cursors and space to quit.
The PAGE/INFO option allows you to switch pages, delete
last saved sprite in page or view information concerning the
palette and page info for each of the pages.
TECHNICAL INFO
As mentioned earlier each page is up to 32k in length
with the capacity of holding up to 100 sprites (depending on how
big your sprites are (max 16k)). The first 219 bytes of the
page hold information concerning the sprites and the breakdown
is as follows:-
Byte 0 - Number of sprites in page
Bytes 1-2 - Size of Page including first 219 bytes
Bytes 3-18 - Palette
Bytes 19-218 - Sprite address index (first address=219)
The first two bytes of each sprite are its width/depth.
SCRUSER.
As I said earlier, Scruser was written to complement
Scrabber. All it is really is a machine code file that allows
you access from Basic to sprites grabbed with Scrabber (bit of a
mouthful that). There is a basic file on the disc called
SCRUSERDEM, its a simple demo of what Scruser can do, however in
the basic listing of SCRUSERDEM are some important subroutines
that show you how to load SCRABBER files and how to access the
palette and manipulate the sprites.
To place a sprite on screen you need to poke a list of
values to the machine code in sequence as follows:-
Poke xpos,x,y,spritenumber,page,screentype
Xpos is defined in Scruserdem as base+&7000, if you look at the
label LOADCODE at the end of the Scruserdem file you will see
all the variables set up as well as the load addresses for the
Two SCRUSER FILES. The variables are as follows:-
Xpos=where to poke the X position for the sprite (0-127)
Ypos=where to poke the Y position for the sprite (0-191)
Spnum=the number of the sprite required (1-100)
Bank=the page number in which the sprites were loaded
Type=how you want the image to be placed on screen
There are five ways to place the image on screen and the values
to poke into TYPE are as follows:-
0=placing on the screen overwriting anything beneath it
1=swap the contents of the screen with the sprite in
memory as used in drop down windows, repeating the process
will swap it back again.
2=XOR the image on to the screen
3=AND the image on to the screen
4=OR the image on to the screen
Therefore if you wanted to place sprite number six at X 100 and
Y 50 from page 8 using overprinting then simply
Poke xpos,100,50,6,8,0:call &4000
and lo and behold your sprite will appear.
If however you wanted to use the swap method then
Poke xpos,100,50,6,8,1:call &4000
then simply calling &4000 a second time will swap them back
again.
I hope I haven't made things too complicated but if you
have any problems then feel free to write to me (send S.A.E).
________________________________________________________________
BATTLESHIPS by D.Marriot
A good version of the classic paper and pencil game. There is
the option to play against the computer, which gives you a run
for your money.
Well worth passing the odd hour away with.
________________________________________________________________
BULK ERASE by R.W.Jeffs
This is a utility which gives you a similar command to that
found on Masterdos. This is the ERASE command followed by '?',
which asks you whether you wish to erase each file on the disc
in turn. The program reads in a DIRectory, and then goes through
it asking if you wish to erase each file. Pressing Y or N takes
the appropriate action.
As a bonus, you also get the option to FORMAT a disc. The
program is menu driven, and is very simple to use.
________________________________________________________________
DEC/HEX/BIN CONVERTER by R.W.Jeffs
One of those small but useful programs that will convert any
DECIMAL, HEXDECIMAL or BINARY number to the other 2 forms.
Again, menu driven and simply to use.
________________________________________________________________
PALETTE LINE LESSON by Dave & Brian
Continuing our look at BASIC commands, this month we try to
explain the PALETTE LINE command.
Brian has looked at my example and written a small article about
it, and I've done a simple demo of the command.
We hope that this will make it all a bit clearer to understand.
________________________________________________________________
SQUIGGLE by W.McGrugan
This is one of those games that falls into the "OH SH*!"
catagory. Try and collect little pills as you guide a moving
line around the screen. Of course, hitting the wrong pill or
your own trail results in death.
Don't play it if you have an appointment to keep!
________________________________________________________________
POINTER by M.Broster
This routine has great potential for including into utility
programs. When run it gives you a pointer on the screen, which
you control with the joystick or cursor keys.
The position of the pointer can be checked from BASIC at any
time and acted upon.
The listing has plenty of rems in it, which take you through
what each line is doing, so you could easily incorporate it into
your own programs.
________________________________________________________________
GALLERY
Another selection of Sam screens drawn by the more artistic of
our membership.
________________________________________________________________
FLASHMOD by J.L.Swan
Yet another new BASIC for FLASH. This one gives the option of
saving as SCREEN$. All previous mods remain.
COLOURCLIP
Another screen for your GRAB/PUT collection. Keep hold of these
as from issue 9 onwards we shall be telling you how best to use
GRAB and PUT to make your own screens, demos etc.
________________________________________________________________
LABEL DATABASE
A nice little utility, which keeps your addresses in a database,
and prints them onto labels when needed.
Originally issued on the SDC Opus club discs, this has been
converted to Sam by Frank Harrop.
________________________________________________________________
40 SETS by Dave Tonks
Forty character sets on a menu, which allows you to select and
save the set of your choice, for use in your own programs.
________________________________________________________________
MD HOOKCODES by Andy Wright (sent in by D.Hall)
A complete list of the Masterdos hookcodes, telling you where
they are, and what each one does.
Not published in the manual, invaluable for machine coders who
are using Masterdos.
________________________________________________________________
CLOCK by Darren Talbot
A nice analogue clock display, which when set, will keep acurate
time. Can be used with SAMBUS's built in clock.
________________________________________________________________
PC-TAS by Gary Thomas
An extra bit to add to the PC Suite published last issue. This
will let you convert PC files into Tasword files, for re-editing
on the Sam.
________________________________________________________________
.
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