|M E G A B A S I C|
|TUTORIAL - PART 1|
positions which have an even number. It
must also be noted that although the
character resolution has been improved,
the colour resolution has not.
The character sets for FONTs 1 and 2
are stored in RAM allowing users to redefine them at will for whatever
requirements you may have. Also, characters 128 to 143 are also stored in RAM
(the normal Spectrum character set).
Thus, it's now possible using the normal
method of constructing Spectrum user-
definable graphics to obtain up to 229
UDGs - just think of the graphics you'll
be able to include in your own Mega-programs!
Before you take a look at the listing I've
prepared to illustrate these aspects of YS MegaBasic, have a look through the
detailed explanation of each of the commands associated with the creation of
windows and the manipulation of the different character sets.
Note that when you're looking
through the tables of commands that 'n'
denotes a numeric expression and '$'
represents a string expression; and
expressions shown in brackets are
optional. When you're using YS MegaBasic commands which require numeric
or string expressions, there's no restriction to the complexity of the expression
and all standard ZX Basic functions can
be used alongside the new ones.
THE YS MEGABASIC TOKEN
YOU CANNOT BE SERIOUS ...
THREE CHARACTER SIZES?
TWO CHARACTER FONTS?
SINGLE LETTER ENTRY?
... ON A SPECTRUM!!??
Well, if you've read this far you've probably guessed that we're very serious! It's all possible - on a 48K Spectrum, with or without microdrives. All you need is a copy of YS MegaBasic ... the inexpensive miracle on cassette. Next month, we'll be providing you with a coupon to send off, pricing details of the package and instructions for what to do with this token (especially if you want to be one of the first to transform your computer into a Mega-Spectrum). Be there next month ... and prepare yourself for the unimaginable - the one and only YS MegaBasic!
|YS MEGABASIC WINDOW COMMANDS|
||This command enables the user to clear a window in a number of
different ways. The numeric expression will usually be in the
range '0' to '3'; any other number will be taken by the
MegaSpectrum to be a '3'. Action taken by CLW depends very
much on the value of the numeric expression, as shown below: |
(0) - The window is cleared, just as the CLS command on the
(1) - The window is cleared with INK instead of PAPER;
(2) - The window is inverted, ie, the INK is turned to PAPER and
the PAPER is turned to INK;
(3) - Only the attributes are cleared. This final option allows
you to change the colour of a window without clearing the contents of
This allows the user to select which window is used for output.
The variable, n, can be any value between zero and nine; any
value outside these limits will result in an 'illegal window'
This command prints a string downwards in the current window.
The two numeric expressions give the co-ordinates from which
the string should be printed.
This is a general command enabling the user to control the way in
which the YS MegaBasic system operates. FX calls values of '0',
'1', '2' and '3', allowing users the option of which windows are
used for specific tasks by the system. For example, FX_0,n
selects which window is used for command input, FX_1,n
decides the window used for automatic listings, FX_2,n selects
the window used as the default program output window and
FX_3,n decides the window used by the Front Panel. Using each
of these FX calls, it's possible to use the same window for all
This command's used to scroll the current window to the left or
right, pixel-by-pixel. The first expression defines whether the
window is filled with INK or PAPER, and the second controls
which direction and by how many pixels the window should be
This is similar to PAN, except that the window's contents wrap
around; that is, what comes off one side of the window
automatically appears at the other side.
This command is similar to PAN, except for the fact that the
window is scrolled up and down instead of left and right.
Again, the equivalent to PANW, except that it controls up and
down scrolling instead of movement left and right.
This command defines the size and position of the current
window. When the command is executed, the position of the
cursor is reset to the top left corner of the window. The first
two numerical expressions define the position of the window - first
the Y co-ordinate, then the X co-ordinate. The second two
expressions define the depth and width of the window
respectively; if either of these two expressions are zero, you'll
get a 'window too small' error. If the Y co-ordinate plus the depth
give a window greater than 24 lines, or the X co-ordinate and the
width give a window greater than 64 columns, a 'window too
large' error will be produced.
|YS MEGABASIC CHARACTER COMMANDS|
This command selects the character set used for screen output.
FONT_O gives you the standard ZX Basic character set, and
FONT_1 and FONT_2 select between the two RAM
character sets. If you use a value of 'n' that's greater than
two, then FONT_2 is assumed.
The MODE command enables the character size to be used for
printing. If two expressions are specified, the first value
denotes the window whose character size is to be defined and the second
expression is the character size to be selected. If you use only
one expression, it's assumed that any alteration is carried out on
the current window. The value of 'n' should be '1', '2' or '3'; any
other value given will mean that no characters are printed -
quite useful if you want to switch off a particular window.
Character sizes can also be defined in a PRINT statement by use
of control codes. Character sizes '1', '2' and '3' are now used
to select the character size for the current window, ie, PRINT CHR$;
"MEGABASIC" would print the message 'MEGABASIC' using
|The above tables detail the commands associated with the construction of windows and the manipulation of character sets.|