WHITE LIGHTNING by Oasis Software INTRODUCTION by Mike Butler White Lightning is a high level graphics development system for the Spectrum 48k. It is aimed primarily at the user who has commercial games writing in mind and has the patience to learn a sizeable new language. It is not a games designer and stunning results probably won't be produced overnight, but it does have the power and flexibility to produce software of a commercial standard (with a little perseverance!). [...] Assembly language has three advantages over high level languages: speed, flexibility and compactness. During the running of an arcade game, the processor spends most of its time manipulating screen data, and if the appropriate commands are implemented in the language, the execution "overhead" is very small. Add to this the fact that considerable time has been spent on the routines themselves to optimise execution speed, and we feel most machine code programmers would be hard pressed to better White Lightning for speed. As far as flexibility is concerned, White Lightning has almost 300 commands as well as access to BASIC and machine language if required. A lot of the tricky routines like rotations and enlargements are already implemented for you. As far as compactness goes, Forth itself produces very compact code, but there is, of course, the overhead of the language itself. Assembly language has four major drawbacks. Firstly, you've got to learn it. Having mastered machine code, program development is very slow compared with a typical high level language; there is no "crash protection" whatsoever; and to produce effective results you need a fairly intimate knowledge of the machine you're working with. BASIC has several points in its favour; these are: excellent crash protection, extremely readable source code and a relatively short learning curve. These features make BASIC a very good introduction to programming for the hobbyist, but for the serious games writer the language is insufficient in terms of both its speed and flexibility. Because White Lightning is Forth based it has virtually the speed of machine code, no knowledge of the machine is required, the source code is relatively readable, and it is fairly well protected from crashing. [...] SPRITE DEVELOPMENT Included with White Lightning is a sprite generator. This comes complete with a pre-defined character set which, when suitably combined, makes up to 167 full characters. The pre-defined characters cover Asteroids, Pac-Man, Scramble, Defender, Space Invaders, City Bomber, Lunar Lander, Frogger, Centipede, Donkey Kong and many more. You can use them as they are, customise them, or design up to 255 of your own sprites. The development software allows you to reflect, spin or invert. When you have finished work, or between sessions, the whole lot can be simply saved to tape. IDEAL The main part of the package is the White Lightning language itself. The language can be thought of as being divided into two parts: firstly, there is a super-fast integer Forth, which conforms to a standard Fig-Forth; but secondly, and of most importance to games designers, there is the IDEAL sub-language. IDEAL stands for "Interrupt Driven Extendible Animation Language". IDEAL has a dictionary of over 100 words, which can be freely mixed with Forth, or, as we shall see, can be accessed from BASIC. Interrupt Driven Forth/IDEAL words can be executed under interrupt; this means that programs can be run in foreground and background at the same time. Suppose, for instance, the program you are writing involves a scrolling backdrop, which has been defined in a sprite 6 screens wide. A program can be run in background to handle the scrolling backdrop, and a separate program written in foreground to control all of the characters which move within the backdrop. This will free the user from complex timing calculations to get a smooth scroll and is one of the most powerful features of the entire package. Background words can be executed up to 50 times a second. Extendible Forth is extendible and was chosen as the most suitable host language for IDEAL because of this extremely useful feature. New words can be defined in terms of any of the Forth/IDEAL words, or your own previously defined words. This means that you can create diagonal scrolls, for instance, by combining individual scrolls. Animation Language Very careful planning went into the designing of the IDEAL animation language, to make it as portable as possible between micros. If you've written a very successful program for one micro, you can move the same code across without too much difficulty. The only major changes necessary are changes to accommodate the different screen formats; ie. the number of columns and rows. You don't need to worry about the complexities of various memory mappings; IDEAL does that for you. Some implementations will not allow attributes to be moved separately from pixel data, so to be certain of higher portability, move attributes and data together. ACCESS FROM BASIC If you are not familiar with Forth and want to get reasonable software quickly, you can access the IDEAL language from BASIC. Programs will no longer be portable and you won't get quite the same speed and polish, but perfectly good programs can be, and have been, written this way. More memory will be used for BASIC source, so bear all this in mind before deciding to put off learning Forth! Most of the useful BASIC commands that handle sound and graphics, such as DRAW, CIRCLE, BEEP and so on, have been implemented in Spectra Forth. Whenever possible, call them from Forth and not BASIC. The interpretation and initial floating point manipulation of BASIC commands are avoided, and commands will therefore execute more rapidly from Forth. OPERATING INSTRUCTIONS 1. Rewind the tape marked "White Lightning". Disconnect Interface 1 if fitted. 2. Load using LOAD "" then stop the tape. White Lightning will auto-run. 3. Once loaded, you will get the prompt "LOAD SPRITES Y/N". 4. If it's the first time you've used the package, type Y to load the demonstration sprites, which will follow directly after White Lightning on the same tape. There is a section of data before the sprites which doesn't load, but don't worry about this; this is information used by the sprite development package. Once loaded, the "LOAD SOURCE Y/N" prompt will appear. Press N to enter White Lightning or, if you wish to load some source code, place the appropriate cassette in the recorder, press PLAY and then type Y. 5. To RUN the demonstrations, just LOAD using LOAD "" and the program will auto-run. 6. To RUN the Sprite Development Software just type LOAD "" and again the program will auto-run. [...] -- end of introduction