Home | Contents | KwikPik |
|
1075 SREP_1: SOUND_0,0,I,2+2*F,255: SON 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. 1130 PRINT AT 21,0;CHR$ 3;" by Mike Leaman 1985"; Line 1130 Prints a message at the bottom of the screen in double-height characters, using control codes in the PRINT statement. 1140 PAUSE 100: SOFF: PLAY_0,5,0,30,5 Line 1140 Switches off the Interrupt Sound Generator (ISG) and produces another kind of sound effect using the 'PLAY' command. 1145 PRINT AT 21,0; PAPER 1; OVER 1;" "; Line 1145 Colours the bottom two lines of the display to blue. 1150 CURRENT_4: WINDOW_21,0,2,28 Lines 1150-1160 Set up two windows over the blue strip at the bottom of the screen. 1170 FOR A=1 TO 80 Lines 1170-1200 Split the blue strip in half by PANning in two different directions. 1204 INPUT ; Line 1204 Sets the colour of the two input lines at the bottom of the screen. 1205 FOR A=1 TO 5 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? |
16 PCLEAR Line 16 Clears the PROCedure stack. You must do this at the beginning of any program that uses procedures or 'REPEAT-UNTIL' loops. 17 REPEAT Line 17 Marks the beginning of the main program loop. (This 'REPEAT-UNTIL' loop makes the demonstration repeat itself.) 20 INTRO Line 20 Calls the 'introduction' procedure. 30 WINDOWS Line 30 Calls the 'windows' procedure. 40 GRAPHICS Line 40 Calls the 'graphics' procedure. 50 END Line 50 The 'end' procedure. This produces a scrolling 'end' message once the demonstration program's finished. 60 UNTIL_0 Line 60 Makes the demonstration repeat forever! This is equivalent to the more common 'REPEAT-UNTIL FALSE' loop you'll find in other Basics. 1000 @INTRO Line 1000 Defines the beginning of the 'intro' procedure. 1003 MODE_4: CLS Line 1003 Selects large size characters and clears the screen. 1005 WINDOW_0,0,24,64 Line 1005 Defines the current window so that it covers the entire screen. 1010 BRIGHT 0: PAPER 0: MODE_4 Line 1010 Sets the start-up colours for the 'intro' procedure. 1020 FOR F=0 TO 2
| ||||||
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.1260 ENDPROC_INTRO Line 1260 Marks the end of the 'introduction' procedure. 1999 DATA 1,3,5,6,14,15 Line 1999 Contains the numbers to define the six different stipples required. 2000 @WINDOWS Lines 2000-2010 Mark the beginning of the 'windows' procedure. Line 2010 clears the screen. 2020 CURRENT_2: WINDOW_0,0,5,64: PAPER 1: INK 7: MODE_2: CLW_0 Lines 2020-2030 Define a small window at the top of the screen and print a message in it. 2040 CURRENT_4: WINDOW_5,0,8,40: MODE_3 Lines 2040-2060 Set up three different windows in different parts of the screen, all with different character sizes. 2070 FOR A=1 TO 150 Lines 2070-2120 Print 150 different random characters to the three different windows in random colours. 2130 FOR A=1 TO 100 Lines 2130-2180 Scroll the four different windows on-screen, all in different directions. 2190 WINDOW_0,0,22,64: BORDER 1: INPUT ;: PAPER 6: INK 1: CLW_0 Lines 2190-2230 Print a message in the top left-hand corner of the screen using Mode 1 size characters. 2240 PLOT 4,171: DRAW 112,0: DRAW 0,-24
|
Lines 2240-2250 Draw a frame around the message in the top left-hand corner of the screen.2260 PAN_0,120: SCROLL_0,-120 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. 2300 ENDPROC_WINDOWS Line 2300 Marks the end of the 'windows' procedure. 3000 @GRAPHICS Line 3000 Marks the beginning of the 'graphics' procedure. 3010 BORDER 7: PAPER 7: INK 1: CLW_0 Line 3010 Sets the white screen and clears it. 3020 PRINT CHR$ 2;"Graphics can be drawn on screen and displayed instantly by th
e command CHANGE ." 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.) 3030 FOR A=1 TO 40: DRAW INK 7;(RND*255)-PEEK 23677,(RND*130)-PEEK 23678: NEXT A Line 3030 Draws 40 random lines on the screen (in the shape of a 'bird's nest'). 3040 CHANGE_7,2 Lines 3040-3050 This routine makes sure that the screen is covered in red INK. Line 3050 pauses the program flow for a second. 3055 FOR Z=1 TO 8 STEP 8 Lines 3055-3120 FLASH the INK colours on-screen, followed by the PAPER colours. 3130 PUT_2,0,0,0,22,32: FADE_0 Line 3130 Puts the contents of the ROM onto the screen and FADEs the display file to zero (black PAPER and black INK). 3140 PUT_2,0,0,0,22,32: FADE_6 Line 3140 Puts the contents of the ROM on-screen and FADEs to green INK and black PAPER. 3150 PAUSE 50: CLEAR 39999 Line 3150 Clears some space in RAM to store part of the screen. |
3155 WINDOW_0,0,2,20 Line 3155 Defines a small window in the top left-hand corner of the screen. 3160 PRINT CHR$ 1;"Areas of the screen"'"can be enlarged"; Line 3160 Prints a message in the window using 64 column characters. 3170 FOR A=1 TO 20: PAPER RND*7: INK 9: CLW_3: PAUSE 10: NEXT A Line 3170 Highlights the window by FLASHing the PAPER colours. 3190 GET_0,40000,0,0,2,10 Line 3190 Stores the contents of the window into memory. 3200 SPUT_40000,0,50,3,6,10,16 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. 3220 ENDPROC_GRAPHICS Line 3220 Marks the end of the 'graphics' procedure. 4000 @END Line 4000 Marks the beginning of the 'end' procedure. 4005 INK 2 Lines 4005-4007 Set the screen to red INK and clear it. 4010 SPRINT_0,0,4,5,"THE END" Line 4010 Prints a message at the top of the screen in large letters. 4020 CURRENT_2: WINDOW_0,0,22,64 Lines 4020-4040 Set up two overlapping windows. 4050 FOR Z=1 TO 50
4060 CURRENT_2: SCROLL_0,-1
4070 CURRENT_4: PAN_0,1
4080 NEXT Z Lines 4050-4080 This routine scrolls the message downwards into the second window, which then scrolls the message sideways - this gives the slanting effect. 4085 PAN_0,-10 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. 4100 ENDPROC_END 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. |
Home | Contents | KwikPik |