Lines 1020-1120 This loop prints 'YS MEGABASIC DEMO' on-screen in seven different colours, three different fonts and six different stipples. Line 1070 shows how you can print different size characters with the same PRINT statement; character codes 3 and 4 change the size of character output. Line 1080 produces a single-line feed, instead of a double-line feed. Line 1100 homes the cursor, but does not clear the window. Line 1075 produces a continuous sound effect.
Line 1130 Prints a message at the bottom of the screen in double-height characters, using control codes in the PRINT statement.
Line 1140 Switches off the Interrupt Sound Generator (ISG) and produces another kind of sound effect using the 'PLAY' command.
Line 1145 Colours the bottom two lines of the display to blue.
Lines 1150-1160 Set up two windows over the blue strip at the bottom of the screen.
Lines 1170-1200 Split the blue strip in half by PANning in two different directions.
Line 1204 Sets the colour of the two input lines at the bottom of the screen.
Lines 1205-1250 This routine makes the display flash in eight different colours, by switching the paper colour.
What we have for you this month is a
small demonstration listing for users of
YS MegaBasic to test-drive their new-
found Basic. Virtually each line of the
listing has been described in detail so that
you don't miss out on a single byte!|
If you check out the screen shots given and read through the listing, you'll see that short though this program is, it'll provide you with first-hand experience of the various character fonts, sizes and stippled characters available, QL-style windows, named procedures, sound effects and a whole lot more! Of course, when you type it in you'll be able to sort out how the MegaSpectrum keyboard operates as well!
If you haven't yet succumbed to the lure of YS MegaBasic, then this program isn't going to put you off! Try writing the same program in ZX Basic and see how many lines of program you'll need ...
Over the next few months, we'll be providing the odd demonstration listing for you to ogle over. Next month, for instance, we'll be showing you how you can create 3D graphics á la Knight Lore in just a few simple lines of YS MegaBasic!
But that doesn't mean we don't want to see your own programs. Send your listings to the YS Towerblock and we'll get Mike Leaman to have a look at them (And we'll be publishing the best of 'em! Ed.). Also, if you're having any problems, write to Mike and he'll try and reply to most of them within the pages of Your Spectrum. Of course, if you've got a major disaster on your hands and you want help instantly, try phoning Troubleshootin' Pete on nn-nnn nnnn - he's only had his copy for a few weeks but he'll try and help you!
Anyway, back to you! Until YS MegaBasic is the only Basic on the Spectrum, Your Spectrum's going to be one of the only places you can get your programs published and get some help on its mastery. So, keep watching these pages! And if you haven't yet joined the thousands of YS MegaBasic users ... what are you waiting for?
Line 16 Clears the PROCedure stack. You must do this at the beginning of any program that uses procedures or 'REPEAT-UNTIL' loops.
Line 17 Marks the beginning of the main program loop. (This 'REPEAT-UNTIL' loop makes the demonstration repeat itself.)
Line 20 Calls the 'introduction' procedure.
Line 30 Calls the 'windows' procedure.
Line 40 Calls the 'graphics' procedure.
Line 50 The 'end' procedure. This produces a scrolling 'end' message once the demonstration program's finished.
Line 60 Makes the demonstration repeat forever! This is equivalent to the more common 'REPEAT-UNTIL FALSE' loop you'll find in other Basics.
Line 1000 Defines the beginning of the 'intro' procedure.
Line 1003 Selects large size characters and clears the screen.
Line 1005 Defines the current window so that it covers the entire screen.
Line 1010 Sets the start-up colours for the 'intro' procedure.
THE CURSE OF THINGS ZX!|
It had to happen! Our plans to have YS MegaBasic ready for public consumption by January 1st, 1985, were scotched at every turn. Here at YS, we'd like to apologise to all who received YS MegaBasic a few days late - thanks for having patience with us and we hope you thought the wait worthwhile! Needless to say, all deliveries of YS MegaBasic are now under control. Of course, there won't be this trouble next time ...
Making use of all the available character fonts and stipples, the demo's title screen includes musical accompaniment from YS MegaBasic's 'SOUND' and 'PLAY' commands. This part of the program is displayed in Mode 4, where each character is 16 by 16 pixels; there's also good use of the 'STIPPLE' command.
You can have up to ten windows on- screen at any one time, all of which can be controlled independently through simple YS MegaBasic commands. At this stage of the demo, four windows have been created and YS MegaBasic is scrolling each of them, pixel by pixel, in different directions via the 'PAN' command.
using the 'CHANGE' command. Note the use of the 'PLAY' command to produce another stunning sound effect.|
Line 1260 Marks the end of the 'introduction' procedure.
Line 1999 Contains the numbers to define the six different stipples required.
Lines 2000-2010 Mark the beginning of the 'windows' procedure. Line 2010 clears the screen.
Lines 2020-2030 Define a small window at the top of the screen and print a message in it.
Lines 2040-2060 Set up three different windows in different parts of the screen, all with different character sizes.
Lines 2070-2120 Print 150 different random characters to the three different windows in random colours.
Lines 2130-2180 Scroll the four different windows on-screen, all in different directions.
Lines 2190-2230 Print a message in the top left-hand corner of the screen using Mode 1 size characters.
Lines 2240-2250 Draw a frame around the message in the top left-hand corner of the screen.|
Lines 2260-2290 PAN and SCROLL the message around the screen, pixel by pixel. Line 2290 pauses program flow for a second and then clears the screen.
Line 2300 Marks the end of the 'windows' procedure.
Line 3000 Marks the beginning of the 'graphics' procedure.
Line 3010 Sets the white screen and clears it.
Line 3020 Prints a message at the top of the screen using Mode 2 characters. (Note the use of a control character in the PRINT statement to define the character size.)
Line 3030 Draws 40 random lines on the screen (in the shape of a 'bird's nest').
Lines 3040-3050 This routine makes sure that the screen is covered in red INK. Line 3050 pauses the program flow for a second.
Lines 3055-3120 FLASH the INK colours on-screen, followed by the PAPER colours.
Line 3130 Puts the contents of the ROM onto the screen and FADEs the display file to zero (black PAPER and black INK).
Line 3140 Puts the contents of the ROM on-screen and FADEs to green INK and black PAPER.
Line 3150 Clears some space in RAM to store part of the screen.
Line 3155 Defines a small window in the top left-hand corner of the screen.
Line 3160 Prints a message in the window using 64 column characters.
Line 3170 Highlights the window by FLASHing the PAPER colours.
Line 3190 Stores the contents of the window into memory.
Lines 3200-3210 Place the window and its enclosed message back on-screen, enlarged three times in the x direction and six times in the y direction. Line 3210 pauses program flow for a second and clears the screen.
Line 3220 Marks the end of the 'graphics' procedure.
Line 4000 Marks the beginning of the 'end' procedure.
Lines 4005-4007 Set the screen to red INK and clear it.
Line 4010 Prints a message at the top of the screen in large letters.
Lines 4020-4040 Set up two overlapping windows.
Lines 4050-4080 This routine scrolls the message downwards into the second window, which then scrolls the message sideways - this gives the slanting effect.
Lines 4085-4090 Scroll the message to the left by ten pixels to square it up on-screen. Line 4090 pauses program flow for two seconds.
Line 4100 Marks the end of the 'end' procedure.
The 'CHANGE' command allows you to change the attributes on-screen. But here, in this section of the demonstration program, we're looking at the 'FADE' command, which lets the user create stunning explosion effects by manipulating the attributes.
A major feature of YS MegaBasic is its ability to 'grab' a portion of the screen and place it elsewhere. Then, using the 'SPUT' command, you can enlarge the portion of the screen when it's reprinted. It's worth noting that all attribute values are retained when you're using 'GET', 'PUT' and 'SPUT'.
The closing screen of MegaDemo uses the large character size mode, as well as the 'PAN' and 'SCROLL' commands to make the letters lean to the left. The entire demo program has been written using structured procedures - which means that this whole routine was called using the procedure command, 'END'.
|The above screenshots were printed in the wrong sequence in the magazine; they have been rearranged correctly here.|