#p  `  @`! #@%`)+-/1 3@5`79;=A C@E`IMO/S@U`WY[]_a c@egikmoq su`w{}/@` / @ ` @ ` @ ` @ ` ǀ ɠ / @ ` ٠  O`/@!Aa  !Aa!!#A%a)-//3A5a79;=?/CAEaGIKMOQdAUaWY]_a!cqagikmo/sAuawy{}!A`  @`! #@%`)+-/1 3@5`79;=A C@E`IMO/S@U`WY[]_a c@egikmoq su`w{}/@` / @ ` @ ` @ ` @ ` ǀ ɠ / @ ` ٠  O`/@!Aa  !Aa!!#A%a)-//3A5a79;=?/CAEaGIKMOQdAUaWY]_a!cqagikmo/sAuawy{}!A___________DATA 1 PROGRAMS 1 ST_NEWS PRGt 1^DESKTOP INFt EADME 1STt .  1..  1DOC01 1 DOC02 1 DOC03 1 (-DOC04 1 (DOC05 1 'wDOC06 1 ,DOC07 1 09DOC08 1 ?oDOC09 1 G DOC10 1 KDOC11 1 QSDOC12 1 f$DOC13 1 pDOC14 1 tDOC15 1 y5DOC16 1 WDOC17 1 DOC18 1 ,DOC19 1 =DOC20 1 =DOC21 1 6DOC22 1 DOC23 1  DOC24 1 DOC25 1 =-DOC26 "1 DOC27 $1 DOC28 '1 DOC29 )1 DOC30 +1 a.  1..  1CONVERT BAS!1 .4 ILL LST$1 1GEMVDI BAS%1 29HOUSE BAS)1 A(:IRQ C ,1 PnOUSE LST.1 RPATTERN BAS01 SSCROLLEDLST31 [C!PRITE LST61 dULT_EXAMBAS81 er,SOMETHING ABOUT INTERRUPTS by Mark van de Boer Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. On the ST there are some different types of interrupts. In this piece of writing I will discuss some ways to program timed interrupts. Maybe some other time I will discuss the other kinds of interrupts. But first another problem arises: In which language should I program interrupts? There are two languages suitable for the job, C and 68000 machine language. Advantages of C: Easier and faster to write programs in. Disadvantages of C: Not as fast as machine language and also you need to know which overhead is produced by the C-compiler when translating a function. There is also no easy way in C to execute the RTE instruction (ReTurn from exception). I will give an example of a C-interrupt routine later. Advantages of machine language: Fast and more efficient. Disadvantages of machine language: Harder to understand than C and it also takes more time to write a routine than in C. Personally I prefer machine language to program interrupts because I think that the disadvantages of C are too big. By the way: When you have written an interrupt routine in machine language it is still possible to call this routine from a program written in C. This can be done by linking the assembled machine language routine together with your compiled C program. Now for the 'real' work, how to get the machine executing your interrupt routine. Two types of timed interrupts can be programmed on the ST: start your own timer and synchronize your routine with the system interrupt. Starting your own timer: First I will show a little program from which I will explain what to do to get the interrupt running. * * Interrupt routine written in 68000 * _interrupt: * always put an underscore in front of the interrupt routine * otherwise it is impossible to call this routine from C. * C compilers put an underscore before every variable or * function addq.w #1,_var * some variable to count interrupts * between here and the RTE-instruction can be a lot of * instructions, including privileged ones, because an inter- * rupt is always executed in supervisor mode. bclr #4,$fffffa11 * interrupt no longer in service rte * ReTurn form Exception (interrupt) /* now some C code */ #include long int var=0; insttimer() { Xbtimer(3,0x6,0xff,interrupt); /* 3: timer D 0x6: value of control register 0xff: value for data register interrupt: address of interrupt routine */ } main() { insttimer(); /* start timed interrupt */ Cconin(); printf("I executed %d interrupts",var); Jdisint(4); /* disable interrupt */ Cconin(); /* give chance to read text */ } Xbtimer starts the desired timer and installs the interrupt routine. For more information about Xbtimer and its parameters, refer to page 217-218,47-48-49,272,81-82. Never  forget to clear the according bit in the interrupt-in-service register, or your interrupt will occur only once. (Editorial comment: The pages that Mark refers to, are in "ST Intern" from Data Becker). Synchronizing a routine with the system interrupt: This is a very simple thing to do and it can be done very easily from C. On the ST NEWS disk you'll find another C program ("IRQ.C") that does the job... Ohh, uhh, yes, you might say if you had a look at it, but you shouldbn't panic. In the ST a VBL (Vertical BLank) routine is executed every 1/60 th of a second. It is called vertical blank because at the time when the interrupt occurs your ST has drawn all lines on the screen from top to bottom. During this VBL interrupt some things which are essential for your ST's behavior are done. After having done this the ST checks a table which contains eight addresses of subroutines (pointers to functions). The 4-byte address of this table is at address $456 and address $454 contains the maximum number of routines in the table. There are two kinds of entries in this table: entries that contains zero and the others, containing non-zero. If an entry (which are of course 4 bytes) is zero then it won't be executed, however if an entry is non zero then a Jump to SubRoutine is executed to the address at that entry. Well, now you'll understand what the synchronize function does, don't you? It searches for a free entry in the table, if it found one it installs the routine and sets the variable index to the number of the entry. If it didn't find one it will tell you and abort the program (Of course there is a solution to this problem but it is very unlikely that there are no free entries in the table, so I won't discuss this). The rmsync function just sets the entry at which the address of your routine stood to zero, so it won't be executed anymore. Well, that's it for this time. Maybe I will tell you something more about the ST in forthcoming editions of ST NEWS, but that also depends on the chief-editor, designer, writer etc., also called Cronos. So if you liked it, let him now, and he can contact (sooiks) me. Nano nano.   (Editorial comment: The C-Compiler Mark used was the Digital Research C-Compiler of the Atari Developer's Package). REVIEW: LITTLE COMPUTER PEOPLE (HOUSE-ON-A-DISK) by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 1, launched on July 26th 1986. This program is indeed the only one in its class. Back on the Commodore 64 this program also aroused good criticism, and we're sure it will on the ST (or any computer, for that matter) as well. The program is written by some of the authors of Activision. One of them was David Crane, noted on the 64 for "Ghostbusters" (did you know that "Ghostbusters II" will be ready soon on the 64?) and "Pitfall II". The target of the game (is it a game or not?!?) is to communicate as well as possible with the person that's living inside your computer. You simply make him live in the "House-on- a-Disk". His character and his mood can be changed by the things that you do with him. For example, you should always be nice and patient, and you should never win to many times with cards. The game is very nice, and it's a pity that it only works on color monitors and computers with either a megabyte memory or TOS on ROM. When the game starts, you are asked for your name. The little person who'll come to live in the house will call you by that name (although he will sometimes - very uncivilized - just knock on the inside of the screen to get your attention). Once he has entered, you can start giving him commands, but watch out: he's also got a will of his own and he'll often do things you haven't asked him to do. The little person - he's called Timothy, but that can vary depending on the version you have - loves playing cards and it is also very important to supply him with a large enough quantity of water. You can fill his water bottle (in the kitchen) by pressing Control and "W" simultaneously several times. You can ask him to "please drink", but normally he'll do it just when he's thirsty. Did you notice? It's a "he", so no emancipation - yet - in the computer world. As far as I know, there are no versions with female inhabitors (what fun that would be if suddenly she would take a shower and forget to draw the curtain!). At night (you give in the time as well as the time of year at the starting of each game) he just sleeps and sleeps. If you want to wake him, press Control and A simultaneously (the Alarm bell will ring, the guy will get out of bed, put it off, and go back into bed). Don't do it too often, because his moods are SAVEd to disk every time he disappeares from your sight (behind a door or so) and next time the game'll begin with the mood last SAVEd to disk. Oh yes: never write protect a disk, otherwise the game will lock up in most cases. To please the little person, call him sometimes (by pressing control and C), give him presents (control-B = book;control-R = record;control-D = dogfood;control F = human food) and pet him a little. You can only pet him (by pressing control and P a few times) when he's in his chair besides the chimney, reading a paper or just sitting. Sometimes, the little person will put on a record and he'll start to dance - but that depends on his mood. Sometimes, he does exercises in his bedroom and sometimes he plays the piano. You can ofcourse ask him to do these things, like "please dance","please put on a record" or "please play the piano". The game offers very nice details. Whe he feeds the dog, he'll put the spare dogfood in the fridge, and next time he'll take it from the fridge. When he's happy he smiles and when he's unhappy or sick he turns green and looks very unhappy as well. He can also cook a meal, which is amazingly (watch out for my choice of words) real. After he has done some sanitary relaxation, he sometimes washes his hands (on the Commodore 64, my version used to do it every time!) and after diner or lunch he also brushes his teeth. Every once in a while, the little person goes to sit behind his typerwriter to write you a letter. He then talks about "throwing parties", "teaching his dog a few tricks" and about "filled or empty water bottles". You can also ask him to write a letter. But the little computer people can do much more. What about programming his computer (in his letters he sometimes talks about little people in HIS computer), taking a shower, listening to the stereo installation, watching television, phoning, eating, lighting the fire, going out, and playing games? He can actually play five different games (on the Commodore 64, it were three games): Poker, Card War, Anagrams, Word Puzzle and another card game that slipped our minds. A very nice game for all those people who think they can get more out of their computers and who like a little bit of artificial intelligence. It's a fourth dimension in interactive arcade- adventure action! Game Rating (1-10) Playability 7 Sound 7 During attractiveness 9 Set Up 9 Details 9 Overall Rating 8 THE DISC by Michael Abbott Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. On our search for nice novelettes that have something to do with computers, the computer age, or even pure science fiction, we have come across some old computer magazines (this story is rewritten from one of July 1984). 1984 by Business Press International, Ltd. To look at it, the processor was merely a disc about 160 mm in diameter and perhaps 60mm thick. Somewhere beneath its mirror- polished surface was a power source wringing out the last of its energy after an eternity in space. One of the disc's surfaces was more glassy than the others and when observed through an infrared viewer it scintillated delicately as though sprinkled with 'stardust'. Every few minutes pictures would form, as if it were a high-resolution dot display, but the graphics meant nothing to any scientists present. Most of the time the millions of optical fibres twinkled randomly with single bits of data. State-of-the-art technology had been clumsily applied to the magic surface in an attempt to interface it to the supercomputer that towered alongside. The hastily constructed optical interface was of the highest resolution achievable, yet each of its fibres blotted over some 10,000 or 15,000 of the disc's tiny pixels. It had taken engineers 18 months to prepare for what could turn out to be the most amazing dialogue or the greatest anticlimax in history. "It's like trying to couple an antique clockwork mechanism to a naked microchip but this is the best we can do." The resigned comment came from Professor Jim Hamner, who was on attachment to the Department of Defence. The President was tired and dishevelled. It would soon be dawn and there had been nothing to see yet. His ebony-spectacled bodyguards checked the presence of their guns, which they hid beneath perfectly tailored suits. "Well, apart from nearly triggering off a war, what else is there to know about this thing?" the President asked. The mysterious processor had arrived from deep space, borne on a vehicle no larger than the avarage satellite, and had slipped into a declining orbit. A shuttle had been called out to retrieve the visitor only after all the powers with space capability had denied they had anything to do with it. Hamner broke his gaze. "Nothing else to know yet, Mr. President. But with the country's top programmers and some lateral thinking, we hope to achieve communication with the disc. It just might be possible using our own supercomputer and the makeshift interface you see before you." "In the short then, Jim, all we know is that this disc is some kind of computer and it's extraterrestrial?" The President was looking for a summary of the situation, as usual. Hamner agreed, and appended an afterthought ruefully. "And that its designers were hundreds of years in advance of our own even when they built this thing. What level of civilisation must they have reached by now?" "We have not ascertained its origin then, Jim? No guesses, eh?" "It could have popped right out of a black hole for all we know, Mr. President." The President prepared to leave. The unimpressively small device had been playing havoc with his engagements. "Keep me posted," he barked. Five meaningless rows of characters flashed on to the supercomputer's screen. The President pulled back his chair and sat on it cowboy-style. For several minutes the two men watched the cyphered data incredulously, until the President became irritated by the regimented nonsense that paraded before him. Hamner was more calm. He lit his pipe and nodded knowingly. "We may not need those programmers after all, Mr. President. It looks like the disc has its own ideas about driving our computer." Still more jumbled tabulations marched across the screen but not a single meaningful word appeared. "Different civilisation, different language!" Hamner declared. "No interpreter I use can handle that lingo. Couldn't even pronounce it," said the President. "The disc could be trying to tell us something. How do we translate it?" "They're not words," Hamner laughed. "They're a kind of bastard, halfway translation. If we are patient, I think we might get to see something that'll really tax the imagination." By now, the entire scientific team had gathered around the computer. Security cameras were rolling already to record everything and a third computer running in the background was set up to record all data exchanges. Then, astonishment! A silent almost matter-of-fact conversion to intelligible read-out had taken place. The screen cleared, leaving these words: Good day. I am friend. Interface reconfigured at 1.5 percent resolution. Parallel bi-directional mode. Language algorithm 48 percent efficient. Therefore please re-educate on error. The President clawed his thinning hair in bewilderment. "Oh, it's nothing to do with our machine, sir. That's the disc speaking." Like any polite, unsolicited caller, the disc began to explain the reason behind its visit. My name translates Envoy Sixty. Planet of origin negative on translation to your language. Approximates: Blackstuff. Will relate celestial position once interface with your astronomy database affected. As yet insufficient data source for terminological translation. Read more. The scientists were still smiling at the disc's struggle with their illogical language when the President announced his suspicion that the whole thing was a hoax aimed at his administration. Defiantly, the screen cleared and began a fresh message. My journey: Two million your years. Velocity: Marginal sub-light speed. Purpose: Contact other civilisations. 100 launches total. Envoy Sixty targeted your galaxy. On arrival, local radio signals indicated high life probability this planet. Hamner signalled his assistant to organise the database linkups. "Get the astro-database laid on first. It'll take time to rotate through the billions of stars necessary to match a completely alien map of the universe with our own. The civilisation that spawned this machine observes the heavens from a totally different viewpoint and has different names for anything in it. It could even exist in space that's uncharted by us. There's a thought! There might be nothing to match!" "Then extend the general database. The disc's ability to communicate with us freely will depend upon its knowledge of our language, environment and culture." Hamner was clear about how he wanted the situation handled. He knew it was no hoax. For decades sensitive receivers had been listening for unnatural radio signals from outer space, signals which might have come from a distant civilisation. Latterly, the broadcasting of mathematical patterns had, so scientists claimed, given distant civilisations a greater chance of discovering they were not alone is this universe too. It was obvious the disc's creators had long since gone one stage further by launching numerous intelligent pods towards promising galaxies. They could not dispatch people, so instead they sent their most intelligent machines as envoys. Hamner sat at the keyboard and set down his pipe. The disc was doubtless loaded with fantastic information about a far-off people, their civilisation, technology and culture. He typed in a restrained question. Have you the means to notify your home planet of your discovery of life? The screen cleared for the reply, then came Affirmative. Nothing was added. Hamner tapped at the keyboard again. Have you notified your home planet that you have discovered life? Another word appeared casually below the last. Negative. Again there was no follow up. No explanation. The President offered his own explanation. "Maybe they don't wanna know back home two million years later. They've probably invented a faster way to travel and overtook the thing before it got here. There are enough UFO sightings to support that possibility." But Hamner was not satisfied. He typed in a simple question: Why not? These chilling words appeared on the screen: Launches were automatic. Last 42 were post-war. No one to notify. A great deal of silence filled the room. The President's bodyguards glanced at each other with rare animation. No one spoke: there is no suitable comment for such an occasion. Immediately the databases were on-line the visual display began to wriggle with merging stellar patterns. The disc had assumed control over the matching process and was throwing up observations of interest as it proceeded. "Looks like we've got a bright new boy on the team," the President said. The VDU patterns were reflecting in his eyes in the half-light. "It's a pretty versatile machine," Hamner agreed. The disc was simultaneously managing to access the general database. The scientist wandered across to the laboratory's small windows and gazed wistfully through the glass. Quite suddenly, the desire to know where Envoy Sixty came from, and to discovers what its creators actually looked like, was stronger than the desire to plunder its data bank. There seemed to be an element of bad taste in taking privileged information from a civilisation that had died since making the offer. But he was fatigued. Perhaps matters would assume different proportions after some sleep - whenever that would be. Then Hamner raised a stubby finger towards the sky. "My God!" The President was preoccupied reading aloud the facts coming up on the screen. "It says they called this galaxy M31 Nebula. The disc claims to come from a spiral galaxy like ours. And look! Apparently we have 150,000,000,000 suns out here." A fresh-faced young technician, awed by the President's company, stepped forward. "All galaxies have mind-boggling numbers of suns, Mr. President, sir. Each one at the centre of an entire planetary system. The numbers of planets involved is countless and the chances of life extreme." Hamner was still observing the sky. A shaft of light sprang across his sunken eyes as an immense golden orb climbed away from the city's jagged skyline, followed by a smaller sun that threw off an intense blue light. "I don't believe it!" Hamner grunted. "It's morning already." "And a beautiful one at that," the President added before returning his attention to the VDU. The young technician cleared his throat. "And of course, Mr. President, they're not all binary systems like ours." The President interrupted, "Ha! It now says a closer translation for the home planet is Earth. Cute name for a planet, don't you think, son?" The President cast his shadow across the glassy disc. "Well, old traveller, your home is Meeson now, and you're most welcome. Perhaps you'll help us avoid the same mistakes your folks made." ALL ABOUT SYSTEM VARIABLES by Richard Karsmakers Originally Published in ST NEWS Volume 1 Issue 2, launched on August 9th, 1986. Like any computer system, the ST has certain variables somewhere in memory for use by the operating system. It is possible to manipulate these variables, or to look at them to determine certain values, pointers or vectors in your system. But to do that, you'll have to know which variables are on which memory address. Therefore, I decided to write this article in ST NEWS, that includes a list of system variables with their functions. This list of ST BIOS system variables, together with their functions, are based on the chapter about system variables in the booklet "Hitchhiker's Guide to the BIOS" . etv_timer (long) $400 Timer handoff vector (logical vector $100) etv_critic (long) $404 Critical error handoff vector (logical vector $101) etv_term (long) $408 Process-terminate handoff vector (logical vector $102) etv_xtra (long) $40c Space for logical vectors $103 through $107 memvalid (long) $420 Contains the magic number $752019f3, which (together with 'memval2') validates 'memcntlr' and indicates a successful coldstart memcntlr (byte) $424 Contains the memory controller configuration nibble (the low nibble). Some popular values are: Memory Size Value 128K 0 512K 4 256K (2 banks) 0 1MB (2 banks) 5 resvalid (long) $426 If 'resvalid' is the magic number $31415926 on system RESET, the system will jump through 'resvector' resvector (long) $42a System RESET bailout vector, valid if 'resvalid' is a magic number. Called early-on in system initialization (before any hardware registers, including the memory controller configu- ration register, have been touched). A return address will be loaded into A6. Both stacks pointers will contain garbage phystop (long) $42e Physical top of RAM. Contains a pointer to the first unusable byte (i.e. $80000 on a 512K machine) _membot (long) $432 Bottom of available memory. The 'getmpb' BIOS function uses this value as the start of the GEMDOS TPA _memtop (long) $436 Top of available memory. The 'getmpb' BIOS function uses this value as the end of the GEMDOS TPA memval2 (long) $43a Contains the magic number $23769aa which (together with 'mem- valid') validates 'memcntlr' and indicates a successful cold- start flock (word) 43e Used to lock usage of the DMA chip. Should be nonzero to ensu- re that the OS does not touch the DMA chip registers during vertical blank. Device-driver writers TAKE NOTE: this variable MUST be nonzero in order to make use of the DMA bus seekrate (word) $440 Default floppy seek rate. Bits zero and one contains the de- fault floppy disk seek rate for both drives: 00 6ms 01 12ms 10 2ms 11 3ms (default) _timr_ms (word) $442 Sytem timer calibration (in ms). Should be $14 (20 decimal), since the timer handoff vector is called at 50hz. Returned by BIOS function 'tickcal', and passed on the stack to the timer handoff vector _fverify (word) $444 Floppy verify flag. When nonzero, all writes to floppies are read-verified. When zero, no write-verifies take place. The default state (after system-RESET) is to verify _bootdev (word) $446 Contains the device number the system was booted from. The BIOS constructs an environment string from this variable be- fore bringing up the desktop palmode (word) $448 When nonzero, indicates the system is in PAL (50hz video) mode. When zero, indicates the system is in NTSC (60hz video) mode defshiftmd (byte) $44a Default video resolution. If the system is forced to change from monochrome to a color resolution, 'defshiftmd' will con- tain the resolution the system will switch to sshiftmd (word) $44c Contains shadow for 'shiftmd' hardware register: 0 320x200x4 (low resolution) 1 640x200x2 (medium resolution) 2 640x400x1 (high resolution) _v_bas_ad (long) $44e Pointer to base of screen memory. Always on a 512 byte boun- dary. Always points to 32K of contiguous memory vblsem (word) $452 Semaphore to enforce mutual exclusion in vertical-blank interrupt handler. Should be "1" to enable vblank processing nvbls (word) $454 Number of longwords that '_vblsqeue' points to (on RESET, this value is 8) _vblsgeue (long) $456 Pointer to a vector of pointers to vblank handlers colorptr (long) $45a Pointer to a vector of 16 words to load into the hardware palette registers on the next vblank. If NULL, the palettes are not loaded. 'colorptr' is zeroed after the palettes are loaded screenpnt (long) $45e Pointer to the base of screen memory, to be setup on the next vblank. If NULL, the screen base is not changed _vbclock (long) $462 Count of vertical-blank interrupts _frclock (long) $466 Count of vertical-blank interrupts that were processed (not blocked by 'vblsem') hdv_init (long) $46a Vector to hard disk initialization. NULL if unused swv_vec (long) $46e The system follows this vector when it detects a transition on the "monochrome monitor detect" input (from low to high resolution or visa-versa). 'swv_vec' initially points to the system RESET handler; therefore the system will RESET if the user changes monitors hdv_bpb (long) $472 Vector to routine to return a hard disk's BIOS Parameter Block (BPB). Same calling conventions as the BIOS function for GETBPB. NULL if unused hdv_rw (long) $476 Vector to routine to read or write on a hard disk. Same cal- ling conventions as the BIOS function for RWABS. NULL if un- used hdv_boot (long) $47a Vector to routine to boot from hard disk. NULL if unused hdv_mediach (long) $47e Vector to routine to return a hard disk's media change mode. Same as BIOS binding for floppies. NULL if unused _cmdload (word) $482 When nonzero an attempt is made to load and execute COMMAND.PRG from the boot device (load a shell or an appli- cation instead of the desktop). Can be set to nonzero by a boot sector conterm (byte) $484 Contains attribute bits for the console system: Bit: Function: 0 nonzero: enable bell when ^G is written to CON: 1 nonzero: enable key-repeat 2 nonzero: enable key-click 3 nonzero: on BIOS conin() function, return the current value of 'kbdshift' in bits 24..31 of D0.L zero: leave bits 24..31 alone... themd (long) $48e Filled in by the BIOS on a 'getmpb' call; indicates to GEMDOS the limits of the TPA. The structure is: struct MD { MD *m_link; /* ->next MD [NULL] long m_start; /* start of TPA */ long m_length; /* size of TPA (bytes) */ PD *m_own; /* ->MD's owner [NULL] */ } ; The structure may NOT be changed once GEMDOS has been initia- lized. In addition, there may be only ONE of these suckers (you can't use the 'm_link' filed in the first MD). Someday (with a better GEMDOS) these limitations may be lifted savptr (long) $4a2 Pointer to register save area for BIOS functions _nflops (word) $4a6 Number of floppy disks actually attached to the system (0,1, or 2) sav_context (long) $4ae Pointer to saved processor context _bufl (long) $4b4 Two (GEMDOS) buffer-list headers. The first list buffers data sectors, the second list buffers FAT and directory sectors. Each of these pointers points to a Buffer Control Block (BCB) that looks like: struct BCB { BCB *b_link; /* next BCB */ int b_bufdrv; /* drive#, or -1 */ int b_buftyp; /* buffer type */ int b_bufrec; /* record# cached here */ int b_dirty; /* dirty flag */ DMD *b_dm; /* -> Drive Media Descriptor */ char *b_bufr; /* -> buffer itself */ } ; _hz_200 (long) $4bc Raw 200hz system timer tick. Used to divide-by-four for a 50hz system timer the_env (byte[4]) $4be The default environment string. Four bytes of $00.... _drvbits (long) $4c4 32-bit vector, returned by the 'drivemap' BIOS function (#10) of 'live' block devices. If any floppies are attached, this value is 3 _dskbufp (long) $4c6 Points to a 1024 byte disk buffer somewhere in the system's BSS. The buffer is also used for some GSX graphics operations and should not be used by interrupt routines _prt_cnt (word) $4ee Initialized to -1. Pressing the ALT-HELP key increments this. The screen dump code checks for $0000 to start imaging the screen to the printer, and checks for nonzero to abort it _sysbase (long) $4f2 Points to the base of the OS (in ROM or RAM) _shell_p (long) $4f6 Points to shell-specific context end_os (long) $4fa Points just past the last byte of low RAM used by the OS. This is used as the start of the TPA (end_os is copied into _membot) exec_os (long) $4fe This points to the shell that gets executed by the BIOS after system initialization is complete. Normally, this points to the first byte of the AES' text segment We hope to have supplied you with usefull information in this article. The system variables that are not mentioned are not certain yet, but as we get to know these, we will undoubtedly publish them in a future issue of ST NEWS. DISKMANIPULATION ON THE ATARI SF DISK DRIVES PART I by Richard Karsmakers Published originally in ST NEWS Volume 1 Issue 2, launched on August 9th, 1986. On of the most fascinating things to do with computers is communicating with external devices. These can be robots, miniature trains, other computer systems or disk drives. To communicate with most of these devices requires additional hardware, and some knowledge about how to communicate with them. Since most people have a disk drive with their ST's, one really cannot say that it is an additional device, and the knowledge needed is also fairly limited. So the disk drive turns out to be one of the easiest external devices to communicate with. That's what makes disk manipulating so interesting. With a little experience you might even be able to manipulate text strings in a program or data file, or even translate complete programs (what about a custom TOS or so?). In this article I will try to explain some of the basics of disk manipulating, to enable everyone to do simple disk manipulations. But look out, however, because manipulating disks can cause damage to your data! The first thing you must know, is how diskettes are devided in parts. On a regular formatted single sided disk, there are 80 tracks (numbered from 0 to 79 from the outside to the inside), that are split up into 9 sectors (numbered from 1 to 9) each. The Operating System treats two sectors as a so called cluster. Somewhere on a disk is a space reserved for the Operating System to use to determine which clusters are used and which clusters aren't. The space that is reserved therefore is located on the first track of the disk, and is called FAT, which is short for File Allocation Table. In each entry in the FAT there are values that determine whether a block is used, unused of damaged (bad data medium). When it is used, it contains the value that points to the next cluster that is used by the file, or a value that determines the "last cluster in a file". More about specific values later. The other part of a diskette that is usually very important, is the list of files included on it, called the directory. It contains information about file location, file size, date/time on which the file was created and file type. It is quite difficult to manipulate the directory, because the TOS uses calculations on bit-level instead of byte level. More about that later. Another part of the disk that is very important to the operating system is track 0 sector 1: the boot sector. It contains information about cluster size, density, number of sectors per track, number of sides per disk, etc. It might even contain a small machine language program (boot code) to read in a program after system RESET (this is done on the original version of Brataccas). The boot sector is MS/DOS V2.x compatible, and it makes the ST computer system very flexible. It is even possible to put the directory on another place on the disk, to redefine cluster size, redefine sector size, etc. In theory the ST disk drive can read any boot-sector compatible 3,5" disk with between 1 and 83 tracks, that may each have between 1 and 11 sectors. Some disk drives (like the ones of many 1040 ST's) might have alignment problems so that tracks with number 80 to 82 cannot be read properly. And nearly all disk drives have problems when using a disk with more than 10 sectors per track. A very nice program to experiment with these values is "820 KB Format" from Sputnik- Horror soft. You can redefine even the number of directory entries! In the next issue of ST NEWS I will explain more about exact values, positions, etc., and I will tell you how to produce your first successful disk manipulations. If you think you have had very nice/nasty experiences with disk manipulating, please contact me as soon as possible.... PREVIEW: GFA BASIC by Jos Schilders Originally published in ST NEWS Volume 1 Issue 2, launched on August 9th, 1986. GFA Basic is a new basic interpreter for the Atari ST computers. When I first read about it in magazines, I thought "this is the best basic I've ever seen". Now I have it, I can assure you, It is just as good, maybe even better as they say in the magazines. GfA Basic works with two screens. One is used to edit your program, the other one is for the output. There are no windows, (Altough you have commands to make them), so the editor and the output screen both scroll very fast. (Not like that f.cking ST Basic). The next thing that will catch your eye (when you load a demo) is that GfA Basic doesn't use line numbers. There's no need for them, because you need line numbers only for two things: to put a line between two other lines, and as a label for GOTO's and GOSUB's. Well, the GfA Editor works just like a wordprocessor. You can at any time insert lines in your basic program just by pressing [INSERT] at the beginning of a line. The screen will scroll one line down, and you can type your extra line. If you press [RETURN] afterwards, the whole screen is scrolled again, making it possible to add even 100 lines between two others if you wish, without having to touch a single extra key. The "problem" of the label is solved very nice: for a gosub, you type "PROC ANY_NAME" in front of the subroutine. GfA changes this to "Procedure ANY_NAME" Now you can call your routine with "GOSUB ANY_NAME". I don't know how it works with GOTO, but I also never needed to know it, if you know what I mean. For there is ONE big minus on GfA Basic: They forgot (?) the BREAK key... I've tried every button on my ST, but the only button that succeeded in breaking my program was that little key on the back... But if you change your GOTO into a While..Wend or Repeat..Until loop, and you use for example INKEY$<>" " OR MOUSEK<>0 as a condition, you can quit your program by pressing space or a mousekey. You can position the cursor with the cursor keys and the mouse:just like in 1st Word. The screen will scroll up or down if you reach the bottom or top of the screen. The bar with commands on top of the screen can be controlled by the mouse (by clicking on it) or with the fuction keys. (the lower bar normal, the upper bar with SHIFT). ESC brings you into DIRECT MODE. Any command you type now, will be executed immediately (just as in normal basic, when you type no line numbers). ESC [RETURN] brings you back on the edit screen. Now about some extraordinairy commands in GfA Basic. (But remember, I had a COMMODORE 64, So almost every command was new for me...) ALERT n,"TEXT | IN | BOX",d," Text | For | button",a This command display an alert box on the screen, with "TEXT | IN | BOX" in it, with three or less "buttons" in it, of wich "d" has a thick border ("Default", can be "pushed" with return), with "Text" in button 1, "For" in button 2 and "Button" in button 3. The program continues when the user clicks a button, and the answer (1, 2, or 3) is in the variable "a" (can be any variable, of course). Line X1,Y1,X2,Y2 Draws a line from X1,Y1 to X2,Y2. Box X1,Y1,X2,Y2 Draws a frame with X1,Y1 and X2,Y2 as coordinates Rbox X1,Y1,X2,Y2 Same as box, but now with rounded edges Circle X,Y,R Draws a circle with center X,Y and radius R. You can put a "P" in front of these four commands (Pbox for example). The shape will then be filled immediately. Next time possibly more about GfA Basic..... SOUND AND MUSIC PROGRAMMING ON THE ST by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 3, launched on August 16th 1986. Most people think that the ST's sound chip isn't really much, but it's not that bad at all; you'd better listen to the music in Epyx' "Winter Games" and you'll know that a lot more can be done with the ST's YM 2149 sound chip. All right, it's not as good as the Amiga soundchip, but that one works through a complete different principle; it "knows" a lot of sounds, which are kind of "digitized" inside its memory. When the programmer asks for it, it just spits it out with variable pitch, tone height, etc. People should also know that many Yamaha keyboards actually use the YM 2149 soundchip, like ICG's Yamaha PSR 40. The sound coming from that keyboard isn't bad at all! Some of us might remember the intro from Psygnosis' "Brataccas"; it uses nice sound effects, as well as something that might be described as "ring-modulation". It just shows that more can be done than most people think on the field of music. Back on the Commodore 64, some professional musicians started programming music on it, like Rob Hubbard. They knew how to make good music and they also knew the principles of programming the built-in SID soundchip. Other music programmers, like Martin Galway and Ben Dalglish, also knew what they had to do to make good music and sound effects on it. I am sure that good programmers might get almost as much out of the ST's sound chip as that they did on the SID. The Atari 800 XL is also said to have used the YM 2149 and I have heard of quite stunning music on those machines! Some of us already know that the ST system was originally designed around another sound chip, the "AMY". Instead of the AMY, Atari decided to build in the YM 2149 and the MIDI interface. Antiware's digital preprogrammed synthesizer sounds really great when using MIDI! But more about the AMY; here you will read a part of an interview with Atari's vice president of research and development, Shiraz Shivji. It is taken from a brochure of "Personal Computer World". When you want to get it, together with a software list of ST programs and lots more, please write to: SILICA Shop Ltd., 1-4 The Mews, Hatherley Road, Sidcup, Kent DA14 4DX, England. This part of the interview was made by BYTE's Phil Robinson, in December of last year....  BYTE: What about the sound capabilities? Shivji: We had a project here started during Alan Kay's tenure - a chip called AMY. And the ST was designed to have the AMY. But the AMY did not happen. We had silicon, the first pass, in October or November, and we had severe problems with it. It was kind of an orphan project. There were a lot of people that had worked on it. And if you have a chip that takes six or eight people who have worked on it at different times, the chances of the chip working are slim. But it's a good design. BYTE: What does it do? What's so special about it? Shivji: The approach of others is that during horizontal refresh you go out to some place and put some memory out automatically, and that goes through a DAC (digital to analog converter, RED)and you have sound. Essentially, you're sampling at 15.75 kHz, which is the typical frequency. So it's like a digital tape recorder. You have a digitized sound and you're just putting it out. And it needs enormous amounts of memory. The key is: how do you encode sound? Form an information-theoretic point of view, there are two problems with this approach. One is it's an enormous waste of memory. Because you could encode whatever sound you're going to play, as far as data is concerned in a sound piece, the data rate is extremely low. And doing it in the digital tape recorder way, you're wasting an awful lot of bandwidth and a lot of memory. The second problem with other implementations is that you have only 8 bits and it's not really that good. Especially with CD's coming out. Amy was a chip that had 16 bits of information coming out. So you could have 96 decibels of range. What you could hear! Amy was a complete digital sound chip. It's called an additive-digital synthesizer. It had an adder and 64 independent oscillators. It has a model for sound and you feed it the parameters. But if you do that you have to do an awful lot of preprocessing. We had hired a lot of people. We had a VAX 780 devoted to it. We had equipment, fast floating point array processors, and so on, to analyze notes. We would get a tape of piano playing and then the VAX would analyze it and would take the Amy model and give the parameters. To play anything you needed to have parameters tables and feed it to the chip. BYTE: Is it still a possibility, then? Shivji: It is still a possibility. We were going to have the Amy, and then it didn't happen. Then we said, look, we have a base machine that's a good machine. Every really doesn't care about great sound, right? (The ACC thinks Mr. Shivji went terribly wrong here! RED) So let's not penalize people that don't really care. Let's put something that will allow people who really care about sound to be able to play things . That's how the MIDI came in. And so if you get Amy, we would even have it out as a MIDI- chip. It's a great chip. Essentially all you do is load it up. Off line you're doing an analysis of all the different things, and then you have it in table form. And you can play it any time you want. And you're not using up the bus that much. BYTE: If it has that kind of processing capability, it probably could build models for voice, too. Shivji: Exactly. We actually could reproduce opera sound. As a matter of fact, we had a sound lab. The type of sound that you could hear from that chip was just incredible. Again, 16 bit. Actually, the chip could even give you 17 bits if you wanted it to. The problems are it uses too much memory and it hogs the bandwidth. The bandwidth you could probably get around. However, that's not the whole thing. You still have to move all that data around. Of course you don't get the right data at the right place for free. For example, you have to move it somehow from a disk drive. BYTE: So the Yamaha chip is there just to give it the basic sound?  Shivji: Yes. Just the basic sounds you need. Though, of course, the ports are very usefull (the YM 2149 in the ST has two 8 bit wide data ports, RED). Mr. Shivji didn't give all the reasons for not using the Amy in the ST; another reason was the manufacturer of the chip; he simply couldn't produce it in large enough volume. According to Data Becker's "ST Intern" (ISBN 3-89011-119-X; Data Becker GmbH, Merowingerstrae 30, 4000 Dsseldorf, West Germany), the YM 2149 sound chip is a "soundchip der spitzenklasse", so a very good soundchip. It is compatible with General Instruments' IC AY-3-8910, and it's called a PSG, which stands for Programmable Sound Generator. It has 40 pins. The qualifications of the YM 2149 are (in short) are written on the next page. - Three independent programmable tone-oscillators - A programmable noise-genarator - Complete software-controlled Analog output ports - Programmable mixer for tones and noises - Programmable waveforms - two bi-directional 8 bit dataports - TTL-Compatible - Simple 5 volts operating conditions The YM 2149 has 16 registers, whose functions are explained here: Registers 0 and 1: These registers determine the frequency of the tone signals coming from ANALOG A. Not all 16 bits are used; only all 8 bits of register 0 and the low 4 bits of register 1 are used. With the bits of register 1 one can determine the note roughly, while register 0 enables fine tuning. The total 12-bit value of these registers determines the height of the tone; the lower the value, the higher the tone. Registers 2 and 3: The functions of these registers are the same as those of registers 0 and 1, but now for channel B. Registers 3 and 4: The functions of these registers are the same as those of registers 0 and 1, but now for channel C. Register 6: This registers manipulates the noise generator with its lower 5 bits. Also here: the lower the value, the higher the noise fre- quency. Register 7: In this multi-function register, the individual bits determine different functions: Bit 0: Tone from channel A on (0) or off (1) Bit 1: Tone from channel B on (0) or off (1) Bit 2: Tone from channel C on (0) or off (1) Bit 3: Noise for channel A on (0) or off (1) Bit 4: Noise for channel B on (0) or off (1) Bit 5: Noise for channel C on (0) or off (1) Bit 6: Port A is an output (1) or input (0) port Bit 7: Port B is an output (1) or input (0) port Register 8: The lower 4 bits determine the volume of the signal coming from channel A. Bit 4 has a special meaning. When it set (also, when it is 1), the volume is determined by the waveform register. Bits 0 to 3 (also the lower 4 bits) are then ignored. Register 9: Just like Register 8, but now for channel B Register 10: Just like Register 8, but now for channel C Registers 11 and 12: All 16 bits of these registers determine the length of the waveform. The contents of register 11 are treated as a low byte, that of register 12 as the high byte. Register 13: Bits 0 to 3 (agains the lower 4 bits) of this register are used to determine the waveform of the waveform-generator as follows: B3 B2 B1 B0 Waveform: 0 0 - - \__________________ 0 1 - - /__________________ 1 0 0 0 \\\\\\\\\\\\\\\\\\\ 1 0 0 1 \__________________ 1 0 1 0 \/\/\/\/\/\/\/\/\/\ 1 0 1 1 \------------------ 1 1 0 0 /////////////////// 1 1 0 1 /------------------ 1 1 1 0 /\/\/\/\/\/\/\/\/\/ 1 1 1 1 /__________________ Registers 14 and 15: These registers belong to the two 8-bit ports. Port A has register 14, whereas port B has register 15. Is a port programmed for output (see bits 6 and 7 of register 7), then the value to be put out can be determined by these registers. This is the same as they are programmed for input. So....now we know everything there is to know about the YM 2149 sound chip in the ST systems. But how can the soundchip be controlled from BASIC (the language most people regularly use)? To achieve sound in BASIC, it has two commands: SOUND and WAVE. SOUND isn't really difficult to understand: it needs five parameters to go with it, seperated by a comma: SOUND register, volume, note, octave, length The register can be 1,2 of 3, for channel A,B and C respectively. The volume is determined by 4 bits, so this value can be between 0 and 15 (15 is the maximal volume). The value for the note can be between 1 and 12 (I suppose there are 12 notes in each octave), whereas the value for the octave can be between 1 and 8 (because the YM 2149 has 8 octaves). The length of the note can be between 0 and 255. "1" stands for 1/50 of a second. Now the WAVE command....that's more difficult, but not too difficult if you've read the register-part of this article. The WAVE command also needs five parameters, seperated by a comma: WAVE channel, determine, waveform, period length, length Through the "channel" parameter you can determine which channels should be on, and to which channels noise should be added. You must look at this parameter binary; it sets or clears bits 0-5 in register 7. An example: value 37 (that is binary %100101) does the following: you have to know that when a bit is cleared in register 7, the actual channel is activated. In the WAVE command, you have to set the bits to set the channels (and to clear register 7). You see that bits 0,2 and 5 are set with the value 37. This means that channels A and C are activated, while noise is added as well to the latter channel (channel C). Get it? Now, let's go on with the second parameter. That determines whether the volume is set by the volume parameter in the SOUND command, or by the waveform in the WAVE command (that way, the volume differs during the whole note). So it sets or clears bits 4 of registers 8 to 10. This parameter also has to be treated as a binary value of three bits - so the range would be between 0 and 5. Bit 0 of this value is for channel A, bit 1 for channel B and - of course - bit 2 is for channel C. If a bit is cleared, the volume of the corresponding channel is determined by the SOUND command for that channel. When a bit is set, however, the waveform determines the volume. So a value of 0 lets all volumes be determined by the SOUND commands. The third parameter affects register 15 (see the above), to enable the programmer the choose from 16 waveforms (so the value of this parameter will be between 0 and 15). Look at these waveforms above and you will have to experiment a little, too. The fourth parameter determines the length of a period (vibration) of a musical note. It can be between 0 and 65535, where you might get additional frequencies of the value choosen turns out to be smaller than about 1000. Remember: the shorter the period, the higher the frequency! The fifth parameter, to close this part of this article, determines - like the SOUND command - the total length of the note. I suppose this value can also be between 0 and 255. We hope to have told you all you need to know for programming sound on the Atari ST's sound chip. If you think you have made a terrific piece of music (better than "Temple Trilogy", "Brataccas", etc.), please let us know. If it's not too big, we might even publish the source code (or BASIC listing) in a future issue of ST NEWS....  ALL ABOUT THE BIOS by Cronos Originally published in ST NEWS Volume 1 Issue 3, launched on August 16th, 1986. As most of you will know, the word BIOS is short for Basic Input/Output System. One could call it the interface between GEMDOS and the hardware. Before I start talking about all the BIOS functions, you should know a few things: Data should be given to the stack before you call a BIOS function Sometimes, return values are put into D0 Except for registers D0-D2 and A0-A2 will all register stay intact For the BIOS functions, TRAP number 13 was reserved Most information used in this article is used from "The Hitchhiker's Guide to the BIOS", 1985 by Atari, Inc. You can now read a systematic list of BIOS calls: their numbers, names and functions..... (0) getmpb VOID getmpb(p_mpb) LONG p_mpb; Upon entry, 'p_mpb' points to a 'sizeof(MPB)' block to be filled in with the system initial Memory Parameter Block. Upon return, the MPB is filled in. (1) bconstat WORD bconstat(dev) WORD dev; Returns character-device input status, D0.L will be $0000 if no characters are available, or $FFFF if (at least one) character is available. 'dev' can be one of these: 0 PRT: printer, the parallel port 1 AUX: aux device, the RS232 port 2 CON: console, the screen 3 MIDI: the midi interface 4 KBD: keyboard Legal operations on character devices are: (0) (1) (2) (3) (4) Operation PRT AUX CON MIDI KBD ---------------------------------------------------------------- bconstat() no yes yes yes no bconin() yes yes yes yes no bconout() yes yes yes yes yes bcostat() yes yes yes yes yes (2)bconin WORD bconin(dev) WORD dev; 'dev' is the character device number described in function 1. This does not return until a character has been input (busy-wait). It returns the character value in D0.L, with the high word zero (in case you don't know what a word is: it's 2 bytes = 16 bits, RED). For the console (CON: device 2) it returns the IBM-PC compatible scancode in the low byte of the upper word, and the Ascii character in the low byte of the low word. If bit 3 in the system variable 'conterm' is set, then the high byte of the upper word will contain the value of the system variable 'kbdshift' for that keystroke. Normally, bit 3 of 'conterm' is not set (0). If you want to know more about system variables, please read the article about system variables in ST NEWS Volume 1 Issue 2.  (3) bconout VOID bconout (dev,c) WORD dev, c; 'dev' is the character device number described in function 1. Output character 'c' to the device. Does not return untill the character has been written. (4) rwabs LONG rwabs(rwflag,buf,count,recno,dev) WORD rwflag; LONG buf; WORD count, recno, dev; Read or write logical sectors on a device. 'rwflag' is one of: 0 read 1 write 2 read, do not affect media change 3 write, do not affect media change 'buf' points to a buffer to read or write to (unaligned transfers - on odd boundaries - are permitted, but they are slow). 'count' is the number of sectors to transfer. 'recno' is the logical sector number to start the transfer at. 'dev' is the device number, which can be one of: 0 floppy drive A 1 floppy drive B (or 'logical' drive A on single-drive systems) 2+ hard disks, networks, etc. On return, OL indicates a succesful operation. Any negative number indicates an error condition. (It is the responsibility of the BIOS to detect media changes, and return the appropriate error code) Modes 2 and 3 force a physical disk operation that will NOT affect the media change, nor result in one (this allows the GEMDOS disk formatter, for instance, to read and write logical sectors after formatting a disk, and still allow the BIOS to recognize a media change on the volume just formatted). (5) setexc LONG setexc(vecnum,vec) WORD vecnum LONG vec; 'vecnum' is the number of the vector to get or set. 'vec' is the address to setup in the vector slot; no set is done if 'vec' is - 1L. The vector's previous value is returned. Vectors $00 through $FF are reserved for the 68000. Logical vectors $100 through $1FF are reserved for GEMDOS. Vectors currently implemented are: $100 System Timer Interrupt $101 Critical Error Handler $102 Process terminate hook $103-$107 Currently unused, reserved Logical vectors $200 through $FFFF are reserved for OEM use. The ST BIOS makes no provision for these. (6) tickcal LONG tickcal() Returns a system-timer calibration value, to the nearest millisecond. This is a silly function, since the number of elapsed milliseconds is passed on the stack duyring a system-timer trap. (7) *getbpb BPB *getbpb(dev) WORD dev; 'dev' is a device number (0 for drive A, etc.). Returns a pointer to the BIOS Parameter Block for the specified drive, or 0L if (for some reason) the BPB cannot be determined. (8) bcostat LONG bcostat(dev) 'dev' is a character device number, as in function 1. Returns the character output status: -1 Device is ready to send (no waiting on next device output call) 0 Device is not ready to send (9) mediach LONG mediach(dev) WORD dev 'dev' is a drive number. Returns are on of these: 0 Media definately has not changed 1 Media might have changed 2 Media definately has changed GEMDOS will respond with a return value of "1" with a read operation. If the BIOS detects an absolute media change, it will return a "media change error" at that time. (10) drvmap LONG drvmap() Returns a bit-vector that contains a "1" in a bit position (0...31) when a drive is available for that bit, or a 0 if there is no drive available for that bit. Installable disk drivers must correctly maintain the longword '_drvbits' (see the chapter about system variables in ST NEWS volume 1 issue 2). (11) kbshift LONG kbshift(mode) WORD mode If 'mode' is non-negative, sets the keyboard shift bits accordingly and returns the old shift bits. If 'mode' is less than zero, returns the IBM-PC compatible state of the shift keys on the keyboard, as a bit-vector in the low byte of d0. Bit assignments are: 0 Right shift key 1 Left shift key 2 Control key 3 ALT key 4 Caps-lock 5 Right mouse button (CLR/HOME) 6 Left mouse button (INSERT) 7 (reserved, currently zero) That's all for this time; next time more about GEMDOS... THE SOLUTION TO "ZORK I" FROM INFOCOM by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 3, launched on August 16th, 1986. In our series of adventure solutions (we hope there will be more to come! If you have any, please send them on disk file to our correspondence address; read "Questions and Answers" to know the correct format to send it in to) we hereby present to you the solution of the text adventure "Zork" from the American software house Infocom...... N/N/U/GET EGG/D/S/E/OPEN WINDOW/W/OPEN SACK/GET GARLIC/W/GET LAMP/ E/U/LIGHT LAMP/GET ROPE/GET KNIFE/D/DOUSE LAMP/W/GET SWORD/MOVE RUG/OPEN TRAPDOOR/D/LIGHT LAMP/N/KILL TROLL WITH SWORD/E/E/SE/E/TIE ROPE TO RAILING/D/DOUSE LAMP/GET TORCH/D/S/DROP SWORD/GET CANDELS/DOUSE CANDELS/GIVE EGG TO THIEF/GET BOOK/N/GET BELL/E/OPEN COFFIN/GET SCEPTRE/W/S/PRAY/E/S/E/W/W/READ BOOK/TURN PAGE/DROP ALL EXCEPT TORCH AND LAMP/OPEND TRAPDOOR/D/N/E/E/SE/E/D/ D/D/GET COFFIN/U/S/PRAY/E/S/E/W/W/OPEN CASE/PUT COFFIN IN CASE/GET BOOK/GET BELL/GET CANDLES/D/S/E/GET PAINTING/W/N/N/E/E/E/ECHO/GET BAR/U/E/N/DROP PAINTING/GET MATCHBOOK/S/S/D/W/S/S/E/D/RING BELL/GET CANDLES/LIGHT MATCH/LIGHT CANDLES WITH MATCH/READ PRAYER/ DROP MATCHBOOK/DROP CANDLES/DROP BOOK/S/GET SKULL/N/U/N/N/N/W/W/S/ U/PUT SKULL IN CASE/PUT BAR IN CASE/D/N/W/W/W/U/GET KNIFE AND BAG/ SW/E/S/SE/ODYSSEUS/E/E/PUT BAG IN CASE/DROP RUSTY KNIFE/D/N/E/E/N/ NE/E/D/GET PILE/U/N/N/GET SCREWDRIVER/GET WRENCH/PRESS RED BUTTON/ PRESS YELLOW BUTTON/S/S/TURN BOLT WITH WRENCH/DROP WRENCH/W/W/E/N/ GET TRUNK/S/SW/S/S/W/W/S/U/PUT TRUNK IN CASE/DROP PILE/DROP SCREWDRIVER/D/N/E/E/S/S/TOUCH MIRROR/E/D/GET TRIDENT/S/GET PUMP/S/ S/SW/S/S/W/W/S/U/PUT TRIDENT IN CASE/GET SCEPTRE/GET PILE/D/N/E/E/ E/E/E/DROP PILE/INFLATE PILE/DROP PUMP/GET LABEL/READ LABEL/DROP LABEL/THROW SCEPTRE IN BOAT/ENTER BOAT/LAUNCH/GET SCEPTRE/WAIT/GET BUOY/WAIT/LAND/GET OUT OF BOAT/N/OPEN BUOY/GET EMERALD/DROP BUOY/ GET SHOVEL/NE/DIG SAND/DIG SAND/DIG SAND/DIG SAND/DROP SHOVEL/GET SCARAB/SW/S/S/WAVE SCEPTRE/W/W/GET POT/SW/U/U/NW/W/W/W/PUT SCEPTRE IN CASE/PUT POT IN CASE/PUT EMERALD IN CASE/PUT SCARAB IN CASE/GET RUSTY KNIFE/GET NASTY KNIFE/W/W/U/KILL THIEF WITH NASTY KNIFE/GET PAINTING/GET EGG/DROP RUSTY KNIFE/DROP NASTY KNIFE/GET CHALICE/D/E/E/PUT PAINTING IN CASE/GET CANARY/PUT CHALICE IN CASE/ PUT EGG IN CASE/E/E/N/N/E/WIND CANARY/GET BAUBLE/W/S/E/W/W/PUT CANARY IN CASE/PUT BAUBLE IN CASE/GET SCREWDRIVER/GET GARLIC/D/N/ E/E/S/S/TOUCH MIRROR/N/W/N/W/N/E/PUT TORCH IN BASKET/PUT SCREWDRIVER IN BASKET/LIGHT LAMP/N/D/E/NE/SE/SW/D/D/S/GET COAL/N/U/U/N/E/S/N/U/S/PUT COAL IN BASKET/LOWER BASKET/N/D/E/NE/ SE/SW/D/D/W/DROP ALL/W/GET ALL FROM BASKET/S/OPEN LID/PUT COAL IN MACHINE/CLOSE LID/TURN SWITCH WITH SCREWDRIVER/OPEN LID/GET DIAMOND/N/PUT DIAMOND IN BASKET/PUT TORCH IN BASKET/E/GET LAMP/GET GARLIC/E/U/U/N/E/S/N/GET BRACELET/U/S/RAISE BASKET/GET ALL FROM BASKET/W/GET FIGURINE/S/E/S/D/DROP GARLIC/U/PUT DIAMOND IN CASE/PUT TORCH IN CASE/PUT BRACELET IN CASE/PUT FIGURINE IN CASE/LOOK/GET MAP/EXAMINE MAP/E/E/N/W/SW/W That's it for today, folks! DISKMANIPULATION ON THE ATARI SF DISK DRIVES PART II by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 3, launched on August 16th 1986. In the previous issue of ST NEWS, I have told you some basic things you need to know when you start disk manipulating. In this issue, I'll talk about some specific data and things you'd also need to know if you start manipulating.... First, let's talk a bit about the File Allocation Table or FAT (for people who owned a Commodore 64 before: this can be compared with the Block Availability Map or BAM on the 1541 disk drive). Normally, each FAT entry is 12 bits in size. It can contain several values: $000 Cluster unused $FF7 Cluster unusable, mostly because of bad medium $FFF Last cluster in a file other Number of the next cluster in a file Clusters are numbered starting at two, and each cluster normally represents two sectors (so 1024 bytes). Now you know the reason why a 2-byte file takes up a whole kilobyte on disk.... Now the directory. Each directory entry is 32 bytes in size, which are divided as follows: 1- 8 Filename 9-11 File extension 12 File attribute 13-22 Unused/Reserved 23-24 Time 25-26 Date 27-28 Number of the first cluster of a file 29-32 Size in bytes The filename can have upto 8 characters in it, if which nearly all letters, etc. are possible. First Word has difficulties reading filenames with german characters, etc. in it, and the following characters can (may) never be used in a filename: []()<>=*&,!|?/\$.:;+- The filename extension cannot be carelessly manipulated, since it determines whether a file can be run or only shown/printed. The following extension have special meaning (or can have special meanings): PRG A regular program, that can use GEM. Can be run TOS A program that doesn't use GEM (mouse pointer disappears). Can be run TTP A program where TOS Takes Parameters (TTP), e.g. an assembler, where the source file has to be specified. This can now be done in a box IMG This is normally the extension of a TOS on disk, but is also used in games like "X-TRON", a database called "Zoomracks" and the digitized music demo's from the Desaster Area (Oxygen & Foreign Affair) SYS This is the extension of a program called "ASSIGN", usually present on drawing programs like Easy Draw, Gem Paint, etc. te determine whether the program runs in monochrome or co- lor resolution ACC (This is no advertisement) Provided that a pro- gram has the format of a desk accesory, up to five of these files can be loaded at sys- tem BOOTing to become desk accesories DOC The extension of a First Word text file, but can be used otherwise as well TXT Usually a text file ONE The extension of a DB Master One data file ZRX The extension of a Zoomracks data file APP I don't know exactly what this does... ??? Only PRG, TOS, TTP and APP can be loaded.... Now the attributes. What exactly is a file attribute? It is a byte that uses several of its bits to determine certain status- qualities. For example, there's a read-only status, a hidden status, and some more. The bits are located as follows: Bit 0: Read only Bit 1: Hidden Bit 2: System Bit 3: Volume Bit 4: Subdirectory Bit 5: Archive bit (hard disk only: written to & closed) The read-only attribute seems quite clear: if the specific bit is set, it is not possible to delete or rename the file. The use of both hidden-and system attributes still have to be explained to me, but they take care that a file isn't shown an a regular directory. How it is readable, that's a mystery to me (doesn't that remember you to a certain song?!?). The volume label is set if a file is no file but the name of a disk (the disk label). The subdirectory attribute is set if a file (again!) is no file, but a subdirectory, better known as a folder. The TOS doesn't read it, but opens a subdirectory somewhere else on the disk if it's clicked. You'd better stay out of the unused/reserved bits; you never know what people might do with these (may be even as part of some clever protection scheme!). Both time and date are quite difficult to calculate, since you'll have to process individual bits. The two time-bytes are divided as follows: Bit 0-4 Seconds Bit 5-10 Minutes Bit 11-15 Hours You'll have to multiply the seconds you get with two to get the proper time! The date bytes are divided as follows: Bit 0-4 Day Bit 5-8 Month Bit 9-15 Year Here, you'll have to add 1980 to the value of "year".... That's all folks, for this issue of ST NEWS. Next time, we might go and have a look at some specific disk manipulation. See ya! ALL ABOUT XBIOS FUNCTIONS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. 16 keytbl Example: move.l capslock,-(sp) move.l shift,-(sp) move.l normal,-(sp) move.w #16,-(sp) trap #14 addq.l #14,sp This function enables you to redefine the keyboard tables (3 in all). Therefore, you'll have to specify the addresses on which the tables are located for normal keys ('normal'), keys with Shift ('shift') and keys with Caps Lock ('capslock'). Each table must be 128 bytes in length. The function returns the pointer to a table in which all three vectors are written. If one of the keyboard tables should not be changed, you should specify -1 instead of the memory address. The tables are scanned through the key-scancode and they will result in giving the ASCII-code belonging to that key. 17 random Example: move.w #17,-(sp) trap #14 addq.l #2,sp This function returns a 24-bit random number. Bits 24-31 will be 0 (cleared). At each call of this function, one will get a different random number. At each system power-up, another starting-value will be generated.  18 protobt Example: move.w execflag,-(sp) move.w disktype,-(sp) move.l serialnr,-(sp) move.l buffer,-(sp) move.w #18,-(sp) trap #14 add.l #14,sp This function enables you to create a boot sector. The boot sector is located on track 1, sector 0 and tells to TOS all kinds of things about the disk format, e.g. disk type. If this boot sector is set to be executable, the Operating System can be loaded. With this function you can change or create a boot sector. 'execflag' is used to specify if the boot sector is executable or not: 0 Not executable 1 Executable -1 The boot sector stays like it was 'disktype' can have one of the following values: 0 40 tracks, single sided (180K) 1 40 tracks, double sided (360K) 2 80 tracks, single sided (360K) 3 80 tracks, double sided (720K) 'serialnr' is a 24-bit serial number, that will be written into the bootsector. This serial number is supposed to be never the same on any disk, and TOS therefore uses it to check if a disk is changed. If you specify a value larger than 24 bits (e.g. $01000000), a random serial number will be created with function number 18 (see previous page). If it's -1, the serial number will not be changed. In this part of the disk, a serious error can be found. For example, when one formats a disk with the program "ST Happy + Maxiformatter" it will always have the same serial number. If you have for instance opened a folder, and if you change a disk and then hit the ESC key, you will get a garbled directory (which can cause a system crash sometimes). Normally, you'd get an empty directory. 'buffer' is the pointer to a 512-byte buffer, located somewhere in memory, that contains the contents of the boot sector to be written. A bootsector is normally built up like this: Address: 80 Track SS: 80 Track DS: 0-1 Branch-instruction on boot-code if executable 2-7 'Loader' 8-10 24-bit serial number 11-12 BPS 512 512 13 SPC 2 2 14-15 RES 1 1 16 FAT 2 2 17-18 DIR 112 112 19-20 SEC 720 1440 21 MEDIA 248 249 22-23 SPF 5 5 24-25 SPT 9 9 26-27 NSIDE 1 2 28-29 NHID 0 0 30-31 EXECFLG 32-33 LDMODE 34-35 SSECT 36-37 SECTCNT 38-41 LDADDR 42-45 FATBUF 46-56 FNAME 57 (Reserved) 58-509 BOOTIT Code 510-511 CHECKSUM 'Loader' is for use with several programming tools, to enable them to recognize a Loader boot sector. 'BPS' is the number of bytes per sector. Normally, this is 512 bytes but it can also be 1024 bytes or another value. 'SPC' is the number of sectors per cluster. Normally, this is 2, but it is possible to format a disk so that it is 1 or maybe 3 or more. The smaller the number, the more economical is disk usage (with a value of 2, 2*512=1024 bytes are allocated even for a 1- byte file!). 'RES' is the number of reserved sectors at the beginning of the disk, including the boot sector. 'FAT' is the number of FATs (File Allocation Tables; one can compare it with the Block Availability Map or BAM on the Commodore 1541 disk drives) on a disk. The more FATs, the safer is your data on the disk. But it takes quite a lot of space as well. 'DIR' is the maximal number of directory entries on a disk. A directory entry is any entry on the disk's root directory (so all the names that appear on a disk drive window once you've opened it, including the folders). 'SEC' is the total number of sectors on your disk. 'MEDIA' is the Media Descriptor Byte. ST BIOS doesn't use this byte, but other file systems might! 'SPF' is the number of sectors that are included in each FATY entry (read more about the FAT in previous issues of ST NEWS - the articles about disk manipulation in issues 2 and 3). 'SPT' is the number of sectors per track. This value is normally 9, but can range from 0 to 11 theoretically (1 to 10 practically). 'NSIDE' is the number of sides on the disk. Logically, this will be 1 on any single-sided disk, and 2 on any double sided disk. 'NHID' is the number of "Hidden" sectors on the disk. ST BIOS ignores this value for floppies. 'EXECFLG' is a word that is copied to the system variable _cmdload. As you could have read in ST NEWS Volume 1 Issue 2, when this system variable is set to 0, the desktop will appear after booting. If set to nonzero, TOS will try to load an application (DOS shell, etc.) first. An example of an application is the Command Shell of Atari. The file must be called COMMAND.PRG. 'LDMODE' specifies the load mode. If it is zero, the file with the name 'FNAME' will be loaded and executed. If 'LDMODE' is nonzero, however, 'SECTCNT' sectors (starting at logical sector number 'SSECT') will be loaded and executed. 'SSECT' is the logical sector number to start loading from. This value is only useful when 'LDMODE' is nonzero. 'SECTCNT' is the number of sectors to load. Like 'SSECT', this value is only useful when 'LDMODE' is nonzero. 'LDADDR' is the memory-address on which a file (or sectors) will be loaded. In case of TOS on disk, this will be $40000. 'FATBUF' points to a memory location where the FAT-and directory sectors can be put. 'FNAME' is the filename of the file that will be loaded when 'LDMODE' equals zero. It consists of the normal eight characters of the name, together with three characters for the file extension. 'BOOTIT' is bootcode. Because the bootsector is MS-DOS 2.x compatible, all 16-bit words are written in 8086-format: Low-byte first, High-byte second. 19 flopver Example: move.w count,-(sp) move.w side,-(sp) move.w track,-(sp) move.w sector,-(sp) move.w device,-(sp) clr.l -(sp) move.l buffer,-(sp) move.w #19,-(sp) trap #14 add.l #20,sp This function enables you to verify one or several sectors of a disk. The sectors will be read from disk and compared with the contents of a buffer. The parameters have the same meaning as those explained by the commands to read or write sectors. When the contents of the buffer are the same as the contents of the sectors, the function returns the value 0. When an error occurs, you will find that (as a negative value) in D0. The error codes are explained by the function 'floprd'. When it turns out that one or more sectors do not match with the buffer contents, you will be able to find a list of bad sectors in the buffer you specified, each as a longword. The last sector number will be marked by a zero after it. When you use the BIOS function 5 (rwabs), and when the system variable _fverify is set (that is the variable at location $444), sectors are automatically verified. 20 scrdmp Example: move.w #20,-(sp) trap #14 addq.l #2,sp This function makes it possible to make a screen hardcopy on a printer that is hooked up to your ST. Thereby, XBIOS uses the pre- set printer parameters. This function can be called at any time by simultaneously pressing ALTERNATE and HELP or choosing "Print Screen" from the Desktop ("Options"). 21 cursconf  Example: move.w rate,-(sp) move.w function,-(sp) move.w #21,-(sp) trap #14 addq.l #6,sp This function can specify the function of the cursor (in case you didn't know: that's the small black rectangle somewhere on the screen of you're working with First Word (Plus)). 'function' can have one of the following values: 0 Turn cursor off 1 Turn cursor on 2 Flashing cursor 3 Non-flashing cursor 4 Set cursor flash-rate 5 Get cursor flash-rate The value of 'rate' depends on if you're using a monochrome-or a color video display. With a monochrome monitor this is 70 Hz, whereas this value if 50 Hz for color monitors. When you want to change the flash-rate, only then you'll have to use the 'rate' parameter. Example: you can specify 30 if you want the cursor to invert after every 30/70th second on a monochrome monitor or every 30/50th second on a color display. 22 settime Example: move.l time,-(sp) move.w #22,-(sp) trap #14 addq.l #6,sp This function enables you to set the date and time of the system. Therefore you must set up the longword like this: Bit 0- 4 Seconds/2 Bit 5-10 Minutes Bit 11-15 Hours Bit 16-20 Day 1-31 Bit 21-24 Month 1-12 Bit 25-31 Year 0-119 (minus Offset 1980) 23 gettime Example: move.w #23,-(sp) trap #14 addq.l #2,sp This function returns the current date and time of the system in D0.  24 bioskeys Example: move.w #24,-(sp) trap #14 addq.l #2,sp If you have changed the keyboard table(s) with XBIOS 16 (keytbl), this function enables you to get back to the standard key tables. It is handy if you call this routine after ending your own program that uses another keyboard table. 25 ikbdws Example: move.l pointer,-(sp) move.w quantity,-(sp) move.w #25,-(sp) trap #14 addq.l #8,sp This function allows you to send commands to the keyboard processor. 'pointer' is the address of a string that contains the commands. 'quantity' is the number of bytes in the string, of which 1 must be substracted. 26 jdisint Example: move.w number,-(sp) move.w #26,-(sp) trap #14 addq.l #4,sp This function allows the user to halt an interrupt of the MFP 68901 processor. 'number' is the number of the interrupt, from 0 to 15. These are the Interrupts of the MFP 68901 processor: 0 Centronics Busy 1 RS232 DCD 2 RS232 CTS 3 Unused 4 RS232 Baudrate generator, Timer D 5 Timer C 6 Keyboard and MIDI ACIAs 7 Floppy Controller and DMA 8 Linefeed counter, Timer B 9 RS232 Sending error 10 RS232 Sending buffer empty 11 RS232 Receivance error 12 RS232 Receivance buffer filled 13 System Clock Timer A 14 RS232 Ring Indicator 15 Monochrome Monitor Detect For more information about interrupt levels, etc., please refer to pages 268-274 in "ST Intern", chapter 3.5.1.  27 jenabint Example: move.w number,-(sp) move.w #27,-(sp) trap #14 addq.l #4,sp This function is the opponent to the 'jdisint' function described above. It is used to enable a MFP Interrupt again. 'number' is the number of the interrupt level to reactivate. See above for a list of MFP Interrupt levels. 28 giaccess Example: move.w #register,-(sp) move.w #data,-(sp) move,w #28,-(sp) trap #14 addq.l #6,sp This functions lets you access the GI-soundchip. 'register' must be the soundchip's register number, ranging from 0 to15. Bit 7 of the register number specifies if the register should be read from or written to: 0 Read 1 Write If you want to write to a register, 'data' will have to contain the 8-bit value of the code to write. When this function is used to read the register with the specified number, you get the value of that register. 29 offgibit Example: move.w #bitnumber,-(sp) move.w #29,-(sp) trap #14 addq.l #4,sp This function sets a selected bit in port A of the Soundchip. The individual bits have the following meaning: 0 Floppy Select side 0/side 1 1 Floppy Select drive A 2 Floppy Select drive B 3 RS232 RTS (Request to Send) 4 RS232 DTR (Data Terminal Ready) 5 Centronics Stobe 6 General Purpose Output 7 Unused 30 ongibit Example: move.w #bitnumber,-(sp) move.w #30,-(sp) trap #14 addq.l #4,sp This function clears s selected bit in Port A of the Soundchip. The bitnumbers have the same meaning as described above.  31 xbtimer Example: move.l vector,-(sp) move.w fata,-(sp) move.w control,-(sp) move.w timer,-(sp) move.w #31,-(sp) trap #14 add.l #12,sp With this function one can start an MFP Timer, and specify an Interrupt routine for it. 'timer' is the number of the timer in the MFP: 0 Timer A 1 Timer B 2 Timer C 3 Timer D 'data' and 'control' are the values that will be given to the specified timer's data-and control-registers. Have a look at any MFP 68901 hardware description concerning that. 'vector' is the address of the interrupt routine that belongs to the specified timer. The four timers of the MFP are partly used by the system already: A Reserved for the user B Horizontal Blank Counter C 200 Hz system Timer D RS232 Baudrate-generator (the vector belonging hereto is free) 32 dosound Example: move.l pointer,-(sp) move.w #32,-(sp) trap #14 addq.l #6,sp This function enables the user to comfortable use sounds. 'pointer' has to point to a string of sound-commands. These commands may be used. Commands $00-$0F These commands are interpreted as register numbers, always to be followed by a byte that will be loaded in the corresponding register. Command $80 This command is followed by an argument that will be loaded in a temporary register. Command $81 This command must be followed by three arguments. The first one must be the soundchip register number in which the contents of the temporary will be copied. The second argument is a values that complements that value. The command reaches its end when the third byte (the end criterium) is equal to the contents of the temporary register. Commands $82-$FF These commands are always to be followed by one more argument. When that argument equals zero, sound processing will be cut off. When it isn't it specifies the number of timerticks (20ms, 50Hz) that pass until the next sound processing occurs.  33 setprt Example: move.w config,-(sp) move.w #33,-(sp) trap #14 addq.l #4,sp This function makes it possible to change or read the printer configuration. When 'config' is -1, the configuration is read, otherwise 'config' is installed as printer configuration. The individual bits in 'config' have the following meaning: 0 Matrixprinter (0) or Daisywheel printer (1) 1 Color Printer (0) or Monochrome printer (1) 2 ATARI printer (0) or Epson printer (1) 3 Test mode (0) or Quality mode (1) 4 Centronics port (0) or RS232 port (1) 5 Tractorfeed (0) or Single sheet (1) 6-14 Reserved 15 Always 0 34 kbdvbase Example: move.w #34,-(sp) trap #14 addq.l #2,sp This function returns the pointer to a table of vectors that contains the addresses to certain routines that handle the keyboard processor. It is built up like this: long midivec MIDI input long vkbderr Keyboard error long vmiderr MIDI error long statvec IKBD status long mousevec Mouse-routines long clockvec Time routines long joyvec Joystick routines (have a look at this issue's "Question & Answers for more information about this) 'midivec' points to a routine that writes MIDI data from the MIDI- IN (from D0) to the MIDI buffer. 'vkbderr' and 'vmiderr' are called whenever an overflow is detected from Keyboard-or MIDI-ACIAs. The other vectors handle packets that come from mouse, joystick, etc. If you write routines for this, you must watch out that they end with an RTS and that they don't take more than 1 millisecond the perform. The vectortable is located at $A0E and has the following vectors in it: midivec $79C6 vkbderr $759C vmiderr $759C statvec $7034 mousevec $15296 clockvec $6A46 joyvec $7034  35 kbrate  Example: move.w repeat,-(sp) move.w wait,-(sp) move.w #35,-(sp) trap #14 addq.l #6,sp This function enables manipulation of the keyboard-repeat. 'wait' specifies the time that passes before the key is automatically repeated. The time is based upon the 50 Hz system tact. 'repeat' specifies the time that passes for each repeat. These two values can be changed from the Control Panel desk accesory. When one of the parameters is set to -1, the corresponding value is not changed. That way, this function will give the value at the current moment in one word: bit 0-7 contain the 'repeat' value, whereas bits 8-15 contain the 'wait' value.  36 prtblk Example: move.l parameter,-(sp) move.w #36,-(sp) trap #14 addq.l #6,sp This function looks very much liek XBIOS function 20 (scrdmp), but this one expects a parameterlist. 'parameter' is the address of that parameterlist, that is built up like this: long blkprt Address of screen-RAM int offset int width Screen width int height Screen height int left int right int scrres Screen resolution (1,2 or 3) int dstres Printer resolution (1 or 2) long colpal Address of the color palette int type Printer type (0-3) int port Printer Port (0=Centronics,1=RS232) long masks Pointer to half-tone mask 37 wvbl Example: move.w #36,-(sp) trap #14 addq.l #2,sp This function can be used to synchronize graphics with wvbl of the screen. It just waits until wvbl has occured. 38 supexec Example: move.l address,-(sp) move.w #38,-(sp) trap #14 addq.l #6,sp This function may be used to execute the routine at 'address' in Supervisor Mode of the 68000.  39 puntaes Example: move.w #39,-(sp) trap #14 addq.l #2,sp This function turns of AES, as long as it's not in ROM. That was it for today, folks. I've told you all I know about XBIOS functions. I hope you will write to us if you have experienced specific things with XBIOS functions, or if you have succesfully used some rare XBIOS functions in GfA Basic using the XBIOS command. Our address: ST NEWS, Kievitstraat 50, 5702 LE, Helmond, The Netherlands. GFA BASIC TIPS & TRICKS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th, 1986. In this time's issue of ST NEWS we will be able to reveal some quite stunning hints & tips for use with GfA Basic. We've also come accross some GfA Basic specifications and a list of GfA Basic commands(thanks RFJ, whomever you may be!). I think we will hereby give you a very useful tip: all GfA Basic programs can be quit while running if you press SHIFT, CONTROL and ALTERNATE simultaneously. Useful, isn't it? Hereby we supply you with a list of GfA Basic commands, after which we will systematically review some commands (also in upcoming issues of ST NEWS). KEY WORDS AND FUNCTIONS ABS(Y) ADD Y,N ALERT picture,msg$,buts,but$,ret_var ARRAYFILL field(),n ARRPTR(var$) ASC(x$) ATN(x) BIN$(x) BLOAD "name" [,address ] BSAVE "name",address,len BOX x1,y1,x2,y2 x = C:var( parameterlist ) CALL var( parameterlist ) CHAIN "filespec" CHDIR "path" CHDRIVE n CHR$(x) CIRCLE x,y,r [ ,phi0,phi1 ] CLEAR CLEARW n CLOSE [[#]n] CLOSEW n CLS [#i] COLOR c CONT COS(x) CVI(x$) CVL(x$) CVS(x$) CVF(x$) CVD(x$) DATA [const[,const]...] DATE$ DEC var DEFFILL [color],[style],[patern] DEFFILL [color],patern$ DEFFN name[ (varlist) ]=expression DEFLINE [ style ],[ width ],[ begin ],[ end ] DEFLIST x DEFMARK [ color ],[ type ], [ height ] DEFMOUSE n DEFMOUSE A$ DEFTEXT [ color ], [ style ], [ rotation ], [ height ] DFREE(n) DIM var( indices ) [,var( indices ),...] DIM?( array() ) DIR [ "Filespec" [TO "file"]] DIR$(n) DIV var,n DO/LOOP DRAW [ TO ] x0,y0 [ TO x1,y1, .... TO Xn,Yn ] EDIT ELLIPSE x,y,rx,ry [,phi0,phi1 ] END EOF( [#]n ) ERASE array() ERR ERROR n EXIST( "Filespec " ) EXIT IF EXP(x) FATAL FIELD [#]n, expr. AS var$ FILES ["filespec" [TO "file"]] FILESELECT "filespec","filename",ret$ FILL x,y FIX(x) FOR var=expr [DOWN]TO expr [ STEP s ] / NEXT var FRAC(x) FRE(x) FULLW n GET x0,y0,x1,y1,str$ GET [#]n [,i] GOSUB procedurename GOTO label GRAPHMODE n HARDCOPY HEX$(x) IF expr [THEN] block [ELSE] block ENDIF INC var INFOW n,"info line" INKEY$ INP(x) INP(#n) INPUT ["text" ; (or) , ] var[,var...] INPUT #n,var[,var] INPUT$( x[,#n] ) INSTR( [n,] a$,b$ ) INSTR( a$,b$[,n] ) INT(x) KILL "filespec" LEFT$( a$[,n] ) LEN( x$ ) LET var = expr LINE x0,y0,x1,y1 LINE INPUT LIST "filename" LLIST LOAD "filespec" LOC( [#]n ) LOCAL var[,var,...] LOF( [#]n ) LOG(x) LOG10(x) LPOS(n) LPRINT ... LSET a$=b$ MAX ( expr[ ,expr, ... ] ) MENU array$() MENU KILL MENU OFF MENU( n ) MID$( a$,a[,n] ) MIN ( expr[ ,expr, ... ] ) MKDIR "new_path" MKI$(n) MKL$(n) MKS$(n) MKF$(n) MKD$(n) MOUSE x,y,key MOUSEX MOUSEY MOUSEK MUL var,n NAME "oldname" AS "newname" NEW OCT$(x) ON expr GOSUB proc.list ON BREAK ON BREAK CONT ON BREAK GOSUB name ON ERROR ON ERROR GOSUB name ON MENU GOSUB proc_name ON MENU KEY GOSUB proc_name ON MENU MESSAGE GOSUB proc_name ON MENU IBOX n,x,y,w,h GOSUB proc_name ON MENU OBOX n,x,y,w,h GOSUB proc_name ON MENU OPEN O/I/A/U/R, [#]n, "filename" [,len ] OPENW n[ ,w,h ] OUT x,a OUT #n,a PAUSE x PBOX x0,y0,x1,y1 PCIRCLE x,y,r [,phi0,phi1 ] PELLIPSE x,y,rx,ry [,phi0,phi1 ] PRBOX x0,y0,x1,y1 PEEK(x) DPEEK(x) LPEEK(x) PI PLOT x,y POINT( x,y ) POKE x,n DPOKE x,n LPOKE x,n POLYLINE n,X(),Y() [ OFFSET x0,y0 ] POLYFILL n,X(),Y() [ OFFSET x0,y0 ] POLYMARK n,X(),Y() [ OFFSET x0,y0 ] POS(n) PRINT [ AT( col,row ) ][;][ expr[,][;][']] ? PRINT #n [,expr [,][;]['] PRINT USING "format",list[;] PRINT #n,USING "format",list[;] PROCEDURE name[ ( var.list ) ] PUT x0,y0,a$ [ ,writing_mode ] PUT [#]n [,i] QUIT RANDOM(x) RBOX x0,y0,x1,y1 READ var[,var, ... ] RELSEEK [#]n,x REM or ' REPEAT / UNTIL cond.expr RESTORE [ label ] RESUME RESUME NEXT RESUME label RETURN RIGHT$ RMDIR "path" RND[ (x) ] RSET a$=b$ RUN SAVE "filename" PSAVE "filename" ( auto execute after loading..) SEEK [#]n,x SETCOLOR i,r,g,b SETCOLOR i,n SETTIME timestring,datestring SGN(x) SIN(x) SOUND voice,ampl,note,octave [,dur ] SOUND voice,ampl, #period SPACE$(x) SPC(n) SPOKE x,n ( Poke in Supervisor mode ) SDPOKE x,n SLPOKE x,n SPRITE A$ [,x,y ] SQR(x) STOP STR$(x) STRING$(n,string$) STRING$(n,c) SUB var,n SWAP var1,var2 SYSTEM TAB(n) TAN(x) TEXT x,y,[ justification length, ] string$ TIME$ TIMER TITLEW n,"window title " TRUNC(x) UPPER$( string$ ) VAL( x$) VAL?(X$) VARPTR( var ) WAVE voice,env,form,dur,speed WHILE cond.expr / WHEND WRITE [ expr ][;] WRITE #n [,expr ][;] Let's have a more in-deep look at some GfA Basic commands, now. Here, I will have a look at some commands that are very versatile or useful, and that are not very common on other basic dialects. The first command I will explain is a follows: DEFFILL c,a,b or DEFFILL c,a$ This command determines fill patterns, or can even let you define your own fill patterns! The value of c determines the color, so you can just leave that away on monochrome (that way, the command will have the format: DEFFILL ,a,b or DEFFILL a$). With the variable a you can determine the fill style, ranging from 0 to 4. These can have the following meanings: 0 empty fill 1 completely filled 2 points fill 3 striped fill 4 self defined fill With b, you can choose the special fill types: 24 different fill patterns for points fill and 12 different fill patterns for striped fill. You can use own fill patterns, by using the command MKI$ of GfA Basic. This command changes values into bit patterns. As you might know, each fill pattern is 16x16 bits, so you have to define 16 "words" (a word is 16 bits=2 bytes). A solid row of 16 set bits would be 65535, so a solid horizontal line in a fill pattern would be MKI$(65535) for example. To define a solid black fill patern, the following program is enough: For X=1 to 16 A$=A$+Mki$(65535) Next X You see, it opens a wide range of possibilities. Through this way, you can also turn on software Sprites in GfA Basic. But we won't cover sprites in this issue; therefore you'll have to wait some time untill the next issue of ST NEWS arrives! Another command that also allows own editing through the "A$- principle", is DEFMOUSE, which has the following format: DEFMOUSE x or DEFMOUSE a$ The value of x can vary between 0 and 7, which have the following meanings: 0 Arrow 1 Stretched rounded X 2 Bee 3 Pointing hand 4 Open hand 5 Cross 6 Fat cross 7 Outlined cross The action point is the point on which all mouse operations are performed. In the case of DEFMOUSE, A$ must exist of the following parts: mki$(x coordinate of the action point) mki$(y coordinate of the action point) mki$(1) mki$(mask color, most of the time this is 0) mki$(cursor color, most of the time this is 1) m$ (bit pattern of the mask) c$ (bit pattern of the cursor) The cursor is the part that is usually displayed on the screen, but the mask of the mousepointer it displayed when it is pointed on reverse colored background (black on normal monochrome video). Another command I never heard of was DFREE x. This command gives the available space on a disk drive (the x is the device number, ranging from 0-15, but normally 1 or 2). Quite handy! When you give 0 as a parameter, the active device is examined. That's it for this time, folks! Next time I will explain the following commands: Graphmode, Menu (also On Menu Gosub, etc.) and Mouse, while I will be looking at Pause, Settime, Sprite and Upper$ the issues after that (so that will be issue 6). We hope you will find the information that we offer you very useful. We encourage anyone who doesn't have GfA Basic to buy it immediately: it's one of those programs that everybody should have! For information, write to GfA Systemtechnik, Computer Division, Am Hochofen 108, D-4000 Dsseldorf 11, West Germany. The program is available for about 160-170 guilders, and is accompanied by a thorough user manual, that explains all the commands very well. A Dutch version of that manual, so I've heard, is being worked at at this very moment! Now, let' see about the GfA Basic specifications (about variable organisation). Normal variables are 6 byte values, in which exponents up to 154 are allowed. Integer variables use up 4 bytes and can have a value between -214783648 and 2147483647. String variables can have a maximal length of 32767 characters.... LOW TO HIGH CONVERTER by Richard Karsmakers and Sven Krppel Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th 1986. In Level 16, a 16-bit dedicated computer magazine (which I've heard has ceased to exist), of March 1986, I saw a useful conversion routine to convert Neochrome low resolution pictures to 32000 bytes High resolution screen data. It was very nice, but awfully slow (converting a picture took about half an hour). Also, the user had to create a Degas picture from those 32000 bytes by himself. Since I thought this program was much, much too slow (mainly because it used the wrong Basic language) and not complete enough, I decided that a better version of the program had to be written, using File Selector Boxes, Alert Boxes, etc. And it had to be faster, too. So we decided to use GfA Basic, and rewrote Sven's basic routine into a more complete, faster concept. The program is added on the disk on which you've found this bulletin, and is called "CONVERT.BAS". It is the first program to be delivered with ST NEWS, the first in a - hopefully - long row. At the moment that this article was written, a good friend of ours was working on a deluxe C version of the program. We don't know yet if we will publish it in ST NEWS, but we will try to obtain it very hard. Converting might then turn out to be a question of seconds rather then minutes (now, it still takes 6 minutes to complete one conversion). We regret that we cannot give you any details about the actual conversion routine; that's because we didn't get the picture from Sven - if you know what I mean. It's just Sven's routine, converted to GfA Basic. All the POKE commands from ST Basic (which are 16-bit POKEs) had to be converted to DPOKE in GfA (because a normal POKE in GfA is 8-bit, whereas DPOKE is 16 and LPOKE is 32 bit), and the IF-THEN routines had to be adapted (with GfA, all arguments have to be on different lines!). At first, that caused quite a lot of trouble, but we managed (as you can see). A note to the ALERT command may also be written down here: as you may remember, in Volume 1 Issue 2 of ST NEWS, Delta Software Productions wrote a review of GfA Basic, in which he forgot to explain the first variable ('n', remember?) of the command: ALERT n,"TEXT|IN|BOX",d,"TEXT|FOR|BUTTONS",b Well, this 'n' can have four values, ranging from 0 to 3: 0 Normal Alert Box 1 Watch out! Alert Box 2 What's happening? Alert Box 3 Stop right there! Alert Box In the converter, we used number 1 and number 3. It also took quite a while to find out how we could POKE on 16745024! In ST Basic, it was normally possible to POKE there, but in GfA you need to enter the supervisor mode. Therefore, SPOKE was introduced. Was I glad I had a list of GfA commands at hand (which you will find elsewhere in ST NEWS as well, with the GfA Basic Tips & Tricks)! If you have discovered any nasty bugs in our converter, or if you think something should be altered/debugged/improved/adapted, please contact us at our correspondence address. Since we hope to publish some more GfA Basic programs, we also hope that you will help us. Start writing nice utilities in this versatile language and send them to us, wo we can use them in a next issue of ST NEWS. At the moment, we are writing a Disk sorter ourselves, which will enable you to create files of all your programs on all your disks. But it might take a while before it's finished! Ofcourse, you may also send 100% basic games. GEMDOS FUNCTIONS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th, 1986. The GEMDOS functions in the Atari ST look very much like MS-DOS routines. Especially the UNIX functions of MS-DOS can be found in GEMDOS, whereas the hardware-specific functions - ofcourse - won't be found. All GEMDOS functions can be supplied with parameters on the stack and can be called from assembler using the TRAP #1 command. You must know that D0 and A0 will be changed at any time if you use GEMDOS functions. The return value will be found in D0, whereas A0 contains the pointer to the stack-address on which the function number is located - most of the time, anyway. You can read most specific things about the GEMDOS functions (detailed decriptions) can be found in the book "ST Intern" from Data Becker (Merowingestrae 30, 4000 Dsseldorf, West-Germany). The authors are Klaus Gerits, Lothar English and Rolf Brckmann (ST Intern, ISBN 3-89011-119-X, price about DM 80,-), but here we have just included a small summary of GEMDOS functions, together with a very brief description. Number: Name: Brief description: ------------------------------------------------------------------ 00 TERM Terminate program 01 CONIN Get character from console 02 CONOUT Output character to screen 03 AUXILIARY INPUT Get character from RS232 04 AUXILIARY OUTPUT Send character to RS232 05 PRINTER OUTPUT Send character to Centronics 06 RAWCONIO Get character and send it to screen 07 DIRECT CON IN WITHOUT ECHO Get character from console 08 CON IN WITHOUT ECHO Get character from console 09 PRINT LINE Output several characters to screen 0A READLINE Input several characters from console 0B CONSTAT Check if keyboard buffer is filled 0E SETDRV Define current drive 10 CONOUT START Give console status 11 PRTOUT STAT Give Centronics status 12 AUXIN STAT Check for character availability on RS232 13 AUXOUT STAT Check if RS232 is able to send or not 19 CURRENT DISK What is the current drive? 1A SET DISK TRANSFER ADDRESS Set buffer for disk operations 20 SUPER Toggle supervisor mode 2A GET DATE Get the system date 2B SET DATE Set the system date 2C GET TIME Get the system time 2D SET TIME Set the system time 2F GET DTA Get buffer for disk operations 30 GET VERSION NUMBER Get the TOS version number 31 KEEP PROCESS Terminate program. Read the exact difference with 01 in ST Intern 36 GET DISK FREE SPACE Get free space on disk 39 MKDIR Create a folder 3A RMDIR Remove (delete) a folder 3B CHDIR Change current directory (folder) 3C CREATE Create file 3D OPEN Open file 3E CLOSE Close file 3F READ Read file 40 WRITE Write file 41 UNLINK Delete file 42 LSEEK Move filepointer 43 CHMOD Change mode (file attributes) 45 DUP Get handlenumber 46 FORCE Manipulate handlenumber 47 GETDIR Set current directory 48 MALLOC Allocate memory 49 MFREE Free memory that was allocated 4A SETBLOCK Allocate specific memory 4B EXEC Load a program 4C TERM Terminate program 4E SFIRST Check for filename 4F SNEXT Check for filename continued 56 RENAME Rename a file 57 GSDTOF Check date/time THE TEMPELMANN MONITOR by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th, 1986. Recently, Thomas Tempelmann (E.-L.-Kirchnerstrae 25, D-2900 Oldenburg, West Germany) has written a nice utility program for the ST. As some of you might know, Thomas was very active on the Commodore 64 a while ago - he wrote some nice copy programs. We sure are glad to hear that yet another computer whizkid has joined the ST legions. But now, let's review the program. It comes supplied in a folder with four items, and it is public domain (at least, versions 1.x are). Our version was version 1.3. The concept is simple: he manipulated the routine that normally prints out the screen (on ALTERNATE+HELP), so that is points to his program - a machine language monitor. It offers nice touches, like using wild cards and examining the whole memory. Just think about the possibilities: you can now enter a program in memory any time you want. Some programs, however, disable this function. A few programs that do this: The Pawn and our Synth Samples. After pressing ALTERNATE and HELP simultaneously, the screen blanks and the monitor starts up, giving you some essential data as well as a "!" prompt. This prompt lets you know that the monitor is waiting for a command line. Below, you will find a summary of all commands. In that summary, we will use these conventions: * All values must be given in hexadecimal notation, unless you add "&", in which case you may use decimal notation. * means first address, means ending address. * may also be replaced by: X (number of bytes) Z (number of lines) * With the commands M, D and I you may also replace by a point, which indicates endless display of memory. * As address is also possible to specify the contents of a specific register, like "! G ~A0". * It is also allowed to exchange an address for the variable "O", that can be given a value through the "O" command (see below). * All listing can be paused by pressing the SPACE bar, whereas they may be stopped completely by pressing any other key. Here is the list of commands: F1 Switch to monitor work screen F2 Switch to original screen M Memory dump : ... Save words - from address D Disassemble memory O Set the variable "O" to the value C Copy --2 to -(+(-)) V Verify memory (compare) H ..Hunts memory for bytes -. The question mark may be used as wild card. H ' Hunts memory for . The question mark may be used as wild card. F ..Fills memory with bytes (b1>-. The question mark may be used as wild card. F ' Fills memory with . The question mark may be used as a wild card. I ASCII dump (Interrogate memory). Control codes will be given in reverse. ' Puts string in memory from address B Indicates all breakpoints (BPs), with the format
, , . B Sets BP number to address . B- Disables all BPs. A note to Breakpoints: These are set when leaving the monitor, if the Trace bit in SR isn't set (if not, the Tracefunction will trace the BPs). G Go. Leave the monitor and go on at the address specified by . GS Calls a Subroutine. This routine has to end with RTS to assure return to the monitor! T+ (or T-) Set Trace control mode on (or off). During Trace, the following functions are possible: SPACE Execute specified instruction ESC Leave Trace mode and enter the monitor. Back with "!G" T Toggle T-flag of SR of processor. This can also be done in normal monitor mode, by "!R FT=1" or "!R FT=0". Only when this flag is set, the monitor will keep control over the executed instructions O Turns of output and key input. The program will continue, and has to return to the monitor by a BP A Just like "O", but in this case all functions are traced (inclu- ding TRAP routines, etc.), since the trace bit is set each time. During disk operation, or when the Interrupt mask is set to 7, the instruction will not be traced, because the trace bit isn't set R Turns off the input and output, until a subprogram returns Templemon also knows some quite advanced register operations, for which we will use the following conventions: * Registers () may be specified by D0,A7,SR,PC,SSP,USP, etc. * F is the same as SR * A7 represents either the SSP or USP; this depends on the S-bit of the SR (whether it is set or not) R Displays the register that was specified with "R:". R = Sets to the value . R: ... Sets up default Register diplay (e.g. for Trace). R F = Sets SR-flag to (either 0 or 1). An example: "!R FC=1" sets the carry-flag. P Clears the screen Q Quits (Gemdos(0)) The following commands are added in version 1.3 onwards: S , Saves memory from to -1 in a file. P Opens a protocol file. All output will then be sent to the screen, but also to that file. Example: "P PRN:" will send all output to screen, but also to the printer. PC Close protocol file. Thomas Tempelmann is currently working on a professional version of this program, on a ROM module. If you want to receive a full user manual of the PD program, as well as a 40 DM bonus on the purchase of that professional version, you should send DM 40 to him (to the address mentioned earlier in this article). Please note that the program may only be spread through public domain if it is accompanied in a folder by a "read me"-file, and a program called "TRACE.TOS" as well as that's C-source file! It may be ordered through our public domain service (read all about that in the article about our Reader's Service, elsewhere in this bulletin). ALL ABOUT THE MIDI INTERFACE OF THE ATARI ST SERIES by Frank Lemmen Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th 1986. MIDI (Musical Instrument Digital Interface) has become a standard since several of the largest synthesizer manufacturers decided to use one system to exchange information between synthesizers (all kinds of synthesizers, and nowadays even guitars, bass guitars, mixing panels, lighting equipment, etc.). The MIDI interface works just like the interface that's used to connect a modem to your computer (and some printers, too). MIDI IS A SERIAL INTERFACE This interface, known as the 'RS232 interface' works in a serial way. That means that information is send down the line in one-by- one format; just like many people entering a house with only one door (they can't go in all at the same time). The people that decided to use the one-by-one format did so because this system was cheap, the technology was proven and it turned out to work very well. Another reason was that choosing the parallel option (which can be compared with many doors) would mean thicker cables, expensive connectors and an interface that is not yet as much in fashion as it is nowadays. BITS & BYTES The data that is send by MIDI consists of small packages of bits that form a number; this number tells the synth. what to do. As you know, a BIT is nothing to get excited about (BInary digiT). You can compare it to a switch; it's either ON (set to 1) or it's OFF (set to 0). For the computer it makes sense, because he (it) can translate the bits to numbers, and the numbers to instructions, and he can understand the instructions. When a MIDI message is sent, first the start-bit is sent, then the actual data follows and finally a stop-bit tells the synthesizer or computer that the package has been delivered(10 bits in total). The package itself consists of 8 bits and is also known as a BYTE. A byte may hold any number in the range of 0 - 255. SPEED The speed at which information is sent down the cable is a clean 31250 bits per second (31250 baud). If you want to produce this kind of speed on your keyboard or synth, you would have to play the 'Minute Waltz' of Frederic Chopin in one second (Please don't)! So midi is fast. But, the speed IS limited. That means that if you've recorded information of a hundred synthesizers and you would play it back it sounds different on each one. In fact, it's not possible to send that much information with MIDI and still have the timing right. BUFFERING For this purpose the computer and the synthesizer use a buffer, which is nothing more than a place to store the information while the waiting goes on. In the case of a synthesizer, this buffer usually has room for 128 bytes. The computer has room for many times this amount. When the waiting is over, the computer/synthesizer will empty its buffer as quickly as possible; that is at maximum speed. The first byte that went in will be the first that goes out. This kind of buffer is also known as a FIFO buffer (First In First Out). This whole proces of buffering may, under extreme conditions, be somewhat 'messy', because when you had a delay of around 1/10th of a second, you will definately notice the sudden burst of the emptying of the buffer. But don't worry,this will hardly ever happen with the synthesizers and with the computer it will probably never happen. The reason why the effect is more noticeable with a synthesizer is simply that the synth has to translate each message to a sound or change of pitch,etc. and at the same time has to keep track with all the incoming information. So a synthesizer will almost always send and recieve at a speed that is much slower than the 31250 bits per second that MIDI can actually do. The computer can send at any speed, up to the maximum, without having to make fuzz about sounds and change parameters while it is sending/receiving. It will need that extra when it, for instance, sends information to more than one synthesizer at a time. WHAT ARE MIDI MESSAGES? The kind of stuff that a MIDI message consists of is again nothing more than a series of numbers which are interpreted as commands by your synthesizer. These commands are actually quite simple, for instance when you hit a key on the keyboard the numbers will be something like: BITS NUMBER/BYTE 10010000 144 01000000 64 01000000 64 (are you puzzled?, read on) The first byte that is send (128) begins with a bit that is set (1). This means that the number will be interpreted as a COMMAND. If this bit would be a 0 (cleared), the number would be interpreted as a value only. Now, something that you need to know is that in the case of a command byte, (or status byte),it is split in two: 1001 - 0000 The first four bits(also called a nibble) form the command and the last four bits (again, a nibble) are the channel that the information is sent to. So: 1001 means: A KEY IS BEING HIT: at channel 0000. ( channel 0 ) When the synth learns about this, it ofcourse needs to know which which note you happened to be playing. This information is contained in the next byte: 01000000 THE NOTE IS NUMBER 64 Note 64 will usually be somewhere around the middle C on the keyboard. The last byte (also 64) tells the synth with which speed you hit the keyboard. This byte will have no meaning if you have got a synth without touch-sensitivity; it will then just be ignored. A MIDI MESSAGE 10010000 KEY ON,CHANNEL 0 01000000 KEY = C 01000000 SPEED = 64 The C key has been hit on channel 0 with a speed of '64'. You see, it's quite easy. After you've hit the key you will probably release it some time later. Until that time you will hear the tone C. The release of the key is also put down into a series of numbers, very similar to the former series: 10000000 KEY OFF,CHANNEL 0 01000000 KEY = C 00000000 SPEED = 0 ( ignored ) After this message, your synth will turn off the C and you'll hear nothing but silence. On the whole, hitting a key on a MIDI synthesizer will produce two series of messages, called EVENTS. (hit the key.... release it <-> NOTE ON...NOTE OFF event) WHAT ARE EVENTS? An event is a series of bytes that has a particular meaning to the synthesizer. Just like the NOTE events I mentioned, there are events for the use of the sustain pedal, modulation wheel, the selection of a new sound, the pitch bender, etc. Not all events use the same amount of bytes, but most events are three bytes in length. So this was the first piece of work from me; I hope you've learned from it. P.S. My synthesizer type is a CASIO CZ-230S,  so if you have any kind of music in whatever program  you can send it to me at our address with my name on the top lefthand side of the envelope. SOFTWARE MEGA-REVIEW: NEW PSYGNOSIS GAMES by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th, 1986. Everyone must have heard from Psygnosis' first game on the ST (now, also supplied on expanded Amiga or Fat Mac), 'Brataccas'. This used to be one of the very first games on the ST, but it still sets standards for software to come. Recently, they published two new packages: 'Arena' and 'Deep Space'; again, Psygnosis seems to set standards..... Deep Space  After booting up the program, one is welcomed by an astounding picture of a metal owl, with the text "Psygnosis Presents". My first thought was: "If the rest of the game is as good as this picture, it will sure be a hit!". Well, after a bit of loading (heavily speed-up!) another picture appears, which is just as good (or maybe even better) as the first: A sturdily built owl that just leaves his hawk-like space craft. If all goes well in the game, you'll never see him back (as far as I know). This picture also commands you to insert disk B. When you've done that, the drive will start loading again. After a while, the screen turns black and the game starts. At first, the game looks very much like 'Star Raiders'. But soon, it turns out to be a somewhat enhanced spacecraft you're in. The dashboard is divided into four sections: from left to right the on-board computer, steering part, weapon installations and scanner. You can turn the on-board computer on or off by either clicking on the "OFF" or "ON" word on the screen or pressing F1. Once you've choosen to turn it on, you can select various options (either with F2-F7 or the corresponding signs under the computer display). Here you can order various drones (repair drones, energy drones, and more), look if you're on course, specify your flight target, and a lot of other things. The steering part consists of one steering weel. You can 'drag' it left, right, up, down, etc. with the mouse, thus steering your spacecraft. You can also accomplish this by moving the joystick on port #1 or using the arrow keys of your keyboard. To the right of the steering wheel you can see a 2 by 3 grid of option switches. Here you select missiles, quarks, and various other options. You can e.g. retro thrust, lock/free windows, etc. The scanner can be activated using either F10 or clicking the arrow up on the screen (right of the 2 by 3 I've just talked about). Here you can have a look at the positions of enemy vehicles, etc. During game play, you're attacked by extraterrestrials, like Vexon scouts, who whizz past you and blow hell out of you if you don't know what you're doing. The action graphics are superb! Your target is to trade a bit with various planets. As you gain more money, the quest starts to be somewhat easier. But watch my choice of words: easier, but not easy! You must look out not to crash into any Vexon scouts, and you must avoid being hit too often. When you don't do that, you end up bleeding to death outside your craft, somewhere in Deep Space.... Arena  'Arena' is a sports game, for 1-4 players. One can compete in various events: Hundred Meters (Dash), Long Jump, High Jump, Pole Vault, Shot Put and Javelin. Actions and options are choosen using the left mouse key (that you'll have to double-click), whereas you use the right mouse key twice to quit or pause an event. After starting the game, I was quite disappointed. I had just seen "Deep Space" and one can safely say that anyone can create the "Arena" front picture (the second; the first is the metal owl, again, which looks the same - very good). But when I've inserted the second disk, a very nice picture appears after a short while (again, short, because Psygnosis used a disk-turbo). From this picture, that shows action scenes from all the sporting events, you can select your event. You can also choose to load or save a game, start a new game (with new names), quit, or look at the score board. The animation is very good, especially the individual movements. The smooth link-up between movements could be done better, but that's because I used to be very spoiled with looking at the superb movement of sprites in Epyx' "Summer Games" (both I and II) back on the Commodore 64 (cough! cough!). And now here comes the only disadvantage of the game: It uses the keyboard to get the athletes moving: the "A" and "'" key, to be exact. After starting the event (after the appearance of the athlete, this can be done by double-clicking the left mouse key), you have to press "A" and "'" by turns. The quicker you do that, the better the performances are (let's not talk about the keyboard). If you don't act immediately, the athlete starts to say things (in "Brataccas"-like air bubbles), like "We seem to be lacking the competitive spirit here", "Will you pay attention", "Somebody...wake him up" or "How about a game of Deep Space...another classic from Psygnosis". After you've had your turn, an umpire appears on the scene, that tells (or rather, insinuates) you how you've done. When you've had a foul, he might say things like "It's a foul...ha....ha....ha", "How Amusing" or "Oh...how very unfortunate for you...snigger... snigger". If you've done a bad job, he comes up with sentences like "My 4 year old son can do better than this...it's pathetic", "Gasp..wheeve...cough..choke", "The moral of the story is....give up", "Well, we might as well pack up now" or "Ever thought of taking up golf". When you've made a foul at high jump, he might add something like "How unfortunate....you seem to have knocked the bar off....snigger". But the athlete isn't silent - he automatically replies, with remarks like "Push off....shorty" or "Out of the way...short stop". In those cases, the umpire sometimes adds "OK Mr. Average". All in all a very amusing game, but I think Psygnosis had better used the joystick facilities of the ST instead of the mouse-and keyboard facilities. And there are a few little bugs in "Arena" as well: When you play Pole Vault, quite a big piece of the stick is missing. You'll only notice it once it hits the ground - but you will still not see it. And there's one more: Sometimes, another athlete appears on the background (practicing, I suppose), who seems to walk in front of some bushes an some other umpires on the fore-ground. But these are mere beauty bugs. It's still a very good game. Game rating: Name Deep Space Arena Authors David H. Lawson Ian Hetherington Garvan Corbett Colin Rushby Graphics 8 7.5 Sound 7 6 Setup 8 9 During attractiveness 8 7.5 Overall rating 8 8 For more information, please write to: Psygnosis 1st Floor Port of Liverpool Building Pier Head Liverpool L3 1BY England And here are some hiscores I made that you can try to break: Long Jump 7.42 metres 100 Metres (Dash) 10.03 seconds Javelin 70.21 metres Pole Vault 4.01 metres Shot Put 14.09 metres High Jump 1.89 metres Good luck!! GFA BASIC TIPS & TRICKS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th, 1986. In this issue of ST NEWS, we're going to have a look at some GfA BASIC commands. I know you are all desperate to learn about the SPRITE command, but you'll have to wait for the next issue to read about that. Firstly, we'll have a look at the ERROR command, which format is as follows: ERROR x The value of 'x' can be between -128 and 127, but has to be integer. This command simulates the occurance of an error with the number of 'x'. It can be handy when you are developing error- handling routines. A command that is very closely related to the ERROR command is the function ERR. This function gives you the number of the error code belonging to an error that has just occured. Also belonging to these is the command ON ERROR. If you add the line "ON ERROR GOSUB procname" (where procname is the name of a procedure or subroutine), the program will jump to that procedure whenever an error might occur during execution of the program. When it is necessary to jump to that routine a second time (or more times), you must turn it on again in the error routine itself (with "ON ERROR GOSUB procname"). When you want to turn off this function (so that you'd get normal errors), you'll have to add the line "ON ERROR". By the way, there is a nice feature about procedures in GfA BASIC: you can actually define local variables. Have a look at this example program: GOSUB Subroutine(7) PRINT "When back from the subroutine, A=";A END PROCEDURE Subroutine(A) PRINT "In the subroutine, A=";A RETURN You see that A gets the value 7, but if you try to PRINT that same 'A' outside the procedure, you'll get 0 as a result. By the way, the line with 'END' on it may be left away, because a program end execution when it runs into a procedure (so through this way you will never have to annoy yourself agian about "RETURN without GOSUB errors" at the end of a program. Another thing that might be handy to know is how you can define variables to be 'local' without sending them with the GOSUB or receiving them with the PROCEDURE. You can achieve this by using e.g. 'LOCAL A'. That way, 'A' will be a local variable. Now, let's have a look at pull down menus etc. In this article, I will describe the basics of menu programming; you'll have to look at the listing of "The Ultimate Examining Utility", elsewhere in this bulletin, for an example of how to use these basics. Concerning 'menu' functions, GfA BASIC is equiped with several commands. They are: MENU array() MENU KILL MENU OFF MENU n,x ON MENU GOSUB procname MENU (x) ON MENU KEY GOSUB procname ON MENU MESSAGE GOSUB procname ON MENU IBOX a,x,y,w,h GOSUB procname ON MENU OBOX a,x,y,w,h GOSUB procname ON MENU Quite a list, don't you think? Now, let's explain these commands so you also know how to use them. Here's what you must do to set up a menu bar with pull-down menus. Firstly, you must 'DIM' an array, which must be one-dimensional. It can have any name. The array must have a defined setup. For example, each menu title with the pull down-titles must be parted from another one of those lists by an empty string. The first menu strings might look like this: "Desk", " About Examine","--------", 1,2,3,4,5,6,"". The menu bar title will be "Desk", and when you touch that name with the mousepointer it will reverse and a pull- down menu will drop down with the name " About Examine". You won't find any numbers, nor will you find the "------------" (unless you have any desk accesories in your system). The six numbers are so called dummy strings, and the "--------" is necessary to divide the whole; it will only show when there are any desk accesories. To close it all, there's the empty string ("") to close this series. Have a look at "The Ultimate Examining Utility" to see how we've done it. And don't forget: you'll need to close ALL the titles (the last pull down menu-name of the last menu bar-title) with two empty string. You can see those defined after the FOR....NEXT loop (also, have a look at the technique we used to leave the loop once there are no strings anymore to be read. This way, you may add menu entries without altering the loop all the time. A note on the dummy-strings: their length must be unequal to zero. After defining the menu, you can turn it on by "MENU array()", where 'array' is the name of the array you used to put in all the entries. You must not put anything between the "()"! In the example, we use Aa$(). Thus, you have created the menubar on the screen. By moving the mousepointer to a title, the menu will drop down and you can select an option you programmed. Immediately after you've set up your menu-bar, you must use a line with "ON MENU GOSUB proc_name". The 'proc_name' must be the name of the procedure that handles all the subroutines, etc. After that line, you can create an endless loop, for example by using the DO...LOOP command. In that loop, you must use the line "ON MENU". Each time something happens to that menu, the program will now branch to the routine called 'proc_name'. Please have a look at our program now, and you'll see the structure. Don't forget the line "MENU OFF", otherwise it might be possible that menu bar titles will stay reverse when you don't want it. The MENU OFF command takes care that all menu titles that might have been reversed, are set normally. There are a few variations to the ON MENU command. For example, there is the ON MENY KEY GOSUB command. It works just like the ON MENU GOSUB command, but this time for examining which key is pressed on the keyboard. The commands ON MENU IBOX GOSUB and ON MENU OBOX GOSUB are used to determine whether the mouse pointer is in (IBOX) or out (OBOX) of a certain area on the screen, determined by the cordinates x and y and the width w and height h. The a is used to define which of the two boxes you use. Then there's the ON MENU MESSAGE GOSUB command determines the handle routines for GEM messages. MENU KILL turns off the whole menu bar. The command MENU n,x can be used to perform things with individual menu entries, of which the 'n' must be the index number in the array of the menu (in our example, ACC$). The 'x' may have the following values: 0 Removes a sign before the menu entry 1 Places a sign before the menu entry (to use this succesfully, you must have at least one space at the start of that menu entry) 2 Makes the menu entry light, so that it cannot be choosen anymore 3 Makes the entry normal, so that it can be choosen again The last command for use with menus is the MENU(x) command. This enables swapping parameters from the ON MENU GOSUB routines to your program. 'n' must be an integer value. Below, you'll find a list of the possible values and the proper functions: 0 Gives the number of a pull-down menu point, when it happens to be clicked 1-8 Gives the entries of the message-buffer 9 Gives a flag that indicates what has happened, just like int_out[0] 10,11 Gives the cordinates of the mouse 12 Gives the status of the mouse buttons 13 Gives the status of the keyboard-switchkeys 14 Gives scan code in high byte and ASCII code in low byte 15 Gives the number of mouseclicks -1 Gives the address of the menu object tree Now, let's have a look at the MOUSE command. With the help of this, it is possible to determine the current x-and y-position of the mousepointer, as well as the current status of the mouse buttons. Its format is: MOUSE x,y,k 'x', 'y' and 'k' are variables, that will get the appropriate values for x-and y position and the mouse buttons status. The x- and y positions speak for theirselves, but the status of the mousebuttons needs some explanation. It can have the following values: 0 if no buttons are pressed, 1 if the left button is pressed, 2 if the right button is pressed and 3 if both buttons are pressed. The next command I promised to write about in the previous issue of ST NEWS was GRAPHMODE. Its format is: GRAPHMODE x 'x' can be a number from 1 to 4. This command determines the Graphics mode of the ST. Normally (value 1), the old graphics are replaced by the new graphics. If it is 2, the old image will still be visible through the new image (the new image is transparent). Something like that happens when the value of x is 4. But here, the new image is set there reversely. When x has the value 4, each dot that was used by the old image will be cleared when it is also used by the new image, and when the new image uses a dot that wasn't used before, it will set is. That's it for the commands I promised to explain. Now, let's have a look at some of GfA BASIC's special operating system commands. GfA BASIC enables the programmer to make use of standard OS routines, implemented in GEMDOS, BIOS or XBIOS. The formats of these commands are: BIOS (f [,parameterlist]) XBIOS (f [,paremeterlist]) GEMDOS (f [,parameterlist]) Hereby, 'f' is the number of the function, and the 'parameterlist' must be included with some functions as well. I think it's best to just write down some examples here. You will be able to think of some examples yourself when you have a good look at "ST Intern" from Data Becker. a=XBIOS(20) Hardcopy A$=SPACE$(512) a=BIOS(4,0,L:VARPTR(A$),1,1,0) This defines a 512 byte long string variable, in which a disk sector can be read. 4 = Function Number 0 = Flag: 0=read, 1=write, 2=read and ignore media change, 3=write and ignore media change L:VARPTR(A$) = Determines the address in memory where the sector contents should be written to 1 = Read one sector 1 = First logical sector to read 0 = Device number (A) These commands definately widen the range of GfA BASIC's capabilities. I sure hope to hear from you if you have had some interesting experience with these commands. Next time, more about these GfA BASIC commands: SETTIME, SPRITE, UPPER$, GET, PUT and PSAVE. GEM-VDI CALLS PART I by Manus Originally published in ST NEWS Volume 1 Issue 4, launched on September 7th 1986. While others are exploring GFA BASIC, I am going to tell you all about GEM VDI calls as used in good old ST BASIC. By the way, sorry for my clumsy English, but it is about 16 years ago, that I had my last lesson in English. Yes, it is possible to use GEM-routines in your Basic to draw rectangles, to put your text in different modes and so on. To do this, we use special addresses in which we poke the necessary values. The meaning of these addresses are: INPUT:  CONTRL Instruction-number. CONTRL + 2 Number of input-coordinates of a PTSIN-field. CONTRL + 6 Number of input-data in a INTIN-field. INTIN Input-field (like color, textform and so on). PTSIN Input-field of two together belonging data. (like the coordinates of a rectangle) OUTPUT: CONTRL + 4 Number of output-coordinates. CONTRL + 8 Number of output-data. INTOUT Output-field (like present textform). PTSOUT Output-field of two together belonging data. IMPORTANT: These addresses are 16-bits. This means that a cell CONTRL+1 does not exist. If you have changed the length of a bit by POKE, you will have to set this back by "DEF SEG=0", before you can call the GEM- routines. Through the statements GEMSYS and VDISYS we can call these AES- and the VDI-routines. The GEM-SUBROUTINES have the following syntax: * The first line contains the name of the subroutine. * Then the variable that you have to use. * And then the values you can use. The variables and subroutines used are the names of the chapters and forms to make things clear to you. You are free to use other names for the variables and the subroutines, but remember: don't use the same name for two different things. You can MERGE the subroutine you want to use or you can make one big file with all subroutines. TEXTMODE : The Atari ST has different kinds of textforms like double strike, italics, underlined and so on. This is done by switching byte 0 to 4 of the variable called TEXTKIND: BIT: VALUE: TEXTMODE: 0 1 Double strike 1 2 Light 2 4 Italics 3 8 Underlined 4 16 Hollow The syntax is: TEXTKIND = ...... (maximum is 32,normal is 0) gosub TEXTMODE The subroutine is: 65000 TEXTMODE: 65002 ' -----> TEXTKIND 65004 ' 0 = normal 1 = double strike 2 = light 65006 ' 4 = italics 8 = underlined 16 = hollow 65008 ' or combinations 65010 ' 65012 poke contrl , 106 65014 poke contrl + 2, 0 65016 poke contrl + 6, 1 65018 poke intin, TEXTKIND 65020 vdisys 65022 return Try this: 5 ' merge "TEXTMODE.bas" 9 ' 10 fullw 2: clearw 2 20 data 1,2,4,8,16,3,5,9,10,0 30 for a = 1 to 10 40 read TEXTKIND 50 gosub TEXTMODE 60 gotoxy 14, a + 4: print "ATARI ST" 70 next a 80 waiting = inp(2) 90 end TEXTSIZE :  You can also change the size of the text. This means however, that you can not use the PRINT-statement anymore. You have to use the routine "TEXTOUTPUT". (see next routine) The syntax is: SIZE = ...... gosub TEXTSIZE The subroutine is: 65030 TEXTSIZE: 65032 ' -----> SIZE: 65034 ' < 9 = very small 9 = small 65036 ' 10 - 15 = normal 16 - 17 = big 65038 ' 18 - 19 = very big 65040 ' 65042 poke contrl , 107 65044 poke contrl + 2, 0 65046 poke contrl + 6, 1 65048 poke intin, SIZE 65050 vdisys 65052 return Try this once: 5 ' merge "TEXTSIZE.bas" 6 ' merge "TEXTOUTPUT.bas" 7 ' 10 fullw 2: clearw 2 20 data 8,9,10,16,18,20 30 for a = 1 to 6 40 read SIZE 50 gosub TEXTSIZE 60 xpos = 220: ypos = 80 + a * 30: TEXT$ = "ST NEWS" 70 gosub TEXTOUTPUT 80 next a 90 SIZE =15: gosub TEXTSIZE 100 waiting = inp(2) 110 end TEXTOUTPUT : These routine gives a string on scale on the monitor. The coordinates of the beginning are XPOS and YPOS. These begin- coordinates are free to use. The syntax is: XPOS = ...... YPOS = ...... TEXT$= "............" gosub TEXTOUTPUT The subroutine is: 65060 TEXTOUTPUT: 65062 ' -----> TEXT$ ; XPOS ; YPOS 65064 ' text on scale 65066 for i = 0 to len(TEXT$) - 1 65068 poke intin + i * 2, asc(mid$(TEXT$, i + 1, 1)) 65070 next i 65072 poke intin + i * 2, 0 65074 poke contrl , 8 65076 poke contrl + 2, 1 65078 poke contrl + 6, len(TEXT$) + 1 65080 poke ptsin , XPOS + 1 65082 poke ptsin + 2, YPOS + 38 65084 vdisys 65086 return TEXT ANGLE : An other option is to show the text in a different angle. Unfortunate this is only possible in steps of 90 degrees. The syntax is: ANGLE = ...... (= 0 ; 900 ; 1800 ; 2700 ) gosub TEXTANGLE The subroutine is: 65100 TEXTANGLE: 65102 ' -----> ANGLE (= 0 ; 900 ; 1800 ; 2700 ) 65104 ' 65106 poke contrl ,13 65108 poke contrl + 2,0 65110 poke contrl + 6,1 65112 poke intin, ANGLE 65114 vdisys 65116 return Try this: 5 ' merge "TEXTANGLE.bas" 6 ' merge "TEXTOUTPUT.bas" 9 ' 10 fullw 2: clearw 2 20 for ANGLE = 2700 to 0 step -900 30 gosub TEXTANGLE 40 XPOS = 300: YPOS = 150: TEXT$ = " ---> ATARI ST" 50 gosub TEXTOUTPUT 60 next 70 waiting = inp(2) 80 end TEXTFORM : This function defines the form of the text; must the text overwrite the background or must a result to be shown after a logical operation. There are 4 forms of output on the screen: FORM: MEANING: ------ ----------------- 1 Overwrite 2 Mix 3 XOR-operation 4 Mix and Reverse The syntax is: FORM = ..... (1 to 4) gosub TEXTFORM Form 1 is the normal form. The text overwrites the background. In form 2 the output is mixed with the existing background. This is very useful for graphics, because normally there is a little white square behind a sign. With form 3 there is an Exclusive OR-operation. This means that a screenpoint is only set when one of the two bits has the value 1. The screenpoint is blank when both bits have the value 0 or 1. In form 4 the output is the same as in form 2, except for an additional inversion. The subroutine is: 65130 TEXTFORM: 65132 ' -----> FORM ( 1 = 4 ) 65134 ' 65138 poke contrl ,32 65140 poke contrl + 2,0 65142 poke contrl + 6,1 65144 poke intin, FORM 65146 vdisys 65148 return An example is: 5 ' merge "TEXTFORM.bas" 9 ' 10 fullw 2: clearw 2 20 linef 100, 100, 400, 100 30 linef 100, 100, 100, 300 40 linef 100, 300, 400, 300 50 linef 200, 100, 200, 300 60 linef 400, 100, 400, 300 70 linef 300, 100, 300, 300 80 color 1, 1, 1, 2, 2: fill 110, 110 90 color 1, 1, 1, 6, 2: fill 210, 110 100 color 1, 1, 1, 8, 2: fill 310, 110 110 for FORM = 4 to 1 step -1 120 gosub TEXTFORM 130 gotoxy 9, 6 + FORM * 2 140 print chr$(14) chr$(15); 150 print " S T - C O M P U T E R "; 160 print chr$(14) chr$(15) 170 next 180 waiting = inp(2) 190 end GRAPHIC : In the VDI almost any thinkable graphic functions are stored, that can draw geometric figures, like: - circle - part of a circle - rectangle - rectangle with round corners - ellipse - part of an ellipse - line - filled parts Some of these functions are available directly in Basic, others are only available through GEM-calls. The most useful routines are described in the following part. RECTANGLE : Unfortunately, there is no instruction in Basic to draw rectangles. With a VDI-routine we can draw a rectangle and even fill it with a chosen screen, faster then the FILL-instruction in Basic. The routine needs only the two coordinates of the opposite angles, the sequence is not important. The syntax is: XPOS1 = ..... : YPOS1 = ..... XPOS2 = ..... : YPOS2 = ..... gosub RECTANGLE This routine (like all other GEM-routines) needs a full opened OUTPUT-field, because the output of a VDI-instruction is done directly on the output-field, that is present at that time. We have to recalculate the coordinates, because the beginning of the coordinates in Basic is different then in a output-field. The deviation is in the X-direction 1 pixel and in the Y-direction 38 pixels. The adjustment is done in lines 64012/64018. The subroutine is: 64000 RECTANGLE: 64002 ' -----> XPOS1 ; YPOS1 ; XPOS2 ; YPOS2 64004 poke contrl ,11 64006 poke contrl + 2,2 64008 poke contrl + 6,0 64010 poke contrl + 10,1 64012 poke ptsin ,XPOS1 + 1 64014 poke ptsin + 2,YPOS1 + 38 64016 poke ptsin + 4,XPOS2 + 1 64018 poke ptsin + 6,YPOS2 + 38 64020 vdisys 64022 return An example: 5 ' merge "RECTANGLE.bas" 9 ' 10 fullw 2: clearw 2 20 color 1, 1, 1, 9, 2 30 XPOS1 = 100 : YPOS1 = 100 : XPOS2 = 300 : YPOS2 = 300 40 gosub RECTANGLE 50 color 1, 1, 1, 9, 3 60 XPOS1 = 150 : YPOS1 = 150 : XPOS2 = 230 : YPOS2 = 260 70 gosub RECTANGLE 80 waiting = inp(2) 90 end RECTANGLE WITH ROUND ANGLES : This routine draws also a rectangle, but now with round angles. Like the previous routine we have to give the coordinates of two opposite angles. There are two possibilities: to draw the rectangle and to draw and fill the rectangle. The syntax is: XPOS1 = ..... : YPOS1 = ..... XPOS2 = ..... : YPOS2 = ..... FILLING = ..... gosub RECTANGLEROUND The variable FILLING means: FILLING = 0 only the rectangle FILLING <>0 filled rectangle The color of the filling has to be declared first with the COLOR- instruction. The subroutine is: 64030 RECTANGLEROUND: 64032 ' -----> XPOS1 ; YPOS1 ; XPOS2 ; YPOS2 64034 ' FILLING 0 or <>0 64036 poke contrl ,11 64038 poke contrl + 2,2 64040 poke contrl + 6,0 64042 if FILLING=0 then poke contrl+10,8 else poke contrl+10,9 64044 poke ptsin ,XPOS1 + 1 64046 poke ptsin + 2,YPOS1 + 38 64048 poke ptsin + 4,XPOS1 + 1 64050 poke ptsin + 6,XPOS2 + 38 64052 vdisys 64054 return An example: 5 ' merge "RECTANGLE.bas" 6 ' merge "RECTANGLEROUND.bas" 9 ' 10 color 1, 1, 1, 5, 2 15 fullw 2: clearw 2 20 XPOS1 = 100 : YPOS1 = 100 : XPOS2 = 300 : YPOS2 = 300 30 gosub RECTANGLE 40 XPOS1 = 200 : YPOS1 = 80 : XPOS2 = 400 : YPOS2 = 200 50 FILLING = 1 60 color 1, 1, 1, 22, 2 70 gosub RECTANGLEROUND 80 waiting = inp(2) 90 end LINES : An other possibility of GEM-VDI is to change lines. We can change the next things: - thickness of the line - pattern - form on the beginning and the end of the line. You can use this routines also for ellipse and rectangle. LINE-THICKNESS : With this routine you can define the thickness of the lines, which have to be drawn on the screen. The syntax is: THICK = ..... gosub LINETHICKNESS To return to the standard thickness: call the routine with the variable THICK = 1. The routine is: 64220 LINETHICKNESS: 64222 ' ----> THICK 64224 poke contrl ,16 64226 poke contrl + 2,1 64228 poke contrl + 6,0 64230 poke ptsin ,THICK 64232 poke ptsin + 2,0 64234 vdisys 64236 return Try this: 5 ' merge "LINETHICKNESS.bas" 9 ' 10 fullw 2: clearw 2 20 for THICK = 37 to 1 step -4 30 gosub LINETHICKNESS 40 x = 20 + THICK * 15 50 linef x, 100, x, 300 60 next 70 waiting = inp(2) 80 end LINE-PATTERN : With this routine you can define in which form the line has to be drawn, with points or with dashes. There are available : 6 line-patterns and 1 free to define. The pre-defined patterns and their values are: VALUE BIT-PATTERN (16 Bits): ----- ---------------------- 1 1111111111111111 2 1111111111110000 3 1111000011100000 4 1111111000111000 5 1111111100000000 6 1111000110011000 7 free to define The syntax is: PATTERN = ..... gosub LINEPATTERN To return to the standard value, call the routine with the variable PATTERN = 1. The routine is: 64240 LINEPATTERN: 64242 ' -----> PATTERN 64244 ' 1 - 7 64246 poke contrl ,15 64248 poke contrl + 2,0 64250 poke contrl + 6,1 64252 poke intin, PATTERN 64254 vdisys 64256 return As usual, an example: 5 ' merge "LINEPATTERN.bas" 9 ' 10 fullw 2: clearw 2 20 for PATTERN = 1 to 7 30 gosub LINEPATTERN 40 y = 60 + 20 * PATTERN 50 linef 50, y, 550, y 52 z = 20 + 70 * PATTERN 55 circle z, 250, 30 60 next 70 waiting = inp(2) 80 end  LINE-ENDS : Normally all lines are angular at the beginning and at the end, but with the next subroutine you can change this in two other forms. You can define as well the form of the beginning of the line as the form at the end. The values are: - round forms 2 - arrow 1 - angular 0 The syntax is: BEGINFORM = ..... ENDFORM = ..... gosub LINESEND The subroutine is: 64200 LINESEND: 64201 ' -----> BEGINFORM ; ENDFORM 64202 poke contrl ,108 64204 poke contrl + 2,1 64206 poke contrl + 6,0 64208 poke intin ,BEGINFORM 64210 poke intin + 2,ENDFORM 64212 vdisys 64214 return An example is: 5 ' merge "LINETHICKNESS.bas" 6 ' merge "LINESEND.bas" 9 ' 10 fullw 2: clearw 2 20 BEGINFORM = 2 : ENDFORM = 1: gosub LINESEND 30 for THICK = 21 to 1 step -4 40 gosub LINETHICKNESS 50 y = 20 + THICK * 12 60 linef 400,y ,100 , y 70 next 80 waiting = inp(2) 90 end The next example shows you what you can do with these routines. I hope that these routines are useful for your programming in Basic and perhaps next time more routines in ST NEWS. 4 ' merge "RECTANGLEROUND.bas" 5 ' merge "LINETHICKNESS.bas" 6 ' merge "LINESENDS.bas" 7 ' merge "LINEPATTERN.bas" 8 ' merge "TEXTFORM.bas" 9 ' 100 ' measuring a rectangle 110 fullw 2: clearw 2 120 thick = 3: gosub LINETHICKNESS 130 xpos1 = 100 : ypos1 = 200 : xpos2 = 300 : ypos2 = 240 140 gosub RECTANGLEROUND 150 thick = 1: gosub LINETHICKNESS 160 pattern = 4: gosub LINEPATTERN 170 linef 80, 220, 320, 220 180 pattern = 1: gosub LINEPATTERN 190 linef 100, 230, 100, 280 200 linef 300, 230, 300, 280 210 linef 295, 240, 340, 240 220 linef 295, 200, 340, 200 230 endform = 1 : beginform = 1: gosub LINESEND 240 linef 330, 200, 330, 240 250 linef 100, 270, 300, 270 255 endform = 0 : beginform = 0: gosub LINESEND 260 textkind = 4 :gosub TEXTMODE 270 gotoxy 11, 16: print "200 mm" 280 gotoxy 20, 12: print "40 mm" 290 textkind = 0: gosub TEXTMODE 300 waiting = inp(2) 310 end This program is also added on the ST NEWS disk as ST BASIC program. ALL ABOUT XBIOS FUNCTIONS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. In the previous issues of ST NEWS we already had a little chat concerning System Variables, BIOS routines and GEMDOS routines; this time, we'll have an in-depth look at XBIOS routines, sometimes called EBIOS routines - it stands for Extended BIOS. These functions are there to enable the programmer to use specific hardware characteristics of the Atari ST. For MC68000 programmers, it is handy to know that TRAP #14 is needed for calling these routines. Thereby, the function number must be put on the stack. While writing this article, we made use of Data Becker's "ST Intern" (ISBN 3-89011-119-X, Data Becker, Merowingestr. 30, 4000 Dsseldorf, West Germany; in Holland: Postbus 8411, 3503 RK, Utrecht, Tel. 030-430254). If you want to know everything  about XBIOS functions, you should buy that publication; it's a must for all serious ST programmers/users. In this article, we will only have a look at how to program these routines from assembler. All C freaks will definately have to get "ST Intern", as will the people that want better examples.... In each example, you might wonder why we added the last line, that usually includes an 'add' instruction. This instruction is necessary to clear the stack (as far as I've understood). The number that goes with it, can be calculated as follows: Each .l you put on the stack: +4 Each .w you put on the stack: +2 Each .b you put on the stack: +1 See? Now, let's go on..... 0 initmous Example: move.l vector,-(sp) move.l parameter,-(sp) move.w type,-(sp) move.w #0,-(sp) trap #14 add.l#12,sp This function can be used to initialize all routines that handle the mouse. 'vector' is the address of a routine that is called by the keyboard processor when a mouse-report occurs. 'type' can choose one of the following alternatives: 0 Disable Mouse 1 Enable Mouse, Relative mode 2 Enable Mouse, Absolute mode 3 Unused 4 enable Mouse, Keyboard mode 'parameter' points to a parameter block, that is built up as follows: char topmode char buttons char xparam char yparam 'topmode' can have on of the following values: 0 Y=0 is located at the bottom corner 1 Y=0 is located at the top corner 'buttons' is a parameter for the 'Set Mouse Buttons' command of the IKBD (we might publish an article about that in the near future as well). 'xparam' & 'yparam' are factors for the mouse movement. When you have choosen 'type' to be 2 (that means that you work with the mouse in absolute mode), vier additional parameters are added to the parameterblock: int xmax int ymax int xstart int ystart These are the x-and y-cordinates of the maximal value of the mouse, and the other parameters specify the position at which the mouse should originally be put. 1 ssbrk Example: move.w quantity,-(sp) move.w #1,-(sp) trap #14 addq.l #4,sp This function may be used to allocate (reserve) a piece of memory. 'quantity' is the number of bytes that should be reserved. That chunk of memory will be allocated at the top of memory. This function should be called before the Operating System starts Initialization. 2 physbase Example: move.w #2,-(sp) trap #14 addq.l #2,sp This function returns a longword, that signifies the Base of the physical screen. On a 512 K machine, this would result in $78000. 3 logbase Example: move.w #3,-(sp) trap #14 addq.l #2,sp This function sets the logical base of screen memory. All operations that use screen memory will be working on this part of memory. If physical and logical screen memory are the same, you will also be able to see what happens on the screen. The function returns a longword, which will be $78000 if you have a 512 K machine. 4 getrez Example: move.w #4,-(sp) trap #14 addq.l #2,sp The 'getrez' function returns the screen resolution, which can be one of the following values: 0 Low Resolution (320x200 pixels; 16 colors) 1 Medium Resolution (640x200 pixels; 4 colors) 2 High Resolution (640x400 pixels; 2 colors)  5 setscreen Example: move.w res,-(sp) move.l physaddr,-(sp) move.l logaddr,-(sp) move.w #5,-(sp) trap #14 add.l #12,sp This function allows the user to change the screen parameters that could be read using one of the three functions we already mentioned before. If one of those parameters should not be set, it is necessary to enter a negative value. The parameters will be set on the next Vertical Blank Interrupt (VBL). 6 setpalette Example: move.l paletpntr,-(sp) move.w #6,-(sp) trap #14 addq.l #6,sp This function enables you to load a new color palette. Therefore you must give a pointer to a table with color values (16 values, all words). The address of the pointer should be even. The colors will be loaded at the next VBL. If you know how to handle this routine quite well, it's possible to simulate more then 16 colors on your screen at one time. I think Magnetic Scrolls used this trick on the first picture of "The Pawn" (which is said to use 500 colors!). Examples: $000 is black, $777 is white, $700 is red, $070 is green and $007 is blue. 7 setcolor Example: move.w color,-(sp) move.w colnumber,-(sp) move.w #7,-(sp) trap #14 addq.l #6,sp This function makes it possible to change just one color at a time (just like "Press '1' or '2' to Start" with Michtron's "Time Bandit V2.0"). 'colnumber' is the number of the color that should be changed. 'color' is the new value of that color, ranging from $000-$777. If you enter -1 as color, you will simply get the old color value of the color with the number 'colnumber'. 8 floprd Example: move.w count,-(sp) move.w side,-(sp) move.w track,-(sp) move.w sector,-(sp) move.w device,-(sp) clr.l -(sp) move.l buffer,-(sp) move.w #8,-(sp) trap #14 add.l #20,sp This function enables the reading of one or several sectors from a disk. 'count' is the number of tracks that should be read sequentially. Values between 1 and 9 are normally possible (number of sectors per track), but with maxi-formatted disks I see no reason why one shouldn't use '10' as well. 'side' selects the side that should be read from. 0 is side A, and 1 is side B. On single sided floppy-drives (like the one I have - snif, snif!) you can only use 0 - side A. 'track' specifies the number of the track the sectors should be read from. This value can vary; it depends on the number of tracks per side. Mostly, this will be 80 (so the value can be from 0 to 79), but is can also be 40, 83, or even another value (that is because of the flexibility of the Disk format for Atari system disk drives). 'sector' is the sector number of the sector that should be read first. Normally, this can be from 0-9, but sometimes it can be 10 as well (on maxi-formatted disks). 'device' is the number of the device the information should be read from. This can be 0 (for drive A) or 1 (for drive B). The line 'clr.l -(sp)' just puts an empty longword on the stack. This is unused. 'buffer' is the address of a piece of memory where the data read should be put. This should always be at a longword-boundary, and there should be enough room to put to info in (512 bytes x the number of sectors you read). The 'floprd' function returns an error code. This can be: 0 OK -1 General Error -2 Drive not Ready -3 Unknown command -4 CRC Error -5 Bad Request -6 Seek Error -7 Unknown Media -8 Sector not Found -9 (No Paper) -10 Write Error -11 Read Error -12 General error -13 Disk is Writeprotected -14 Disk has been Changed -15 Unknown Device -16 Bad Sector -17 Put Disk in Drive 9 flopwr Example: move.w count,-(sp) move.w side,-(sp) move.w track,-(sp) move.w sector,-(sp) move.w device,-(sp) clr.l -(sp) move.l buffer,-(sp) move.w #9,-(sp) trap #14 add.l #20,sp This function enables the user to write one or several sectors to a disk. The parameters have the same meaning as those listed at function 8 (floprd). This function also returns an error code, which can also be one of those listed at the 'floprd' function.  10 flopfmt Example: move.w virgin.-(sp) move.l magic,-(sp) move.w interleave,-(sp) move.w side,-(sp) move.w track,-(sp) move.w sectra,-(sp) move.w device,-(sp) clr.l -(sp) move.l buffer,-(sp) move.w #10,-(sp) trap #14 add.l #26,sp This routine can format one single track. The parameters have the following meaning: 'virgin' is the value with which all sectors of the specified track will be filled when formatted. $E5E5 is mostly used for this. You must look out not to use $F as value for the high nibble! 'magic' is the magic number (the ST is crawling with them!) that has to accompany the formatting. In this case, it has to be $87654321 (I suppose the people at Atari had a lack of originality when they used introduced this magic number; some other 'magic' numbers are birth-dates, BIOS launch-dates, etc.). 'interleave' specified the sequence in which sectors are written to disk. Normally this is 1. I think the guy who designed Copystar at RDS software used this variable for his "fast-load disk"-bit. 'side' determines the side on which the track is located that should be formatted. Ofcourse, one cannot select another value for this than 0 if one has a single sided disk drive. 'track' is the number of the track that should be formatted. Normally, this will be 0-79, but it can also be a higher number (even upto 83!). Watch out: if you want the track to be used for program storage, the boot sector must 'know' that there are such high tracks! Also, not all disk drives are able to read tracks above number 79. As a part of copy protection, this function can cause quite a lot of grey hairs with certain people. 'sectra' is the number of sectors on that track. Unless you're designing some hot-shot copy protection, this should be of the same value that all other tracks are formatted with. This will normally be from 0 to 9, but it can also be 10. 'device' is the device number (have a look at 'floprd' for whihc numbers you may use). 'clr.l -(sp)' is here used to put an empty - unused - longword on the stack, just like its counterpart in the function 'floprd' and 'flopwr'. 'buffer' for the complete trackdata. If you use 9 sectors per track, this must be at least 8 Kb in size. The function returns an error code. If it is -16, bad sector, it means that the data couldn't be properly verified. In that case, the buffer will contain a list of bad sectors (seperated by '0'). You can try to format the track again, or you can mark the bad sectors. Just like the 'floprd' and 'flopwr' functions, you can check for an error with the following sequence: tst d0 bmi error ....Rest of the program error ....Error handle routine 11 unused 12 midiws  Example: move.l pntr,-(sp) move.w count,-(sp) move.w #12,-(sp) trap #14 addq.l #8,sp With this function, it is possible to send a string of data to the MIDI OUT port. 'pntr' is the pointer to the memory address on which the string is located. 'count' is the number of bytes that should be sent -1. So if you want to send 12 bytes, that value should be 11. 13 mfpint Example: move.l vector,-(sp) move.w number,-(sp) move.w #13,-(sp) trap #14 addq.l #8,sp This function is used to initialize an Interrupt routine in the MFP. 'number' is the number of the MFP-Interrupt, which can be from 0 to 15. 'vector' is the address on which the vector that belongs to that Interrupt routine is located. 14 iorec Example: move.w device,-(sp) move.w #14,-(sp) trap #14 addq.l #4,sp This routine is there to get the pointer to a buffer-data-line for an input device. The following input devices may be selected: 0 RS232 1 Keyboard 2 MIDI The buffer-data-line is built up as follows: long ibuf Pointer to input buffer int ibufsize Size of input buffer int ibufhd Head Index int ibuftl Tail Index int ibuflow Low water Mark int ibufhi High water Mark For more specific information, I am afraid I must tell you to have a look at pages 200 and 201 of Data Becker's "ST Intern". The specifications and examples mentioned there might make working with this XBIOS function more clear, whereas talking about them in this article would be too much of a hassle.  15 rsconf Example: move.w scr,-(sp) move.w tsr,-(sp) move.w rsr,-(sp) move.w ucr,-(sp) move.w ctrl,-(sp) move.w baud,-(sp) move.w #15,-(sp) trap #14 add.l #14,sp This XBIOS function configurates the RS232 Interface. The parameters thereby have the following meaning: 'scr' is the Synchronous Character Register in the MFP. 'tsr' is the Transmitter Status Register in the MFP. 'rsr' is the Receiver Status Register in the MFP. 'ucr' is the USART Control Register in the MFP. 'ctrl' is a communication-parameter. 'baud' is the baudrate. Whenever a parameter turns out to be -1, the old value is kept on the MFP 68901. You should have a look at some documentation about the MFP 68901 processor for the meaning of the MFP registers. 'ctrl' is used to specify the Handshake-Mode: 0 No Handshake (that is default on power-up) 1 XON/XOFF 2 RTS/CTS 3 XON/XOFF and RTS/CTS (not very useful) 'baud' can have one of the following values: 0 19200 1 9600 2 4800 3 3600 4 2400 5 2000 6 1800 7 1200 8 600 9 300 10 200 11 150 12 134 13 110 14 75 15 50 GEM VDI CALLS PART II by Manus In this article, I'll give you some more GEM-routines which you can use in ST BASIC. The subjects in this article are: - getting the mouse-position - definition of a new mouse - mark-statements - some graphic statements MOUSE-POSITION AND KEYS: To get the mouse-position is certainly the most interesting routine in GEM, because with this routine you can make your programs professional; no more input of a character, but just click the wanted option. The routine gives you the wanted values in the variables XMOUSE, YMOUSE and KEY, but remember we have to correct the values in XMOUSE and YMOUSE (see PART 1, RECTANGLE). The variable KEY can have three different values: Pressed key Value ------------- ----- Left 1 Right 2 Left and right 3 The syntax is: gosub MOUSE  The routine is: 63000 MOUSE: 63002 ' <----- XMOUSE ; YMOUSE ; KEY 63004 poke contrl, 124 63006 vdisys 63008 xmouse = peek(ptsout ) - 1 63010 ymouse = peek(ptsout + 2) - 38 63012 key = peek(intout) 63014 return Try this: 5 ' merge "MOUSE.bas" 10 fullw 2: clearw 2 20 color 1,1,1,1,1 30 start: gosub MOUSE 40 if key = 1 then pcircle xmouse, ymouse, 5, 0, 3600: 50 if key = 2 then gotoxy 0,0 : print xmouse, ymouse 60 if key = 3 then clearw 2 70 goto start SHOW-MOUSE: Sometimes, it is very annoying that you can not see the mouse- symbol at all times, because he gets invisible with every output on the screen or every input on your keyboard. Only when you move the mouse, you can see him again. With the next GEM-routine you can make the mouse visible at any time you want.The syntax is: gosub SHOWMOUSE  The routine is: 63030 SHOWMOUSE: 63032 poke contrl, 122 63034 poke intin, 0 63036 vdisys 63038 return MOUSE-SHAPE: The Atari has 8 different mouse-shapes, which we can also use in Basic. The mouse-shapes are: Shape: Value: --------------- ------ Arrow 0 Stretched rounded X 1 Bee 2 Pointing hand 3 Open hand 4 Cross 5 Fat cross 6 Outlined cross 7 To do this, we have to use a little AES-programming. The syntax is: MOUSENUMBER = 0...7 : gosub MOUSESHAPE  The routine is: 63280 MOUSESHAPE: 63282 ' -----> MOUSENUMBER 63284 ' 0 - 7 63286 if mousenumber > 7 then return 63288 add# = gb 63290 gintin = peek(add# + 8 ) 63292 addrin = peek(add# + 16) 63294 poke gintin, mousenumber 63296 poke addrin, 0 63298 gemsys (78) 63300 return DEFINITION OF A MOUSE-SYMBOL: It is possible to create your own mouse-symbol, like in drawing- programs, with the VDI-routine 111. The grid and the backgroundgrid are each 16 words of 16 bits. We have to POKE these values on certain addresses. The backgroundgrid defines which screenpoint of the field (16 by 16) under the mouse-symbol has to stay visible and which point has to been wiped. That is specially important when the mouse-symbol goes over a dark field. Therefore it is advisable to make the backgroundgrid greater then the mouse- grid. We have to use the next addresses: INTIN + 8 color of the mouse: black or white INTIN + 6 color of the backgroundgrid INTIN + 2 ) point of the mouse, valid for determination INTIN + 4 ) of the mouse-position In the following program we have put the information of different mouse-symbols in DATA-lines. To read these DATA we have to put the DATA-pointer to these data. The syntax is: Restore dataline gosub MOUSEDATA  The routine is on the next page. 63140 '--------------- MOUSEDATA -------------------------- 63141 HAMMER: 63142 data 96,480,960,1984,3968,8064 63143 data 7936,16256,15872,32512,32512,65408 63144 data 65408,65472,63424,65504,25568,65520 63145 data 496,62456,248,508,124,254 63146 data 62,127,31,63,14,31 63147 data 4,14 63150 COFFEE: 63151 data 4624,16184,9248,32376,4640,16368 63152 data 4672,16352,4384,16352,2624,8128 63153 data 0,16320,16352,32764,16380,32766 63154 data 16358,32767,16354,32767,16358,32767 63155 data 16380,32767,16352,32766,8128,16352 63156 data 0,8128 63160 WORM: 63161 data 0,8064,8064,16320,16320,32736 63162 data 26208,65520,30560,65520,32736,65532 63163 data 29132,65534,16318,32767,8054,16383 63164 data 7782,16383,7372,16382,7384,16380 63165 data 4080,8184,2022,4095,60,2046 63166 data 24,62 63199 '------------------------------------------------- 63200 MOUSEDATA: 63202 '---> restore line 63204 for a = 0 to 15 63206 read gridfront,gridback 63208 poke intin + a * 2 + 42, gridfront 63210 poke intin + a * 2 + 10, gridback 63212 next 63214 '------------------------------------------------- 63250 MOUSENEW: 63252 poke contrl , 111 63254 poke contrl + 6, 37 63256 poke intin , 5 63258 poke intin + 2, 5 63260 poke intin + 4, 1 63262 poke intin + 6, 0 63264 poke intin + 8, 1 63266 vdisys 63268 out 2,7 63270 return Example: 5 ' merge "MOUSEDATA.bas" 6 ' merge "SHOWMOUSE.bas" 9 ' 10 restore worm: gosub mousedata: gosub showmouse 20 waiting = inp(2) 30 restore hammer: gosub mousedata: gosub showmouse 40 waiting = inp(2) 50 restore coffee: gosub mousedata: gosub showmouse 60 waiting = inp(2) 70 end  MOUSE-EDITOR: This next program can be used to create mouse-symbols; it calculates the necessary bit-values and pokes them in the addresses. After the input of: gosub MOUSEEDITOR  the new calculated mouse-symbol appears on the screen. You have to write down the decimal values of the mouse-grid and its backgroundgrid and put them in DATA-lines (see line 63106, remove the REM-statement) like in MOUSEDATA. Using DATA-statements is much faster then using this program for your new mouse-symbol. When your new mouse-symbol disappears you can recall it through: gosub MOUSENEW  The routine is: 63050 MOUSEEDITOR: 63052 dim a$(16),b$(16) 63054 a$( 0)="---*--*----*----":b$( 0)="--******--***---" 63056 a$( 1)="--*--*----*-----":b$( 1)="-******--****---" 63058 a$( 2)="---*--*---*-----":b$( 2)="--**********----" 63060 a$( 3)="---*--*--*------":b$( 3)="--*********-----" 63062 a$( 4)="---*---*--*-----":b$( 4)="--*********-----" 63064 a$( 5)="----*-*--*------":b$( 5)="---*******------" 63066 a$( 6)="----------------":b$( 6)="--********------" 63068 a$( 7)="--*********-----":b$( 7)="-*************--" 63070 a$( 8)="--************--":b$( 8)="-**************-" 63072 a$( 9)="--*********--**-":b$( 9)="-***************" 63074 a$(10)="--*********---*-":b$(10)="-***************" 63076 a$(11)="--*********--**-":b$(11)="-***************" 63078 a$(12)="--************--":b$(12)="-***************" 63080 a$(13)="--*********-----":b$(13)="-**************-" 63082 a$(14)="---*******------":b$(14)="--*********-----" 63084 a$(15)="----------------":b$(15)="---*******------" 63086 for a = 0 to 15 63088 gridfront = 0: gridback = 0 63090 for b = 15 to 0 step -1 63092 if mid$(a$(a),b+1,1)="*" then bit = 1 else bit = 0 63094 gridfront = gridfront + 2 ^(15 - b) * bit 63096 if mid$(b$(a),b+1,1)="*" then bit = 1 else bit = 0 63098 gridback = gridback + 2^(15 - b) * bit 63100 next 63102 poke intin + a * 2 + 42, gridfront 63104 poke intin + a * 2 + 10, gridback 63106 ' lprint gridfront, gridback 63108 next 63110 goto mousenew 63112 '--------------------------------------------------- POLYMARK: We can use different drawings as mark, these drawings are: - point - cross - star - rectangle - slanting cross - diamond All marks can be made in every size. The syntax is: XPOS = .... : YPOS = .... MARKFORM = .... MARKSIZE = .... gosub POLYMARK To draw an other one: XPOS = .... : YPOS = .... gosub POLYMARK  It is possible to draw several marks at the same time. We have to use some addresses: PTSIN + 4, PTSIN + 6, .... Positionparameters CONTRL + 2 Number of marks Theoretically we can wipe a mark by drawing it again with the backgroundcolor. But then we lose the background-information and it is impossible to draw on dark backgrounds. Therefore we use the routine 'TEXTFORM' with its option XOR (form=3). By using XOR twice we get the original screeninformation again and the background stays unchanged. The routine is: 63400 POLYMARK: 63402 ' ----> XPOS ; YPOS 63404 ' ----> MARKFORM ; MARKSIZE 63406 ' 63408 poke contrl , 18 63410 poke contrl + 2, 0 63412 poke contrl + 6, 1 63414 poke intin, markform 63416 vdisys 63418 poke contrl , 19 63420 poke contrl + 2, 1 63422 poke contrl + 6, 0 63424 poke ptsin , 0 63426 poke ptsin + 2, marksize 63428 vdisys 63430 ' 63432 MARKSETTING: 63434 ' (----> XPOS ; YPOS ) 63436 poke contrl , 7 63438 poke contrl + 2, 1 : ' or more 63440 poke ptsin , xpos + 1 63442 poke ptsin + 2, ypos + 38 63444 vdisys 63446 return 63448 '--------------------------------------------------- The routine 'TEXTFORM': 65130 TEXTFORM: 65132 ' -----> FORM ( 1 - 4) 65134 ' 65138 poke contrl ,32 65140 poke contrl + 2,0 65142 poke contrl + 6,1 65144 poke intin, form 65146 vdisys 65148 return A test: 5 ' merge "POLYMARK.bas" 6 ' merge "TEXTFORM.bas" 9 ' 10 fullw 2: clearw 2 20 color 1,1,1,1,1 30 form = 3: gosub TEXTFORM 40 pellipse 310, 200, 140, 80, 0, 3600 50 start: 60 xpos = 50: ypos = 160 : marksize = 50 70 for markform = 1 to 7 80 xpos = xpos + 60 90 gosub POLYMARK 100 next 110 gotoxy 15,11: print "ST NEWS IS THE BEST" 120 waiting = inp(2) 125 end 130 goto start POLYLINE: This routine is the same as the statement 'LINEF' in ST Basic, but much faster. The syntax is: XCOORD ( 1,.....,N ) YCOORD ( 1,.....,N ) gosub POLYLINE   The routine is: 64300 POLYLINE: 64301 ' -----> NUMBER ; XCOORD ; YCOORD 64302 poke contrl , 6 64304 poke contrl + 6, 0 64306 poke contrl + 2, number 64308 for i = 0 to number 64310 poke ptsin + i * 4, xcoord(i) + 1 64312 poke ptsin + 2 + i * 4, ycoord(i) + 38 64314 next 64316 vdisys 64318 return 64320 '--------------------------------------------------- Try this and compare the speed: 5 ' merge "POLYLINE.bas" 9 ' 10 dim xcoord(200), ycoord(200) 20 fullw 2: clearw 2 30 number = 80 40 for i = 0 to number 50 xcoord(i) = 10 + i * 600/number 60 ycoord(i) = 100 + rnd(1) * 200 70 next 80 gosub polyline 90 waiting = inp(2) 100 end POLYGON: With this routine we can draw and fill all imaginable figures. The routine works much faster then the 'LINEF' - and 'FILL'-statement. The grid is defined through the 'COLOR'-statement. The syntax is: XCOORD ( 1,.....,N ) YCOORD ( 1,.....,N ) gosub POLYGON  The routine is: 64140 POLYGON: 64142 ' -----> ANGLES ; XCOORD ; YCOORD 64144 poke contrl , 9 64146 poke contrl + 6, 0 64148 poke contrl + 2, angles 64150 for i = 1 to angles 64152 poke ptsin + (i - 1) * 4, xcoord(i) + 1 64154 poke ptsin + 2 + (i - 1) * 4, ycoord(i) + 38 64156 next 64158 vdisys 64160 return 64162 '--------------------------------------------------- Example: 5 ' merge "POLYGON.bas" 9 ' 10 dim xcoord(20), ycoord(20) 20 color 1,1,1,7,2 30 fullw 2: clearw 2 40 angles = 6 50 for i = 1 to angles 60 read xcoord(i), ycoord(i) 70 next 80 gosub polygon 90 waiting = inp(2) 100 end 110 data 10,100,400, 40,250,200 120 data 380,290,150,230, 70,240 POLYGON2: This routine is a special Polygon-routine for drawing symmetrical polygons with self-defined number of angles. The syntax is: XPOS = .... : YPOS = .... RADIUS = .... : ANGLES = .... gosub POLYGON2  The 'COLOR'-statement defines the grid. The routine is: 64100 POLYGON2: 64102 ' -----> XPOS ; YPOS 64104 ' RADIUS ; ANGLES 64106 phi = 3.141593/angles/2 64108 STAR: 64110 ' -----> PHI 64112 poke contrl , 9 64114 poke contrl + 6, 0 64116 poke contrl + 2, angles 64118 for angle = 0 to angles * 4 step 4 64120 poke ptsin+angle , 1+xpos+cos(phi*angle)*radius 64122 poke ptsin+(angle+2), 38+ypos+sin(phi*angle)*radius 64124 next 64126 vdisys 64128 return 64130 '-------------------------------------------------- Example: 5 ' merge "POLYGON2.bas" 9 ' 10 fullw 2: clearw 2 20 color 1,1,1,7,2 30 xpos = -50 : ypos = 150 35 radius = 50 40 for angles = 3 to 7 50 xpos = xpos + 120 55 gosub polygon2 60 next 70 waiting = inp(2) 80 end STARS: Using the routine 'POLYGON2' and with a little adjustment of the angle and like magic beautiful stars appear on the screen (something for Christmas ?) 5 ' merge "POLYGON2.bas" 9 ' 10 fullw 2: clearw 2 20 color 1,1,1,8,2 30 ypos = 150 : radius = 50 40 angles = 7 50 xpos = 100 : phi = 3.1416/2/angles * 2 : gosub star 60 xpos = 200 : phi = 3.1416/2/angles * 3 : gosub star 70 xpos = 300 : phi = 3.1416/2/angles * 2.8 : gosub star 80 xpos = 400 : phi = 3.1416/2/angles * 1.7 : gosub star 90 xpos = 500 : phi = 3.1416/2/angles * 2.5 : gosub star 100 angles = 11: ypos = 250 110 xpos = 100 : phi = 3.1416/angles * 1.5 : gosub star 120 xpos = 200 : phi = 3.1416/angles * 2 : gosub star 130 xpos = 300 : phi = 3.1416/angles * 2.5 : gosub star 140 xpos = 400 : phi = 3.1416/angles * 1.9 : gosub star 150 xpos = 500 : phi = 3.1416/angles * 2.6 : gosub star 160 waiting = inp(2) 170 end THE ULTIMATE EXAMINING UTILITY V2.8 by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. In the previous issue of ST NEWS, you might remember that I promised "The Ultimate Examining Utility". Well, it took a long time but it's finally finished. I might say it took quite a while, and I am a bit disappointed in myself for not being able to include the following options: Sector Examine (so all  sectors, and not just the boot sector), Get BIOS Parameter Block and Format Track. My original plan was to include a monitor/disassembler as well, but I couldn't do that either. But it wasn't meant as a superb utility in the first place, but more as an example of how to work with GfA Basic on a somewhat higher level. You will find the program listing down here, while there's also a working version of the program supplied on the disk with this issue of ST NEWS. If you have any questions with regard to "The Ultimate Examining Utility" Version 2.8, I hereby ask you to send them to our correspondence address. Please add a stamp (or, if you live outside of Holland, an International Reply Coupon) so we can answer your question(s). A remark for people who like disk manipulation: Remember that the positions of bytes in the boot sector starts counting at 0, whereas the MID$ command starts at 1. That's why I define each MID$ one higher 'as normal'! PATTERN EDITOR by Jos Schilders and Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 5, launched on October 5th 1986. As the second major listing in this issue of ST NEWS, we hereby offer the Pattern Editor I promised in the previous issue. It is a program written in GfA Basic, that enables you to define FILLs, SPRITEs and MOUSEs for use with GfA Basic's DEFMOUSE, DEFFILL and SPRITE commands. A short user guide to Pattern Editor version 1.4a. The first thing that appears on the screen, is the title page. Just go on by hitting return or clicking "OK" in the Alert Box. Next, you must choose whether you wish to design a FILL, MOUSE or SPRITE. In all three modes, you get one or two grids, in which you can turn dots on by clicking on the appropriate grid box with the left mouse key, whereas they can be cleared by using the right mouse key. When you want to stop the input, simply move the mouse pointer to "END OF INPUT", at the bottom of the screen, and click the mouse. With FILL and MOUSE, you can now choose if you want to SAVE you work to disk or if you just want to quit. The last option brings you back into the first selection menu. When you have designed a SPRITE, however, you're asked first if you want it to be a normal or and XOR sprite. These are the two sprite types GfA Basic supports. Data is SAVEd in the following format: Data MKI$(&X................) If you want to use the data in your own program, simply MERGE the data into your program, and then add up all the MKI$() in a single string, e.g. A$. If you would now use "SPRITE A$,100,100", a SPRITE would appear on the screen with the form you had just designed. The action point will be located on the cordinates 100,100. Both SPRITEs and MOUSEs have action points, on which all SPRITE-and MOUSE function will afterwards be specified. With MOUSE, if you use the normal arrow, this would be 0,0. Please refer to the GfA Basic manual or articles about GfA Basic in ST NEWS for more specifications about FILL, SPRITE and MOUSE. Now something about the programming. Mainly, the program consists of three parts, of which two are almost exact duplicates of each other. This we did to accomplish better overall summary of the program. In fact, only the SAVE routines from SPRITE and MOUSE differ significantly. You might wonder why we used "PAUSE 10" quite often. We did this to get rid of nasty bells when working with Alert Boxes. Try getting them out and you'll know what we mean. This Pattern Editor took several weeks to finish, and was ready on Sunday, September 28th, 1986 (at about half past nine, to be exact). We hope you'll like it. And we hope you'll use it. We will! Here is the program listing; you'll find a working version of the program in GfA Basic format on the disk of this issue of ST NEWS, as well as an example for a FILL, MOUSE and SPRITE. GFA BASIC TIPS & TRICKS by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. Most people already know about the new GfA Basic that's been finished recently: Version 2.0. It contains over 30 extra commands, which will be discussed in a seperate article in the next issue of ST NEWS. To obtain the newest version, you'll have to do the following (in Germany): 1) Send the original GfA Basic (old version) to: GfA Systemtechnik GmbH, Heerdter Sandberg 30, D- 4000 Dsseldorf 11 (telephone 0211/588011) 2) Enclose your registration card (if you haven's sent it to them already) 3) Enclose an envelope for the way back (C-5 size, with air bubbles, with DM 2,50 stamps on it) 4) Enclose DM 20,- cash (this is to cover for all kinds of costs, including the 36 pages manual extra). I promised to have a chat about SETTIME, SPRITE, UPPER$, PSAVE and GET/PUT this time, so I'll start right away. The SETTIME command has the following syntax: SETTIME timestring,datastring This command is really very simple to use. You'll just have to make sure that all data is entered with two digits. So the first of Januari 1987 would be "01.01.1987". The time is also given in two digits each, with which you have to watch out for PM or AM times. So 9 o' clock in the morning would be "09:00:00", "09:00" or "0900", whereas the '09' should be replaced by '21' if you mean 9 o' clock in the evening. Note: when you enter the time, the ':' and even the seconds can be left away, whereas the date has to be entered with '.' as seperation. When you enter a faulty date or time, they aren't changed. Now, let's go on to the SPRITE command (for which I bet you've been waiting all the time!). In the previous issue of ST NEWS we published a program called "Pattern Editor", from which you might have guessed a bit about the SPRITE command already. The format is as follows: SPRITE A$[,x,y] 'A$' can be another string expression if you want to, of course. If you enter SPRITE A$, the sprite will be removed from the screen, whereas entering e.g. SPRITE A$,100,100 will put your sprite on x-and y-position 100 and 100. The action point of the sprite will then be located at those exact cordinates. The 'A$' is built up like this: A$=MKI$(x-cordinate of the action point) +MKI$(y-cordinate of the action point) +MKI$(0) If this value is 0, the sprite will be displayed normally, if it is 1 it will be displayed XORed +MKI$(mask color) this will be 0 most of the time +MKI$(sprite color) this will be 1 most of the time +PAT$ (this is the bit pattern of the mask and the sprite) The complete 'A$' can be made with the help of the Pattern Editor we published in the previous issue of ST NEWS. Now, let's go on with the UPPER$ function. Actually, this function will not be used very often by most programmers, but it can be very useful in certain routines. The format is: UPPER$(string) This function converts all the alpha-characters of a string to capitals, including occasional 'umlauts' (in German). All non- alpha-characters will be left unchanged. Examples: "abcde" will be turned into "ABCDE" "4574hf" will be turned into "4574HF" Two other GfA Basic commands, GET and PUT will be talked about at once. These can be very useful in drawing programs, as they can 'cut' pieces from screen memory and put them somewhere else in screen memory (as you will be able to read in the next issue of ST NEWS, these commands will also be added in a special version - to move pieces of normal memory quickly - in the new version of GfA Basic). Their formats are: GET x0,y0,x1,y1,A$ PUT x0,y0,A$[,mode] With the GET command, x0 and y0 comprise the upper lefthand cordinates of the box that has to be put into A$ (here, again, A$ can be any other string expression), whereas x1 and y1 are the cordinates of the lower righthand point of the box to be stored. Once A$ is GET, you can later use the PUT command to put A$ back on the screen again, on any spot you wish, where x0 and y0 are the cordinates of the upper lefthand point where the box will be put. Of course, the other cordinates will not have to be specified, since the size of the box was already defined using GET. The PUT command also enables the user to specify an optional parameter ('mode'). This parameter determines the mode in which the box is put on screen. The values can range from 0 to 15: (S is the string, I is the image that was there before) 0 Erase 1 S and I 2 S and (not I) 3 S (overwrite) 4 (not S) and I 5 I (do nothing) 6 S xor I 7 S or I 8 not (S or I) 9 not (S xor I) 10 not I (invert) 11 S or (not I) 12 not S (reverse overwrite) 13 (not S) or I 14 not (S and I) 15 1 Next time, I'll talk about the new GfA Basic commands in GfA Basic V2.0, but here's already a sneak preview: The run-only interpreter of the new version has been changed as well. It is now possible to execute the run-only interpreter, after which it will immediately load the actual GfA Basic program. This way, you could call the Run-only interpreter "YOURFILE.PRG", and the GfA Basic file "YOURFILE.RSC". This tends to look very professional! Make sure to have a backup of the run-only interpreter before you enter this small program: OPEN "U",#1,"YOURFILE.PRG" SEEK #1,30 PRINT #1,CHR$(0);"YOURFILE.RSC" CLOSE #1 That's all. Thanks to Pim Coenradie (who received the new user manual before I did) for telling me this; he also used it in his program "Simple Draw". STARFIEND by L.S. Murray Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. This time, we proudly publish another novelette, taken from a computer magazine from May 1984. 1984 by Business Press International, Ltd. Each time as he fired, an enemy died. His face wore an impassive blankness as his fingers, barely moving, operated the controls of his machine, but his eyes were filled with resolve and dedication. He knew that the end was near but his gaze did not wander from the screen to the protentous fuel gauge for an instant. That would mean missing a target, wasting a round. He never wasted a round. To shoot was to destroy. The fuel ran out. The shrill sounds of the warning filled his ears as the controls froze. His last missile smashed into the target ships, blowing them into incandescent fragments. For a while the screen was clear, then two enemy ships popped out of hyperspace ahead of him. One flashed across his field of vision; Starfiend's finger touches his fire button automatically and the ship ceased to exist. Meanwhile, the other accelerated along a wide curve, clear of his field of fire. It was going to ram him. They wanted him that badly. The screen blazed blue-white, and the echoes of the explosion chased each other up and down the arcade. Starfiend gurgled in delight and, in answer to the machine's prompt, entered his name. It appeared, in coruscating letters, at the top of the screen while below it the machine proceeded with the important business of enticing the next client. As Starfiend turned to leave, he bumped into the man who had been watching him over his shoulder. Starfiend had not seen him arrive but such had been his concentration that this did not surprise him. "Sorry," he mumbled cursing his tongue, which seemed like a roll of carpet and which made his life a misery. He knew that the man would not understand him. "That's alright, son," replied the man. Starfiend gasped inwardly at his error. Normally, if strangers bothered at all they could only understand him with persistence and repetition. The man continued, "I've been watching you, and I'm very impressed. You must have put in a lot of practice." He paused, inviting a reply. Starfiend wriggled in inner conflict. Experience told him to escape, before the innocent conversation became an embarrasing trap for them both, but curiosity and excruciating loneliness urged him to stay. "No," he ventured, the word rolling off his tongue like a sticky clay ball. The stranger raised his eyebrows in interested astonishment. Emboldened, Starfiend continue: "They moved this machine in on Monday. That was the fifth time I've played it." The stranger nodded. He had understood. He scrutinised the machine's score chart. The top five entries were Starfiend's. and his lowest score was twice that beneath it. "They'll never grow rich with people like you about," he quipped, then added less gently, "Shouldn't you be at school?" Horror and suspicion flooded Starfiend's mind. Was the stranger a school inspector; a truant hunter? Brazenly, he responded, "Yes. Right now, I should be attending a music lesson. The music teacher likes choral work. Not much point me being here, is there?" The last sentence was spoken in a bitter tone. The stranger looked thoughtful. "You don't like school?" "I would if it liked me." "Have you considered a special school?" "I have; but my parents think that I'm better off with 'normal' boys." "So you come here to avoid school?" "No!" Starfiend was adamant. "School's unpleasant; and there I'm average to poor. But here, I'm king. The arcade owner never turns the machines off, so my name's on top of all their lists. I don't want them to know who Starfiend is. I know, and that's all I need." The stranger nodded, as if he had heard something he already knew. "Are you going back to school now?" he asked. Starfiend nodded. The stranger continued, "May I walk with you?" They left the arcade and made their way down the High Street, a canyon of corrugated iron and plywood made both colourful and seedy by a profusion of posters advertising gigs and wrestling matches. For a while they strolled, silent amid the noise and fumes, then the stranger remarked, "Have you ever wondered how those machines work, Starfiend?" "Microprocessors," replied the boy, instantly realising that the word was a meaningless reflex action. "No, I guess not. I asked my physics teacher once, but all I got was a load of chat about energy gaps and conduction bands." "I'm surprised you remember those terms." "Once I learn to say something, I don't forget it." The stranger flushed. "I'm sorry." "It's alright, I didn't mean it like that." Actually, he had, but Starfiend felt ashamed of his petulance. New friends were not to be treated so badly. "Tell me," he asked, "how do microprocessors work?" "I don't know, I'm not a scientist, I'm a soldier. No, the reason I brought the subject up was to point out a curious anomaly. Does it not seem strange to you that developments in electronics over the past few years far outstrip those made in other fields?" "Do they?" said Starfiend. As if cued, wo sports cars leapt away from the nearby traffic lights, their exhausts bellowing and tyres squealing. They raced neck and neck up the hill and were lost to sight. "Take those cars," said the stranger. "They have components made of advanced steel alloys, and electronically controlled engines, yet they are based on principles known to the Romans; hot gases expand. But they are grossly inefficient. Don't you think that in 2,000 years something more elegant could have been contrived?" "Like what?" "I told you, I am not a scientist. But where I come from, we have engines as far in advance of those cars as they are in advance of Newcomen's. That, and a thousand other wonders, such as my presence here." "Where do you come from?" Starfiend felt cautious. He was not afraid; if the stranger intended him harm, he could have done so already. Perhaps he was insane. Yes, that was it. "I will tell you in a minute. First, though, let me ask you this: how is it, do you think, that I am able to understand you so easily?" "I don't know." "Perhaps this will make it clear." For a second Starfiend wondered what he meant. Then it dawned on him; the stranger had not moved his lips. He had not spoken the last sentence. "Telepathy," thought Starfiend aloud. His immediate reaction was one of relief. He had been subconsciously puzzled by the ease with which he and his friend could communicate and, above all, he knew that he could rest his aching tongue. Suspicion came next: "How much can you see?" "Only what you want me to. Others I know can see more, but they don't look without reason." "What's it like?" "Seeing. Hearing. Touching. But there are drawbacks. Consider those cars we saw. If I tried to drive one through your traffic, I would be dead before the day was out. My reactions are four time slower than your people consider normal - 12 times slower than your own." Starfiend was pleased by the indirect compliment. He noticed on reflection that the stranger's gait was rather ponderous. The stranger continued, "So we read minds. Those who are born without the ability can be cured. The reaction speed we can do nothing about." "Please tell me where you're from," begged Starfiend. "Try a guess." "I suppose the chances of a race from another planet looking exactly like us are negligible. I doubt that a country of telepaths could remain undiscovered. That only leaves one possibility." "You're right. I'm from your future. Your scientists know that time travel is possible, but they shrink from the consequences..." "Which are?" Starfiend had already discovered that interruptions were much easier in telepathic conversation, in fact almost unavoidable. "Effect without cause. Call it backwaters in time, if you like. It's no more difficult a concept than Einsteinian relativity would have been to a contemporary of Galileo." "But what about all the objections? Like killing your own father before you were conceived?" The stranger laughed. "You might cause yourself to cease to exist. Or not. Or you might not be able to kill your father, no matter how hard you try. In any case, don't let it bother you. Time travel is possible. The space-time continuum can be changed, but it is elastic, and changes tend to smooth themselves out eventually." Questions whirled in Starfiend's brain. The stranger answered them. "Yes, we still have weapons, and wars to be fought with them, although not amongst are own kind. Far, far in the future. No, we don't use our control of time against our foes, since to do so might provoke retaliation that could destroy everything. Everything! Neither do we or the enemy allow artificial minds to fight for us." He saddened, and answered Starfiend's last question. "Yes, we are loosing. That is why I'm here." "Your telepathy is useless in war, and your slow reaction speed leaves you at a disadvantage. Why don't you send computers to fight your battles for you?" "Because that would start an uncontrollable race which would lead to sentient machines - sentient creatures - being created to destroy each other. Neither us nor the enemy are that dishonourable." "Then change your reactions." "We cannot. We no longer have the necessary gene pool. I have come to get those genes." Starfiend knew that he should wake out of what seemed to be a dream, or be terrified, but neither happened. Instead, he quivered with excitement. "And the arcade games? Microelectronics?" "Screening machines. Presents from us to you, given through the minds of your engineers. I know you want to come, Starfiend." "My family..." hedged the boy. "I can make it as if you have never existed. There will have been a minor disturbance outside your house the night you would have been conceived. You will become a backwater in time." "Truly?" "We cannot lie with our thoughts, my friend." "Alright." Instantly, Starfiend felt a wrench within his stomach. A car move 10 metres forward instantaneously; a piece of paper at their feet vanished. Throughout the world, similar trivial changes took place. Starfiend's parents had a new son who was normal in every respect, and they were happy. "Ready?" said the stranger. Starfiend nodded. They turned into the vandalised doorway of a shop, where a dazzling bluey purple ball appeared at stomach height. It delated into an ellipse as large as a man. Through it, Starfiend saw his first glimpse of the land where he would be a hero. The time traveller grasped his wrist firmly but gently. "You can still go back," he said. Starfiend shook his head vigorously. "Mind the edges, then," said the time traveller. They stepped trough. 68000 MACHINE LANGUAGE COURSE PART I by Mark van de Boer Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. As the title already says this is the first part of an 68000 assembly language programming course. This course is intended for people who already have a little experience with programming in assembly language on microprocessors like the 6502 (6510 is in fact the same) and the 68xx (like 6800, 6801, 6805, 6809) series. In this course these two microprocessor-families will be referenced by their most famous members, the 6502 and the 6809. At this time it is not exactly known how many articles this course will have. I think it will be about six articles long. Now I will describe some features of the 68000. The 68000 is a sixteen-bit microprocessor. This means that an opcode is always sixteen bits (On the 6502 and 6809 an opcode is 8 bits, therefore they are called 8-bit microprocessors). The databus of the 68000 is 16 bits wide, this means that 16 bits can be transferred at once by the 68000 (The 6502 and 6809 both have a databus that is eight bits wide, so they can transfer 8 bits at once). Another important feature of the 68000 is its impressive set of registers. First there are the eight data registers, numbered D0- D7. They are 32 bits wide and can be used for operations on 8-bit, 16-bit and 32-bit quantities. Data registers can be compared with the A-register (Accumulator) on the 6502 and 6809, their function same, but the use of the data registers is much more convenient. Second, there are the eight address registers, numbered from A0-A7. They are 32 bits wide as well and their only use is in addressing memory. However, the upper 8 bits are ignored by the 68000 since its address bus is 'only' 24 bits wide, meaning that the 68000 can address up to 16 megabytes of memory. Register A7 has a special function; it is called the system stackpointer. This means that if you execute a JSR instruction, some data will be saved on the address contained in this register. By the way, you can use every address register very easily as a stackpointer. The third class consists of one register, the PC (program counter). This register always contains the address of the instruction to be executed next. Of course, the upper eight bits of the PC are also ignored. The fourth class consists of one 16 bit register, the status register, called SR. This register is built up like this: ------------------------------------------------------------- | T | | S | | I0| I1| I2| | | | X | N | Z | V | C | ------------------------------------------------------------- system-byte | user-byte The upper 8 bits are called the system byte. This byte contains information that is important to the system. Normally you can not change this byte if you run an application. Bit 15 is called the trace-bit. If this bit is set, every time after executing an instruction the 68000 will generate an exception (This is called an interrupt on the 6502 and 6809). This is especially useful when debugging programs. Bit 13 is called the supervisor bit. When this bit is set the 68000 is in supervisor mode; when this bit is cleared, however, the 68000 is in user mode. When executing in supervisor mode, the 68000 can execute the so called privileged instructions, which are not available in user mode. For example, it is illegal trying to change the upper 8 bits of the SR when in user mode. Bits 8, 9 and 10 are called the interrupt mask. In total they can contain eight different values ranging from zero to seven. For instance, if bits 8 and 10 are set and bit 9 is cleared, the value of the interrupt mask is 5. This means that only interrupts with a level of 5 and higher are recognized by the 68000 and interrupts with a level lower than 5 are ignored. Interrupts of level 7 can be considered as non maskable interrupts (compare this to the NMI on the 6502 and 6809). The lower 8 bits are called the conditioncode register, CCR (this can be compared to the CC of the 6502 and 6809). The CCR contains 5 bits, which contain useful data. Bit 0 is the carry-flag (C), bit 1 is the overflow-flag (V), bit 2 is the zero-flag (Z), bit 3 is the negative-flag (N). The meanings of these bits are exactly the same as on the 6502 and 6809. Then there is bit 4 which is called the extend-flag (X). It is nearly exactly the same as the carry- flag, but is not affected by every instruction that affects the carry-flag. This feature of the extend-flag is especially useful when using multiple precision arithmetic, e.g. adding 64-bit numbers. Another feature of the 68000 is its ability to access three data formats: byte (8 bits), word (16 bits) and longword (32 bits). You can indicate this with a suffix in the mnemonic field. The suffixes are .b for byte, .w for word and .l for longword. E.g. asr.b d0 , asr.w d0 , asr.l d0. These instructions shift data register d0 one place to the right. I think this is enough new stuff for today. Next time I will explain the addressing modes of the 68000. If you have any comments or questions on this article, please write to the correspondence address and I'll take your notes into account. A good Motorola MC 68000 book is: The Motorola 68000 programming guide, which unfortunately is not available in the stores. Further there are a number of books on the 68000. I would like to mention the book written by Lance Leventhal & Gerry Kane, which I think gives good value for its money. Another good book is Steve Williams' "Programming the 68000". TWO CHESS PROGRAMS COMPARED: XCHESS AND PSION CHESS By Richard Karsmakers and Frank Lemmen Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. We already told you we had plans to review "XChess" in this issue of ST NEWS. Well, we now present to you not only "XChess", but another very nice - if not very much better - chess program called "Psion Chess". In this article, we will try to compare these two programs as objective as possible, after which we will give our opinion about either of the programs. XCHESS When we had a glance at this program at last September's usergathering in Utrecht, the first impression was very good. The advertisments also made the program look very impressive. Recently, a friend of ours sent us his original of "XChess", for us to review (Pharma Data Systems, the company that represents XFun, wasn't interested in our offer to review the program - they never answered our letter - so we had to ask the game from someone else). The second and further impression were obviously not as good as those of that usergathering and the advertisements! The program isn't bad at all, and a nice piece of programming, but a lot of options that we later found in "Psion Chess" turned out to be distinctly missing from "XChess!". The program works on both color-and monochrome monitors and starts up with a nice picture in either mode. After that, the chess board is set up and the player can start to play. A few option of "XChess": Invert Board (so you can look at the board from the other side), Set up, Show Game, Next Move, Print Screen, Game Strategics, Castling (this options allows you to set the value of the king and more. This seems to be the only more or less useful option that seems to be lacking from "Psion Chess") and Time Editing (it is possible to stop the clock, for example, so you can drink a cup of coffee or go to the loo). The distribution network of "XChess" is very largely set-up (as you will see in the upcoming data of the program). "XChess" altogether is a very nice chess program, but only if you haven't seen any other chess programs. Although the PD offering "Krabat" is 'only' 2D, it's almost as good, and Psion's chess version os better. But you will be able to read all about that furtheron... Name: XChess Program by: Bert v/d Liet User Interface by: Wouter Mulckhuyse Graphic Design by: Karin van Bodegraven Price (in Germany): DM 129,- Distributor (Holland): Pharma Data Systems Can also be bough at: XFun, P.O.Box 744, 4116 ZJ, Buren (GL), The Netherlands, Tel. 03447-2362 Distributor (Germany): Computer Technik Kiekbusch GmbH Am Seeufer 11+22, 5412 Ransbach Tel. 02623/1618 Distributor (Switzerl.): HILCU International Badhausstr. 1, CH-3063 Iccigen Tel. 03158-6656 Distributor (Austria): Ueberreuter Media Alserstr. 24, A-1091 Wien Tel. 0222-4815380 Graphics: 6.5 Sound: None Value for money: 6.5 PSION CHESS Psion, together with Richard Lang, definately did a better job than the people at XFun. "Psion Chess" leaves the player with a much better overal impression, and is just a bit better than "XChess". For example, "Psion Chess" offers extended help functions, 2D/3D board options, hints-, take back- and change sides-options and lots more. You can also select one of 50 Master plays to replay, for which you then have options like Help, Start, Automatic, Stop, Forward, Back and Exit. Features include an option to enable/disable resign (to enable or disable to computer from giving up if a seemingly hopeless position has occured), Sound of/onn (I didn't hear any sound at all, but that might have been because I was listening to Jean Michel Jarre's "Magnetic Fields" on CD at the moment) and more. And you can also select to hide or show the move record or hide/move the analysis. You can not only play against a human opponent, but one can also play against the ST, or let two STs play against eachother (that is, with one computer of course). "Psion Chess" is much better, even without nice graphics as front page, etc. The man who sent us his original forgot to mention the price, as well as the addresses from which it can be obtained. If he reads this, we hope he will tell us all this after all. We have already sent his original back. Steven Thorne told me that Psion Chess has been included in their software offerings recently. So if you contact them, you might get to know more. Their telephone number is 020-380103, and their address is Eerste Looiers Dwarsstraat 12, Amsterdam, The Netherlands. SCROLL MESSAGE EDITOR by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. It always is quite a race to finish the promised programs in time for the launch of ST NEWS, but once again it has turned out to be allright. This program was written on Sunday, November 9th, 1986 (the actual rough scrolling routine had been finished by Jos Schilders already about one or two months ago). The program is added on the ST NEWS disk as a .LST file for GfA Basic. It has to be loaded using the MERGE command of GfA Basic. After that, it can be SAVEd to another disk using a normal SAVE (after which it can be LOADed normally). The reason why I made a .LST file of it, was that we had big troubles with disk space on this time's ST NEWS disk (we didn't want to make it double sided, two single sided disks, or maxiformatted). A small user manual is included in the program (in the default scrolling message). This program is not copy-righted, nor are the 'message-files' that can be made of it (these are files that can be MERGEd into your own program and that contain a ready scrolling text - typed in by you. They simply have to be GOSUBed by you, and all is allright). But if you decide to use this procedure in a (commercial) program of your own, I would very much like to see a "thanks to" in it. You can also just give any amount of money on my giro account number 5060326 (t.n.v. Richard Karsmakers, Helmond, The Netherlands) if you like the program! The procedure that the 'message file' option creates, can very easily be adapted to your own needs (it can scroll a different line, for example). It can even be adapted to work on color monitors; if you want to use it in low resolution, for example. you'll simply have to devide all "PRINT AT" and "GET/PUT" parameters by two - the large ones, anyway). Try to run the Scroll Message Editor in medium resolution and count the colours (there are eight!). I could also have used 16 colours, but that would make it all too messy. How many colours can maximally be used at once in medium resolution?.... REVIEW: STRIP POKER, A SIZZLING GAME OF CHANCE by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th, 1986. Recently I went to Amsterdam, to Commedia, in order to fetch some essential nourishment for the computer-freak: New software. Commedia had already sold "Strippoker" from the big usergathering in Utrecht (in September) on, but they weren't able to supply us with the game any sooner. But it turned out that it was quite worth waiting for! The purpose of the game is to play draw poker. Every time you win, you get more money. But when your money runs out, you have to sell a piece of clothing (like your pants or your top) in exchange for $100. Your opponent (female) will have to do the same. The target is to undress your opponent before she can undress you. It sounds simple, but I can assure you: It isn't! I have succeeded in undressing Suzi (that's the most handsome girl, the one to the left), but I haven't quite managed to do so with Melissa, who seems to play much better. I have only seen her undies (which are quite nice, though). Douglas McFarland sure is one hell of an artist! Now, here are some basic rules of draw poker. To write this down, I didn't only make use of the user manual that comes with the game, but also I made use of the December 1984 issue of the popular scientific magazine (in Holland) called "KIJK". 1. There are no jokers or wild cards 2. You can open the betting with any kind of hand 3. The value of the hands (from highest to lowest) are as follows: Royal Flush (A,H,V,B,T from one colour; chance is 1 in 649739) Straight Flush (five consequent cards of one kind; chance is 1 in 72192) 4 of a kind (4 the same cards from different colors, e.g. 4 tens; chance is 1 in 4164) Full House (three equals plus two equals; chance is 1 in 693) Flush (five cards of the same colour; chance is 1 in 508) Straight (five consequent cards; chance is 1 in 254) 3 of a kind (3 the same cards from different colors, e.g. 3 tens; chance is 1 in 46) 2 pair (two times two equals; chance is 1 in 20) 1 pair (two equals; chance is 1 in 1,4) High card I used to know a failsafe way to undress any computerized poker player back on the Commodore 64, but I am afraid I have forgotten how to do that. But I will tell you in an upcoming issue of ST NEWS if I remember it! "Strippoker" is a very nice game, graphically very entertaining, and not very easy to play. That assures you of many hours of enjoyment (or bad moods if you don't succeed in undressing any of the girls). The Atari ST version was made by Todd Kepus and Arthur Walsh. The program is published by Artworx Software Company, Inc., 1844 Penfield Road, Penfield, New York 14526, U.S.A. and can be obtained through Commedia, Eerste Looiers Dwarsstraat 12, in Amsterdam (Holland). It sells there at 99 Dutch guilders. We have heard some good news for Strippoker fanatics: Rushware GmbH is now publishing "Hollywood Poker" for the ST (and Amiga), with digitized girls. Nothing more is known about that one at the moment, but we hope to publish a full review of the program in the next issue of ST NEWS! Undoubtedly, Artworx will also make conversion of their "Strippoker" version 2 and 3. I can vagualy remember one of the names of the two girls in version 2, which was Candy. The girls of "Strippoker II" are much more attractive. And then there's "Strippoker III", for the ladies amongst us. I cannot remember any of the male opponents' names, but I think this might take care that the ST becomes one of the few hobby computers that even women like working (and playing) on! Game rating: Title: Strip Poker Published by: Artworx Authors: Todd Kepus and Arthur Walsh Graphics: 8.5 Playability: 9 Hookability: 8.5 Sound: None Overall rating: 9 Remarks: Although one could say that the girls look a bit too perfect, I hope Artworx will continue! REVIEW: EXTENSOR by Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. Rushware recently supplied us with a version of a program called "Extensor", a real time 3D simulation. Please note: I didn't add "working", since the program tends to crash very often (at least, my version does so). "Extensor" really seems to be an excellent game, that unfortunately only works on monochrome monitors. I had read the user manual, which said that the user was warned that certain versions of TOS were incompatible with the game. I booted up the disk, loaded the program and saw a picture of "Golden Games". Not bad, but also nothing to get stirred up about. But the music was something different: I didn't believe my ears when I heard Commodore 64-like music on our simple music chip! And it turned out to be not the only tune included in the game..... The programmer, Holger Gehrmann, certainly did his best here. It's no wonder, since he used to program things like SOPROL (Sound Programming Language) back on the 64. The music, thus, was a big plus of the game. I even didn't mind it working only on monochrome monitors! The target of the game is really quite simple: You must enclose so-called Videodromes, that build walls behind them. And that's not the worst: You also build a wall yourself behind you! Of course, you are not allowed to crash in such a wall. With one Videodrome to enclose, I got a score from 75. Not bad for a beginner, eh? The game (as I already hinted) has one very big disadvantage: It crashes all the time! I even used my old TOS version (0.13) and tried the game out, but it also seems not to work with that one!? I know it is possible that certain programs do not work perfectly with a certain TOS version, but I think it's really a bit too much if the program turns out not to work properly with TOS in ROM (version 0.19) not RAM-TOS (version 0.13)! Why did Holger write the first game with superb music, but forgot to check it on more STs? It doesn't work with mine, anyway, nor does it work with Frank's ST properly. It's such a shame, because the graphics are not bad at all, and the music is the best I have ever heard on the ST uptil now! But it might be possible that "Extensor" runs perfectly on your system, so you still ought to try it out. If it works well, you have a very nice game added to your software library! For information, please contact one of the following addresses: Golden Games (Publisher) Eckhard & Gehrmann GbR Heinrichstrae 25 3000 Hannover 1 West Germany Tel. 0511/344771 Mikrohndler GmbH (Distributor) Robert-Koch Strae 1 4050 Mnchengladbach 1 West Germany Tel. 02161/60041-43 Rushware Microhandelsgesellschaft mbH An der Gmpgesbrcke 24 4044 Kaarst 2 West Germany Tel. 02101/6004-0 Game Rating: Name: Extensor Design, Animation and Music (!) by: Holger Gehrmann Executive Producer: Dieter Eckhardt Produced by: Dieter Eckhardt and Holger Gehrmann Sound: 9.9 (!) Graphics: 8 Playability: 7.5 (provided it doesn't crash...) During Attractiveness: 7.5 Overall Rating: 8.5 (provided it doesn;t crash...) Remarks: An excellent game with superb music, but unfortunately highly incompatible with our operating systems; I hope it works with yours... DOC31 .t 5DOC32 It K5DOC33 ht '=DOC34 rt 'DOC35 t (DOC36 t +L GEM VDI CALLS PART III by Herman de Vrees Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. COLOR-DEFINITIONS: Those of us, who were rich enough to buy a color-monitor, know that there is no way to set the color-definitions easy. You can set the colors by the 'Control'-accessory, but you can not save your setting. In the next routine, you can define all colors. These colors are made by mixing the three ground-colors 'red', 'green' and 'blue'. Every ground-color has seven different color-densities. The syntax is:  COLORNUMBER = ... RED = 1 .. 7 GREEN = 1 .. 7 BLUE = 1 .. 7 gosub COLORSET 'Colornumber' determines, which color gets defined and is the same as the color in the command 'COLOR', so it can be called by this command. It is possible to define a color-palette and save it as a BASIC- program. You can make the color with the next program. The subroutine is: 62700 COLORSET: 62702 ' -----> RED ; GREEN ; BLUE 62704 ' COLORNUMBER 62706 poke contrl, 14 62708 poke intin, colornumber 62710 poke intin + 2, red * 140 62712 poke intin + 4, green * 140 62714 poke intin + 6, blue * 140 62716 vdisys 62718 return 62720 ' -------------------------------------------------- The program is: 5 ' merge "COLORSET.bas" 6 ' merge "RECTANGLE.bas" 9 ' 10 fullw 2: clearw 2 20 start: 30 for RED = 1 to 7 40 for GREEN = 1 to 7 50 for BLUE = 1 to 7 60 x = x + 1 : if x = 8 then x = 1 70 colornumber = x + 1 80 gosub COLORSET 90 color 1, colornumber, 1 100 xpos1 = 60 : xpos2 = 250 110 ypos1 = -20 + colornumber * 15 120 ypos2 = ypos1 + 13 : gosub rectangle 130 next : next : next 140 out 2, 7 : goto start 150 end  POLYMARKCOLORS: The colors for VDI- and AES-routines can be defined by the command 'COLOR'. The 'polymark'-command is an exception on this rule. This command needs an own routine. You can choose from the defined color-palette by:  MARKCOLOR = .. gosub POLYMARKCOLOR  The subroutine is: 62750 POLYMARKCOLOR: 62752 ' -----> MARKCOLOR 62754 poke contrl, 20 62756 poke intin, markcolor 62758 vdisys 62760 return The program is: 5 ' merge "POLYMARKCOLOR.bas" 6 ' merge "POLYMARK.bas" 9 ' 10 clearw 2: fullw 2 20 for MARKCOLOR = 1 to 15 30 gosub POLYMARKCOLOR 40 xpos = 10 + markcolor * 15 50 ypos = 50 60 gosub POLYMARK 70 next: waiting = inp(2): end  AES-ROUTINES: CALLING OF AN AES-ROUTINE: The AES (Application Environment System) takes care of: - Calling and controlling desk-accessory - Control and management of memory and calculation-time - Producing and calling options in the desk-top-menus - Windows - Mouse-routines - Icons (Diskstations and wastebasket) The AES is a part of the computersystem and is therefore always available. To us, its very large library of routines are the most important part of the AES. We can call the AES-routines on the same way as the VDI-routines. Between BASIC and the AES we need an interface, called 'GEMSYS'. We also need several special addresses: CONTROL Contains the length of the next fields GLOBAL Contains several systemdata GINTIN Input-field for data (co-ordinates of a window)   GINTOUT Output of data (position of the mouse) ADDRIN Pointer on an address (input) ADDROUT Pointer on an address (output)  We have to declare these variables each time we use the AES- routines. We can do this with the next program. 62900 INIT: 62902 aes# = gb 62904 control = peek(aes#) 62906 global = peek(aes# + 4) 62908 gintin = peek(aes# + 8) 62910 gintout = peek(aes# + 12) 62912 addrin = peek(aes# + 16) 62914 addrout = peek(aes# + 20) 62916 return 62918 ' --------------------------------------------------  WINDOWS: Most of the AES-routines are used for building and controlling windows. Some of them are already in ST-BASIC ('OPENW', 'CLOSEW' and 'CLEARW'). Some of the AES-routines are very interesting to use in your programs. These routines are called directly by way of the BASIC-AES-Interface, called 'GEMSYS'. An example of this is the routine to define for yourself the size and the position of the window. The routine needs the next information: coordinates of the left-top-corner, the wanted size and the number of the window. The syntax is: (widthe = width, I could not use WIDTH)  XPOS = ..... : YPOS = ..... WIDTH = ..... : HEIGHT = ..... WINDOWNUMBER = 1 .. 4 gosub SETWIND  The windownumbers are not the same as in ST-BASIC, they have the next values: EDIT 1 LIST 2 OUTPUT 3 COMMAND 4  The routine is: 62000 SETWIND: 62002 ' -----> XPOS ; YPOS ; WIDTHE 62004 ' -----> HEIGHT ; WINDOWNUMBER 62006 poke gintin , windownumber 62008 poke gintin + 2, 5 62010 poke gintin + 4, xpos 62012 poke gintin + 6, ypos 62014 poke gintin + 8, widthe 62016 poke gintin + 10, height 62018 gemsys 105 62020 return 62022 ' -------------------------------------------------- The program is: 5 ' merge "INTIN.bas" 6 ' merge "SETWIND.bas" 9 ' 10 gosub INIT 15 for WINDOWNUMBER = 1 to 4 20 xpos = -50 + 100 * windownumber 30 ypos = 10 + 20 * windownumber 40 widthe = 30 + 50 * windownumber 50 height = 200 60 gosub SETWIND 70 next : end USING THE FULL SCREEN : All output-commands are executed in the output-window. Therefore you can see always the border of the output-window. In many programs it would be nice to make that border invisible. With your Atari almost everything is possible, even this. An easy way to do this, is to define the size of the output-window a little bit greater then the screen with the previous routine. Now the borders of the window are forced from of the screen. The syntax is:  gosub INIT gosub FULLWINDOW  Particularly for a 'hardcopy' of the screen this routine is very useful: no more borders. The subroutine gives you the possibility to define your own settings: no borders or just a fine line as border when you want a frame on your printer. The routine is: 62050 FULLWIND: 62052 ' 62054 poke gintin , 3 :' OUTPUT-window 62056 poke gintin + 2, 5 :' with/ without border 62058 poke gintin + 4, 0 :' 0 : ( -1) ; x1 62060 poke gintin + 6, 1 :' 1 : ( 0) ; y1 62062 poke gintin + 8, 658 :' 658 : ( 660) ; x2 62064 poke gintin + 10,417 :' 417 : ( 419) ; y2 62066 gemsys 105 62068 return 62070 ' -------------------------------------------------- The BASIC-commands 'FULLW, CLEARW, OPENW' give no problems with the full screen, only with 'CLOSEW' it is advisable to put the window back to its original size by the command 'FULLW 2'. At the same time we have to realize that the relation between GEM-coordinates and BASIC-coordinates changes with a full screen. In all previous routines we adjusted all GEM-outputcommands to the BASIC-outputcommands: X-direction 1 pixel and Y-direction 38 pixels. Using the full screen the deviation in the Y-direction is just 19 pixels and the X-coordinates are equal. You have take this in account when you are using these routines with a full screen.  WIPE THE DESK-TOP: After using the previous routine the desktop-line remains. This line is not accessible by normal BASIC-commands. For those of us who wants no desk-top-line on the printer, you have to use the next routine. This routine draws a white rectangle over the desk- top-line by using the VDI-routine 'RECTANGLE'. When you used this routine, you lost the desktop-line. You get it back by 'restart' of the BASIC or by the routine 'TEXTOUTPUT' (described in part I). This routine has access to the full screen, like all GEM-routines. Therefore you can generate your own desktop-line. The routines are: 62080 CLEARDESK: 62082 ' merge "RECTANGLE.bas" 62084 color 1,0,1 : 62086 xpos1 = -1 : xpos2 = 638 : ypos1 = -40 : ypos2 = -20 62088 gosub rectangle: color 1,1,1 62090 return 62092 ' -------------------------------------------------- 64000 RECTANGLE: 64002 ' -----> XPOS1 : YPOS1 : XPOS2 : YPOS2 64004 poke contrl , 11 64006 poke contrl + 2, 2 64008 poke contrl + 6, 0 64010 poke contrl + 10, 1 64012 poke ptsin , XPOS1 + 1 64014 poke ptsin + 2, YPOS1 + 38 64016 poke ptsin + 4, XPOS2 + 1 64018 poke ptsin + 6, YPOS2 + 38 64020 vdisys 64022 return 64024 ' --------------------------------------------------  MOVING BOXES : The AES has routines, which can give you the impression that a rectangle moves from one point to an other or that a rectangle grows from one point to its full size. These routines are used for building windows (for example to show a directory or to show a message). We can use these routines in ST-BASIC to make our programs better. There are three different routines in AES:  - movements of a rectangle that grows (GROW_BOX) - movements of a rectangle that shrinks (SHRINX_BOX) - movements of a rectangle of the same size (MOVE_BOX)  GROWBOX :   This routine shows a rectangle that starts from one point, goes to an other point, growing to its full size. The routine needs as parameters: - left-top-coordinates of the start-rectangle - the growing - the value of the end-rectangle The rectangle starts its movements from the position (XPOS1;YPOS1) with the starting-size (WIDTH1;HEIGHT1) to its destination. There he grows to its end-size (WIDTH2;HEIGHT2). The routine gives only the movement. The arising rectangle has to be drawn by an other routine, like 'RECTANGLE'. The syntax of 'GROWBOX' is: XOLD = .... : YOLD = .... XNEW = .... : YNEW = .... WIDTH1 = .... : HEIGHT1 = .... WIDTH2 = .... : HEIGHT2 = .... gosub GROWBOX  With this routine and the next you can make very beautiful graphic effects, like growing boxes with information or with options. To prevent that the background-information gets lost, you have to use the XOR-option of the routine 'TEXTFORM' (see part I). SHRINXBOX : This routine is the opposite of the GROWBOX-routine. You can use this routine for closing windows or options. If the parameters don't change, the syntax is: gosub SHRINXBOX  Otherwise you have to define the eight parameters again (see GROWBOX). The routines for 'GROWBOX' and 'SHRINXBOX' are: 62100 SHRINXBOX: 62102 ' -----> XOLD ; YOLD ; WIDTH1 ; HEIGHT1 62104 ' -----> XNEW ; YNEW ; WIDTH2 ; HEIGHT2 62106 shrinx% = 1 62108 ' 62110 GROWBOX: 62112 ' -----> SEE SHRINXBOX 62114 ' 62116 poke contrl + 2, 8 62118 poke contrl + 4, 1 62120 poke gintin , xold 62122 poke gintin + 2 , yold 62124 poke gintin + 4 , width1 62126 poke gintin + 6 , height1 62128 poke gintin + 8 , xnew + 1 62130 poke gintin + 10, ynew + 38 62132 poke gintin + 12, width2 62134 poke gintin + 14, height2 62136 gemsys 73 + shrinx% 62138 shrinx% = 0 62140 return 62142 ' -------------------------------------------------- An example is: 5 ' merge "INIT.bas" 6 ' merge "GROWBOX.bas" 7 ' merge "RECTANGLE.bas" 9 ' 10 gosub INIT 20 fullw 2 : clearw 2 30 xold = 0 : yold = 300 : width1 = 40 : height1 = 40 40 xnew = 400 : ynew = 100 : width2 = 100 : height2 = 200 50 start: 60 xpos1 = xnew: ypos1 = ynew : xpos2 = xnew + width2 70 ypos2 = ynew + height2 80 color 1,1,0,0,0 90 gosub GROWBOX : gosub RECTANGLE 100 for a = 0 to 1000 : next 110 color 1,0 120 gosub RECTANGLE : gosub SHRINXBOX 130 for a = 0 to 1000 : next 140 goto start MOVEBOX : The last routine of this group is 'MOVEBOX'. It moves a rectangle from one point to another. The box keeps the same size. As in the previous routines the routine only takes care of the movement. The rectangle has to be drawn by another routine. The syntax is:  XOLD = .... : YOLD = .... XNEW = .... : YNEW = .... WIDTHE = .... : HEIGHT = .... gosub MOVEBOX  The routine is: 62150 MOVEBOX: 62152 ' -----> WIDTHE ; HEIGHT ; XOLD ; YOLD 62154 ' -----> XNEW ; YNEW 62156 poke contrl + 2, 6 62158 poke contrl + 4, 1 62160 poke gintin , widthe 62162 poke gintin + 2, height 62164 poke gintin + 4, xold + 1 62166 poke gintin + 6, yold + 38 62168 poke gintin + 8, xnew + 1 62170 poke gintin + 10,ynew + 38 62172 gemsys 72 62174 return 62176 ' -------------------------------------------------- An example is: 5 ' merge "INIT.bas" 6 ' merge "MOVEBOX.bas" 7 ' merge "RECTANGLE.bas" 9 ' 10 gosub INIT 20 fullw 2 : clearw 2 30 xold = 50 : yold = 50 : width = 50 : height = 100 40 xnew = 500 : ynew = 100 50 start : 60 gosub MOVEBOX 70 color 1,1,1,0,0 80 xpos1 = xnew : ypos1 = ynew : xpos2 = xnew + width 90 ypos2 = ynew + height : gosub RECTANGLE 100 swap xold , xnew : swap yold , ynew 110 for a = 0 to 1000 : next 120 color 1,0,0 : gosub RECTANGLE 130 goto start 140 end new 110fora=0to1000:next 120color1,0,0:gosubRECTANGLE 130gotostart 140end MICHTRON SOFTWARE - OLD BUT GOOD!  by Frank Lemmen and Richard Karsmakers Originally published in ST NEWS Volume 1 Issue 6, launched on November 15th 1986. Michtron software has been supporting the Atari ST series right from the very beginning, and we feel nobody has given their programs a good review yet. Although it is not our purpose to do so, we hereby hope to bring you into the world of Michtron & Microdeal software, by letting you know something about their large scala of software offerings. TIME BANDIT We start right away with the very best arcade game they have published on the ST until now: Time Bandit. It is a shoot-em-up game with several adventure-like elements. But most people don't arrive at these adventure-like elements, since they mainly come once you're advancing terribly in a certain level (or timegate, as the authors prefer to call it). There's quite a nice story attached to Time Bandit: Since we wanted to offer our readers the best there is, we wanted to finish the game, thus being able to publish the solution. But since it is an arcade game, in which the rating depends on the player's skill, we later realized this was impossible. But after an evening of 'hacking' we have succeeded in de-protecting the program, so we could make a so-called trainer version. In this version, it had to be possible to walk against an 'evil object' without losing a life. We succeeded after having done some more hours of examining, and we started to play this trainer version on Friday, October 24th at 18.45 hours. When we stopped (that was on 23.15 hours, that same evening), we had gained some quite useful tips for our readers (and some busted trigger-fingers, too). This is how we achieved to get our highscore of 583480 points. Our real hiscore had been somewhere around 80000 points. We succeeded in completing the following levels: Shadowland (our trainer didn't allow us to catch any shadows, though), Gridville, The Guardian (very annoying level in which you have to walk very much at the end), Castle Greymoon (with quite a nice story with it), Arena, Bomb Factory and Omega Complex. The next day, we finished Ghost Town, in which you have to bury corpses and avoid dead gosts of outlaws. So all this nonsence about walking over your own grave (in the grave yard of Ghost Town) should be forgotten. The dead outlaws give you a nine-character code, that you have to use to get over the quicksand in level 4D. In Castle Greymoon, you (the innocent player) get involved in a complete Dallas-and-Dynasty-like intrigue: The country was ruled ina right way by King Quark of Greymoon and Kelveshaan. But the Evil Sorceress betrayed them and locked up poor Kelveshaan. Later on, this Evil woman pinches one of the keys you need to finish a level, that you'll have to get in the Fourth Tower, for which you'll have to defy the Magic Labyrinth. Once you've gone though that (oh, it's so nasty!), you find the key and....a treasure chest. In that chest you find four decaying items, of which you'll have to pick one. But which one? You have to get the key 4 times (from level 4A to 4D) there, so you have time enough to find out - if you make it those other times. But we wouldn't be the ACC if we hadn't written down some of our experiences there, for you to read. Well, these four items are: Black Ashes, Blue Crystals, Green Paper and Iron Pellets. When you fetch them, you'll get the following remarks respectively: "Poison!" (you loose 7 lives), "You get a small diamond in your hand", "The note unfolds to a paper worth 2500 Cubits!" and "You feel strong - almost invulnerable!". See you'll have to decide for yourself which you get. If you get there. And don't take the ashes! Another hazardous thing that happened took place when we were conquering the level called Arena. You have to enter into the Lair of the Mighty Marg Worm. Once you've vanquished that monster, you will be able to leave the Lair. Not any sooner. And the lair has a very nice surprise (in which you can get many points, but in which you will undoubtedly loose many lives if you don't make a trainer version). Time Bandit is sold at a retail price of 29.95 in England. MAJOR MOTION The second-best game from this company is Major Motion, that's for sure. In this game, the objective is to get as far as possible onward the ever becoming more dangerous road. While you're doing that, you must launch missiles in order to destroy helicopters, you must annihilate cars by bumping them off the road and you must avoid oil stains and bomb holes in the road. While you're doing this, you'll have to fight powerful racing-cars (which come with two-at-a-time further on in the game), you must dodge the gunfire from the Mafia vehicle (as it is commonly called in the society of Major Motion addicts) and you must avoid hitting too many 'good' cars. If you destroy these (the ones that usually don't try to push YOU from the road), you get a missile after you that's indodgable (to say it in uncorrect English). In the course of the game, you racing car even turns into a speedboat, and then you'll have to be very careful for concrete blocks in the water, mines and loony captains on your way! The game is supported by nice musics, that vary all through the game. Especially the water-level music sounds very nice. But don't do anything you do in this game when you're taking driver's lessons (or when you're on the road at any time and when there are other people within 10 miles of you)! Not as good as Time Bandit, but altogether very entertaining. And we haven't met anyone who has been able to play it all the way! It is a shame that it only works with the mouse. The retail price in England is 39.95. MUDPIES One of the very oldest games on the ST (together with Brataccas) is definately this game called Mudpies. The object of the game is to throw Pies of Mud to clowns, that also throw these at you. Every time you hit one, you get points. At first, the game has to be gotten used to, since even the joystick movements are quite difficult to handle. But once, you're used to it, it is a very nice game to play. The musical pieces are very nice to hear at the background, and they vary when you're playing. Mudpies isn't one of these games that you play, and play, and play, but it can be enjoyable to play it for a while. The price is according to the hookability: It is sold at a retail price of 19.95 in England. It can works with mouse, joystick or keys. LANDS OF HAVOC This must be the worst game ever to have been launched by these people. It actually is a quite lousy 8-bit conversion, that uses perhaps 4 or 5 colours at one time on the screen, and that is very dull to play. The plot might be somewhat thrilling, but the packaging of that plot is extremely lousy. Definately not worth buying! It's one of those games (like Super Huey, of which we published a review in the previous issue of ST NEWS) that hackers and crackers won't bother to touch. Even at a retail price of 19.95 in England, this really is a bad bargain. Don't buy it! ANIMATOR Now, we get to one of the non-entertaining programs of this company. Not directly entertaining, anyway. Animator is a program that makes it possible to create animation over a Degas or Neochrome background. You simply draw that background (or you use an empty background, which can also be done) and after that you'll draw e.g. a walking man in every position on another picture. You just have to take care that the program 'knows' which parts are these frames. It is even possible to include several 32K pictures with frames. After having defined an animation file, it is possible to turn these frames on and off on varioyus position in various orders, thus simulating animation. It looks very much like "Film Director" (which was to be seen at the Dutch Efficiency Beurs in Amsterdam, read more about that elsewhere in this issue of ST NEWS). The program is a bit difficult to use, but the results can be impressive. One warning: Read the user manual before you do anything, and DON'T UNPROTECT THE DISK before you've made a backup! It is very possible that you loose the "WALKING.AN" file in the process, and that's very important to learn from! For more information about The Animator, contact Commedia (Eerste Looiers Dwarsstraat 12, Amsterdam, Holland, Telphone 020-380103). They also sell it. It is definately worth buying for people that either like animation ar that want to use their ST for advertisement pursposes. DISK UTILITIES Michtron offers one of the very best disk utility programs in their software offerings: Michtron Disk Utilities. We've had a look at version 1.0, which is sold at a retail price of 39.95 in England. The program offers advanced file-and disk options, as well as attribute-handling, date-and time manipulating and more. We will publish an article on diskmonitors in an upcoming issue of ST NEWS, so we won't get into this any deeper. But if you were already thinking of buying it: Please do! You won't regret it! M-DISK What's there to say about yet another RAM-disk? It isn't removable, it offers less space for RAM-disk usage with the same memory capacity as that Kuma's K-RAM does, and it isn't resident. This is definately one of the most stupendous programs these people ever launched. Nowadays, people have the Public Domain Intersect RAM-Disk V3.0 (to be ordered through our PD service), which is removable, and people can also buy G-RAMDISK of G-DATA software, which isn't only removable but also resident. And that one includes an integrated spooler as well! Even at a retail price of 12.95, M-DISK is a miss! In the field of utilities it is as useless as Lands of Havoc is lousy in the field of games. PINBALL FACTORY But let's talk about a really nice product of this company once again: Pinball Factory. This is one of the more recent launches made, and I must say it's a very good concept, very well worked out and very user-friendly. As you might already have noticed, it's a pinball machine plus pinball game designer. So you cannot only play on a pinball machine, but you can also design your own! Once the pinball game machines are designed, the layout can be SAVEd to disk. Later on, they can of course be LOADed back into the computer. The main screen offers several options at the starting of the program (or is it a game?): Edit game, play game, erase file, load game, save game and catalog (this can display the directory of either drive A,B or C - harddisk ?!). The first thing most people do is choose the Play option (a sample game - designed by the designer of Time Bandit, Hary Lafnear - is built in from the beginning). After that, they can play using the arrow down key to pull back the ball, space to release it and the left and right mouse buttons to hit the ball. F10 quits and moving the mouse causes the pinball machine to Tilt! But the Edit Game option is much more interesting - here you are able to design your own boards using your own creativity and imagination. This option lets you enter into a submenu, which has as sub-options: Edit board, alter rules, edit logo and test game. The Alter Rules option lets you change the scores made by individual attributes, as well as the power with which balls are kicked back once they hit them. Further on, you can determine the number of balls each player gets (it's a game for 1-4 players) and the speed with which the balls move. You can also change the gravity, elasticity and you can turn dampers on/off. The Edit Board option looks a bit like a regular drawing program, but it lets you place predefined objects - the pinball machine attributes. Options in this sub-option are: Line, Frame, Circle, Disk, Ray, Box, Detail (zoom) and Fill. The Fill option lets you use 23 predefined fille patterns. And you can change all the colors that you use using the well known RGB setup. The Edit Logo option lets you change the little picture at the right hand side of the screen; the pinball machine logo. This is a complete drawing program, with as options: Line, Ray, Frame, Rnd. Frame, Box, Rnd. Box, Circle, Disk, Detail, Fill, Bigtype, Smalltype, Airbrush and Shadow. Of course, both Airbrush and Shadow can be set and changed. The airbrush, by the way, is of the same type as the one found in "Degas" - so very good. Here, you can also use the 23 predefined fill-options. The Test Game option doesn't need explanation, I suppose. Michtron's Pinball Factory is a very good product indeed and, together with Time Bandit and - but a bit less - Major Motion, one of the best releases of this company. I definately hope that they will continue making these excellent programs on the ST! pany.Idefinatelyhopethatthey willcontinuemakingtheseexcellentprogramsontheST! WRITING YOUR OWN ADVENTURES by Stefan Posthuma The adventure is one of the most addictive forms of computergames. Every computer owner must have heard of them sometimes. Which ST-owner doesn't know 'The Pawn'? Adventures are so attractive because they are a test of the players' skill and creativity. The only thing that limits the capability of an adventure is the imagination of the author. Of course it is great fun to write your own adventure, because you really can let go your imagination and create some juicy location-descriptions and some tricky puzzles. If you might think it's terribly difficult to write an adventure, you're wrong. Everybody with a decent knowledge of BASIC can do the job. An highly-structured programming language is preferable to write adventures, and there is a BASIC for the ST that is really great: GfA-BASIC, so all examples in this article have been written in it. If you want to write an adventure, the first thing you have to do is to think of a 'script'. What is the final goal, and in what can the player achieve this goal? Dream up puzzles and exotic locations; let your imagination free! The second step is the creation of a map with all the locations and the way they are connected. You can do this by taking a piece of graph-paper and draw the locations as squares, connected with lines. In this case you can use six directions, north, south, west, east, up and down. (if you want to make things more complex, you can also use directions like north-west, south-east etc.) Number each location and give it a short description like 'small room' or 'cave'. Then make a table of all the objects used, and in which locations they are found. If there is a puzzle in a certain location, state it clearly in a list of puzzles. After this essential part, you can start the actual programming. The best way to do this is to write a very structured program, with a routine for everything, like a routine for location- desriptions, one for command-recognition (the parser), and one for each verb you use. The basic structure for an adventure is this: GOSUB INIT Q=0;quit flag WHILE Q=0 MOVE=0 GOSUB LOCATIONS WHILE MOVE=0 GOSUB COMMAND GOSUB ACTION WEND WEND In the routine INIT, you define all variables and objects used throughout the program. There is one variable that is very important: the location-number. We'll call that one 'L'. So if the story starts in location number one, make L one in this routine. Also, you have to define all objects. The best way to do this is, is to store them in an array. Let's say you have three objects in your adventure, a hammer, a pair of scissors and a golden key. At the start of the story, the hammer is in location 1, the scissors are in location 4 and you carry the key. In this case you'll get something like this: DATA "",HAMMER,1,PAIR OF,SCISSORS,4,GOLDEN,KEY,0 O=3 :number of objects DIM O$(O,1),O(O) FOR T=1 TO O READ O$(T,0),O$(T,1),O(T) NEXT T Maybe you noticed already, the number belonging to the object is the location in which it can be found, and if the number is zero, the player carries it. I divided the object names in two, so you can refer to the golden key, just by using the word 'KEY' The next routine, LOCATIONS simply prints the description of the location and the objects that can be found in it. The first thing you have to do is to see if it is not 'too dark to see'. So if locations 10 to 20 are set underground and you need a lamp to be able to see anything, you'll get this: PROCEDURE LOCATIONS DARK=0 No=0 ;no movement possible in any direction (I used 'No' because 'N' is used somewhere else) S=0 W=0 E=0 U=0 D=0 DR=0 ;no door too IF L>=10 AND L<=20 AND LAMP=0 PRINT "It's too dark, You can't see a thing!" DARK=1 ENDIF ON L GOSUB L1,L2,L3,L4,L5 ect.... IF DARK=0 PRINT GOSUB OBJECTS ENDIF RETURN The variable 'LAMP' is a flag which is set to one if you have a lit lamp, else it is set to zero. The variable DARK is for future use to see if it is dark. (In which case you can do nothing but move to another location.) The routines L1, L2, L3 ect. contain the location descriptions and the movement-variables. For example if location 1 is a room, to the north lies location 5 and to the west location 3: PROCEDURE L1 PRINT "You are in a dimly lit room. Everything is covered in a thick layer of dust. A fat brown rat scurries away at the sound of your footsteps and a shutter schrieks in the wind..... There is a door to the north and a dark, uninviting corridor to the west." N=5 ;north lies location 5 W=3 ;and west location 3 RETURN The variables N,S,W,E,U and D indicate the possible exits to various locations, if a variable is zero, no exit in that direction. Remember, if a location is dark, first check if you can see anything (DARK=1) The routine 'OBJECTS' prints a list of all objects present. It could go like this: PROCEDURE OBJECTS FOR T=1 TO O IF O(T)=L PRINT "There is a ";O$(T,0);" ";O$(T,1);" here." ENDIF NEXT T RETURN The next routine, the one that asks for a command and evaluates it, can be quite complex and is called a parser. If you have ever played 'the pawn' or and Infocom adventure you will know that these parsers accept commands like 'Open the brown bag then take the bottle from the bag. Open the bottle and drink the water.' In our adventure, we'll stick to the basic form, a verb-noun parser. Here you can enter commands like 'GO NORTH' or 'TAKE KEY'. Here is the example: PROCEDURE COMMAND REPEAT LINE INPUT C$ PRINT IF C$="" PRINT "HUH?" PRINT ENDIF UNTIL C$<>"" C$=UPPER$(C$) Sp=INSTR(C$," ") ;find a space between verb and noun. IF Sp=0 GOSUB SINGLE ;you entered a single command ELSE V$=LEFT$(C$,Sp-1) ;store the verb in V$ N$=RIGHT$(C$,LEN(C$)-Sp) ;store the noun in N$ GOSUB INTERPRET ENDIF RETURN The procedure 'SINGLE' is just a long list of IF....ENDIF statements e.g.: PROCEDURE SINGLE FLAG=0 IF C$="QUIT" OR C$="STOP" OR C$="END" GOSUB QUIT FLAG=1 ENDIF IF C$="INVENTORY" OR C$="INV" OR C$="I" GOSUB INV FLAG=1 ENDIF IF C$="LOOK" OR C$="L" GOSUB LOCATIONS FLAG=1 ENDIF and so on..... IF FLAG=0 PRINT "I'm not sure I can follow you.." ENDIF RETURN I'll also give you the procedure INV. This routine prints a list of all ojects you carry. PROCEDURE INV PRINT "You are carrying:" FLAG=0 FOR T=1 TO O IF O(T)=0 PRINT "A ";O$(T,0);" ";O$(T,1) FLAG=1 ENDIF NEXT T IF FLAG=0 PRINT "Absolutely nothing!" ENDIF RETURN The procedure 'INTERPRET' is a little more complex. First, you have to check if the noun exists and if it is present if it is an object. After that, you have to check the verb, and handle accordingly. Just like you made a list of objects, you also have to make a list of verbs and recognised words. (In DATA- statements; label them clearly) PROCEDURE INTERPRET RESTORE WORDS ;I used the label 'WORDS' FLAG=0 X=0 ;counter N=0 ;noun number O1=0 ;object chosen flag DO READ W$ INC X EXIT IF W$="endwords" ;use 'endwords' as last word in the list IF N$=W$ FLAG=1 ;word recognised N=X ;noun number ENDIF LOOP IF FLAG=0 ;not a word FOR T=1 TO O IF N$=O$(T,1) OR N$=O$(T,0)+" "+O$(T,1) FLAG=1 O1=1 ;object chosen N=T ;object number ENDIF NEXT T ENDIF IF FLAG=0 ;unknown word PRINT "I'm sorry, but the word ";N$;" is not in my vocabulary" ELSE IF O1=1 ;check if the object is present IF O(N)<>0 AND O(N)<>L PRINT "I can't see any ";N$ N=0 ENDIF ENDIF ENDIF RESTORE VERBS ;I used the label 'VERBS' FLAG=0 X=0 DO READ W$ INC X EXIT IF W$="endverbs" ;use 'endverbs' as last verb IF W$=V$ FLAG=1 ;verb recognised V=X ;verbnumber ENDIF LOOP IF FLAG=0 PRINT "I don't know how to ";V$ ELSE IF N<>0 ;verb and noun recognised IF V<>6 AND V<>7 AND DARK=1 ;is it dark and you do not move? PRINT "It is really hard to ";V$;" something in the dark." ELSE ON V GOSUB GET,GET,DROP,EXAM,EXAM,GO,GO,EAT ENDIF ENDIF ENDIF RETURN In this case, your verb list would be this: VERBS: DATA GET,TAKE,DROP,EXAMINE,STUDY,GO,WALK,EAT DATA endwords The verbs 'GET and TAKE', 'EXAMINE and STUDY', 'GO and WALK' refer to the same procedure because they are synonyms. Handling verbs: PROCEDURE GET ;'N' is holds object number chosen. IF O1=0 ;Is it an object? PRINT "You can't take that!" ELSE IF O(N)=0 PRINT "You already have it!" ELSE IF I=5 ;'I' counts the number of object you have PRINT "You are carrying too much!" ELSE PRINT "OK!" O(N)=0 ;You now carry the object INC I ENDIF ENDIF ENDIF RETURN PROCEDURE DROP IF O1=0 ;is it an object? PRINT "You're talking complete nonsense here." ELSE IF O(N)<>0 PRINT "You don't have it!" ELSE PRINT "Dropped." O(N)=L ;put in location number 'L' (The current location) DEC I ;you carry one object less. ENDIF ENDIF RETURN The procedure 'EXAM' can be very large, since the player must be able to examine a lot of things. The best way to do it is like this: first, check in N$ is an object. (O1 contains 1). If it's not, jump to a different subroutine for every location. In these subroutines, check N$ for things you can examine and print the description. (A long IF.....ENDIF list.) Check the sample program if you don't understand this. The procedure 'GO' is quite simple. For example, if the player wants to GO NORTH, check if N equals zero. In that case, no movement north is possible. In the other case, make 'L' the same as 'N' and the player has moved to a new location. The sample contains only movement NORTH and UP, but the procedure is the same for the other directions. PROCEDURE GO N$=LEFT$(N$,1) IF N$="N" IF N=0 PRINT "You can't go that way!" ELSE L=N MOVE=1 ;flag for main loop. ENDIF ENDIF IF N$="U" IF U=0 PRINT "You can't fly!" ELSE L=U MOVE=1 ENDIF ENDIF ect... IF N$<>"N" AND N$<>"S" AND N$<>"W" AND N$<>"E" AND N$<>"U" AND N$<>"D" PRINT "You can't go there!" ENDIF RETURN Be sure to add the words 'NORTH', 'SOUTH', 'WEST' ect. to your wordlist. The movement commands are used a lot, and it would be handy if the player could input 'N' instead of 'GO NORTH'. To do this, add this to the 'SINGLE' routine: IF C$="N" OR C$="S" OR C$="W" OR C$="E" OR C$="U" OR C$="D" N$=C$ GOSUB GO ENDIF The procedure 'EAT' is one of the many. If you want to write a good adventure, inlcude a lot of verbs, and make a large vocabulary. The following procedure is merely an example, and can be totally different in your adventure. PROCEDURE EAT IF O1=0 OR N<>3 ;object numer 3 is a bread or something like that. PRINT "You have to be out of your mind!" ELSE PRINT "It tasted really good until you almost broke your teeth on a file that was in it." O(4)=L ;object number four is the file O(3)=-1 ;the bread 'disappears' ENDIF RETURN Handling doors: Almost every adventure has at least one door. Doors are difficult things in an adventure program. You have to be able to open, close, lock, unlock, and examine them. Doors often form puzzles, because you need a certain key to open them or you have to break them, or simply knock on them. I handle doors like this: I store all information about them in an array; D. Initialise and fill this array in the procedure INIT. A door can have 3 modes: 0 : open 1 : closed 2 : closed & locked Let's say there is a door to the north, and if you go through the door, you enter lokation number 6. Instead of making N 6, make it -6. Then define another variable, called 'DR'. This one contains the number of the door present. In the procedure GO, check if a direction is negative, if it is, check if the door is open. I think it will become clear if you study the example program. The procedure ACTION, is a procedure in which you count the number of moves made, check if the player is still healthy, check if the oil supply of the lamp isn't running out, check if that fire-breathing dragon didn't wake up to tear you to shreds, and lots more. It all depends on your story. Advanced parsers  I am writing an adventure too, and I am trying to develop a good parser. This means that it has to recognise multiple commands in one line, and things like this: TAKE ALL BUT THE LAMP AND THE SWORD FROM THE LARGE BOX THEN KILL THE DWARF WITH THE KNIFE. First, split up the multiple commands. They are separated by THEN or by full stops. Put them in an array and handle them one by one. Of course, eliminate all 'THE's because you don't need them. So reduce 'TAKE THE LAMP' to 'TAKE LAMP'. But there is more, things like 'TAKE ALL BUT... are very difficult, but somehow I managed to do it. Maybe if I feel like it, I'll write an article about it some time. On the disk you will find a very small adventure game that brings all examples into practice. Of course this is not a full-grown adventure, I kept it very basic and simple, but it is just meant for you to figure out how an adventure program works. The object of the game: escape from the House! Well, that concludes this article. I hope you are inspired enough to start writing. Of course, think carefully about it, and put it all on paper before you start programming. Also document your program properly; it's hard to read a very long program without any leads, even if it's your own. If you have a problem, contact me through the correspondence address of ST NEWS. Don't forget to enclose two stamps: One for the editor to send it through to me and one for me so I can respond to your letter! About the author: Stefan Posthuma started programming computers back on the VIC 20 from Commodore, later on the Commodore 64. On the latter machine, he competed in the Micro Masters Holland competition with a game called "Hades". Later, he programmed "Scuttle" (with the music from Jean Michel Jarre) that was marketed by Aackosoft. He won the Micro Masters Holland and won a Philips YES PC. He felt he didn't have enough software, so he swapped the machine against a 260 ST. Now, he is proud to be in the ever increasing ST legions. pedthemachineagainsta260ST. Now,heisproudtobeintheeverincreasingSTlegions. OUR CORRESPONDENCE ADDRESS by Richard Karsmakers In the new year we have changed our correspondence address, as you may know already if you have our new ST NEWS Volume 2 Issue 1 in you possession already. The address is: ST NEWS Kievitstraat 50 5702 LE Helmond The Netherlands We can be contacted at this address, but please do not forget to enclose enough return postage (or International Reply Coupons) if you want us to answer or send something back to you! ge(orInternationalReplyCoupons)if youwantustoanswerorsendsomethingbacktoyou! EDITORIAL On Friday, Januari 16th I had a phonecall with the people of Commedia (remember? They are one of the shops in Holland that offer the newest software around!), when they suggested making a seperate version of ST NEWS that would contain the best articles that had appeared in Volume 1 of ST NEWS (that were 6 issues, with a total of 374 pages). That evening, I starting working on the concept immediately and I also thought about a name. After a while of thinking, I came to "The ST NEWS Volume 1 Compendium". Basically, making this Compendium took no longer than one day, but I struck some difficulties with the program, that I was still actually adapting for ST NEWS Volume 1 Issue 2, that should be ready no sooner than the end of Februari! Many routines had not yet been tested thoroughly and it therefore still may be that errors or bugs are hidden somewhere deep in the program. Many of the previous bugs are disposed of, however, but we still had to use maxi-format! If you want to copy this Compendium, you should use the built-in copy option or another program that can copy protected disks (80 tracks of 10 sectors). Some of the articles needed updating, sensoring (especially those taken from the first two issues!) and correcting (I did discover some crazy grammatical English errors!). All programs were re- tested and SAVEd in the new version of GfA Basic (version 2.0) as far as they had been written in V1.0 of this Basic version. The 'picture' option could this time not be included, as there was not enough room on this disk (not even when maxi-formatted). I hope to please everyone who thought ST NEWS was a bit clumsy during the Volume 1 Issues, by launching this Compendium version. Although I have taken much care to adapt the articles so that they don't 'branch' to other, not included, articles, it might still occur. I'm sorry for that! Sincerely, Richard Karsmakers (Editor of ST NEWS) RichardKarsmakers (EditorofSTNEWS) ST NEWS COLOFON ST NEWS is a disk-based magazine written for and written by ST users, which is published at irregular intervals by the ACC. Subscribing: ST NEWS is published at irregular intervals. Read how you can order back-issues in the article about our Reader's Service. Official ST NEWS distributors: ST NEWS Fuutstraat 2 5702 LN HELMOND The Netherlands ST NEWS Gerardo Greco Via Roma 75 I-80055 PORTICI-NA Italy  ST NEWS Ewe Hkansson Pilspetsv. 4 S-291 65 KRISTIANSTAD Sweden ST NEWS Stefan Colombier Marienburgstr. 17 D-5300 BONN 1 West Germany Editorial: Frank Lemmen (correspondent); Special subjects: MIDI and Music Richard Karsmakers (editor); Special subjects: GfA & Software Jos Schilders (correspondent); Special subject: Hardware Editorial-and Correspondence address: ST NEWS Fuutstraat 2 5702 LN HELMOND The Netherlands The following people helped with the establishment of this issue of ST NEWS: Frank Lemmen Richard Karsmakers Jos Schilders Math Claessens Stephen Thorne (Commedia) Paul Kolenbrander Rufus Camphausen Robert van Cruchten Hubert van Mil (ST Club Eindhoven) Engel Geukens (CCV) Hans de Lange Mark van de Boer Hans van der Linden Wilfred Kilwinger (Atari Ben.) Toon Hermsen Gerardo Greco (Italy) Tom den Duijf (Stichting ST) Marko Software Thomas Maier (Tommy Software) Holger Gehrmann (Golden Games) Jrgen Goeldner (Rushware) Stefan Posthuma Theo van Beeck Eerk Hofmeester Hans Nijsen (Tango Studio's) Herman de Vrees Steve van der Horst Klaus Schulheis (Heim Verlag) Lon Obers Adrie van der Weijden Pim Coenradie Markus Herfort Rhotron GmbH Gerard Faber Ewe Hkansson (Sweden) Stefan Colombier (W.-Germany) Amanda Reid-Young (Fairlight) Jean Miles Volker Ritzhaupt (Appl. Systems) Richard van Helden Anthony Rush Compute! A. van der Veen (Compra) Michael Osinski (Alphatronic) Ruud van de Kruisweg Robert Heessels Arjan Pot (ST Club Eindhoven) Gerald Hulshorst Luuk van Beijnen Leon Elins Jos Velleman Michael Bernards A fully documented source listing of this ST NEWS program (written in GfA Basic) can be ordered by paying 75 Dutch guilders to giro account number 5060326, t.n.v. Richard Karsmakers, Helmond, The Netherlands. You will then receice a printed-out source listing delivered to your home. People who live outside the European Economic Community should add 5 extra guilders for extra post costs. tside the European Economic Community should add 5 extra guilders for extra post costs. GfABASIC<@@@FFFFx j v v v ASMIXYX1KJH1H2P1O2P2QZCKPEEKDPEEKSYSTABBLSWSNGMAINMOUSONLAADWEGCONVERTLABEL1LABEL2BEGINLAADCONVERTWEGSCREENCHECKRES6The Amazing Cracking Conspiracy Proudly Presents: uDLow to High Converter v2.2, released on Sunday, August 17th, 1986  *Rewritten for ST NEWS Volume 1, Issue 4  F6Original Concept by Sven Krppel, 1986 by Level 16 >GfA Basic version 1986 by The Amazing Cracking Conspiracy  Main program s a|FB,F JF-F F*  FL)@!,Please insert|Source Disk|and select|Picture!!OK!Ff\*.*!!F pJFF-F F8)@!Please enter|Target name!!OK!Fef\*.PI3!!Fn,Fv,Fv,FvE!`FEa F a JF-Fa FE-F aEnd of Main program  nLoading the picture  o+FEppF!FnEGF!F VF.F oSaving the picture  a+FRFh EGFpQF#  !F  F,!!zDFp.F a The actual Conversion routine  h+F*E GxxH FrxEGF E3 F n$ JF E FF F $FEF"EGHFEFEF|FEF EF EF EF|F 0 JF E F E F FEF  JF E F" E F FEF  JF E  F" E F F E F 8@ JF E  F"@ E@ F F E FEF JF! F ! FEFEF-F FEF JF-F F F  F.F hEnd routine  n|FYFl@!FqF! n@Data for first 34 bytes of monochrome inverted DEGAS picture 1 a$0,2,0,0,7,&h77,0,&h70,0,0,7,&h77 P*7,0,0,&h70,7,&h70,0,7,7,7,0,&h77,5,&h55 0,&h33,7,&h33,3,&h73,7,&h73  a(Screen initialization & Text printing  c+FYFl@!F(!!z!@FA>' !G!(THE AMAZING CRACKING CONSPIRACY PRESENTSF(!!!PFG4'H!P!LOW-HIGH CONVERTER VERSION 2.2F(!!!@FrZ'H!B!CThis program converts a neo-format picture to High Res Degas formatF.F x`Y(T ` Efv*oM\ m HPHUBg?<JNA(m)m -:gS)@ -OK1C#hNHx?<HNA@)@l/?<HNA)@h&@)@X)@\Ьl)@d)@`ANCpr Ѝ"QHNPALNHz.?< NA\pdAxr0XQNNV JrBjCAp$L Qp NTBlJpNNTpMNT9@pdAr 0Q0tr N9lN NupeaZp` aNTBgNAXC2A@p222NrҌ0<NB0,rNurA9Ar`v C9Cr`rt9@9A9BNlrҌpsNB0,Nu9@NlrDҌpsNBNuC2 @ e @}bA@p222Nr,Ҍ0<NBNu Hn 2$4BBNuAd R62000 SETWIND: 62002 ' -----> XPOS ; YPOS ; WIDTH 62004 ' -----> HEIGHT ; WINDOWNUMBER 62006 poke gintin , windownumber 62008 poke gintin + 2, 5 62010 poke gintin + 4, xpos 62012 poke gintin + 6, ypos 62014 poke gintin + 8, widthe 62016 poke gintin + 10, height 62018 gemsys 105 62020 return 62022 ' -------------------------------------------------- 62050 FULLWIND: 62052 ' 62054 poke gintin , 3 :' OUTPUT-window 62056 poke gintin + 2, 5 :' with/ without edge 62058 poke gintin + 4, 0 :' 0 : ( -1) ; x1 62060 poke gintin + 6, 1 :' 1 : ( 0) ; y1 62062 poke gintin + 8, 658 :' 658 : ( 660) ; x2 62064 poke gintin + 10,417 :' 417 : ( 419) ; y2 62066 gemsys 105 62068 return 62070 ' -------------------------------------------------- 62080 CLEARDESK: 62082 ' merge "RECTANGLE.bas" 62084 color 1,0,1 : 62086 xpos1 = -1 : xpos2 = 638 : ypos1 = -40 : ypos2 = -20 62088 gosub rectangle: color 1,1,1 62090 return 62092 ' -------------------------------------------------- 62100 SHRINXBOX: 62102 ' -----> XOLD ; YOLD ; WIDTH1 ; HEIGHT1 62104 ' -----> XNEW ; YNEW ; WIDTH2 ; HEIGHT2 62106 shrinx% = 1 62108 ' 62110 GROWBOX: 62112 ' -----> SEE SHRINXBOX 62114 ' 62116 poke contrl + 2, 8 62118 poke contrl + 4, 1 62120 poke gintin , xold 62122 poke gintin + 2 , yold 62124 poke gintin + 4 , width1 62126 poke gintin + 6 , height1 62128 poke gintin + 8 , xnew + 1 62130 poke gintin + 10, ynew + 38 62132 poke gintin + 12, width2 62134 poke gintin + 14, height2 62136 gemsys 73 + shrinx% 62138 shrinx% = 0 62140 return 62142 ' -------------------------------------------------- 62150 MOVEBOX: 62152 ' -----> WIDTHE; HEIGHT ; XOLD ; YOLD 62154 ' -----> XNEW ; YNEW 62156 poke contrl + 2, 6 62158 poke contrl + 4, 1 62160 poke gintin , widthe 62162 poke gintin + 2, height 62164 poke gintin + 4, xold + 1 62166 poke gintin + 6, yold + 38 62168 poke gintin + 8, xnew + 1 62170 poke gintin + 10,ynew + 38 62172 gemsys 72 62174 return 62176 ' -------------------------------------------------- 62200 RUBBERBOX: 62202 ' -----> MUISX ; MUISY 62204 ' <----- WIDTHE ; HEIGHT 62206 poke gintin , mousex + 1 62208 poke gintin + 2, mousey + 38 62210 poke gintin + 4, 1 62212 poke gintin + 6, 1 62214 AES.3: gemsys 70 62216 widthe = peek(gintout + 2) 62218 height = peek(gintout + 4) 62220 if height<3 or widthe<3 then goto AES.3 62222 return 62224 ' ------------------------------------------------- 62250 DRAGBOX: 62252 ' -----> WIDTHE ; HEIGHT 62254 ' X.MIN ; Y.MIN 62256 ' X.MAX ; Y.MAX 62258 ' <----- XPOS1 ; YPOS1 62260 poke contrl + 2, 8 62262 poke contrl + 4, 3 62264 poke gintin , widthe 62266 poke gintin + 2, height 62268 poke gintin + 4, mousex + 1 62270 poke gintin + 6, mousey + 38 62272 poke gintin + 8, x.min + 1 62274 poke gintin +10, y.min + 38 62276 poke gintin +12, x.max + 1 62278 poke gintin +14, y.max + 38 62280 gemsys 71 62282 xpos1 = peek(gintout + 2)-1 62284 ypos1 = peek(gintout + 4)-38 62286 return 62288 '------------------------------------------------- 62500 EVENTMOUSE: 62502 ' -----> XPOS1 ; YPOS1 62504 ' -----> WIDTHE ; HEIGHT 62506 poke gintin , 0 62508 poke gintin + 2, xpos1 + 1 62510 poke gintin + 4, ypos1 + 38 62512 poke gintin + 6, widthe 62514 poke gintin + 8, height 62516 gemsys 22 62518 return 62520 ' ------------------------------------------------ 62550 MOUSE2: 62552 ' <----- MOUSEX ; MOUSEY 62554 ' <----- KEYA ; KEYB 62556 mousex = peek(gintout + 2)-1 62558 mousey = peek(gintout + 4)-38 62560 keya = peek(gintout + 6) 62562 keyb = peek(gintout + 8) 62564 gemsys 79 62566 return 62568 ' ------------------------------------------------ 62700 COLORSET: 62702 ' -----> RED ; GREEN ; BLUE 62704 ' COLORNUMBER 62706 poke contrl, 14 62708 poke intin, colornumber 62710 poke intin + 2, red * 140 62712 poke intin + 4, green * 140 62714 poke intin + 6, blue * 140 62716 vdisys 62718 return 62720 ' -------------------------------------------------- 62750 POLYMARKCOLOR: 62752 ' -----> MARKCOLOR 62754 poke contrl, 20 62756 poke intin, markcolor 62758 vdisys 62760 return 62762 ' -------------------------------------------------- 62900 INIT: 62902 aes# = gb 62904 control = peek(aes#) 62906 global = peek(aes# + 4) 62908 gintin = peek(aes# + 8) 62910 gintout = peek(aes# + 12) 62912 addrin = peek(aes# + 16) 62914 addrout = peek(aes# + 20) 62916 return 62918 ' -------------------------------------------------- 63000 MOUSE: 63002 '<----- XMOUSE ; YMOUSE ; KEY 63004 poke contrl, 124 63006 vdisys 63008 xmouse = peek(ptsout) - 1 63010 ymouse = peek(ptsout + 2) - 38 63012 key = peek(intout) 63014 return 63015 '--------------------------------------------------- 63030 SHOWMOUSE: 63032 poke contrl, 122 63034 poke intin, 0 63036 vdisys 63038 return 63039 '--------------------------------------------------- 63042 HIDEMOUSE: 63044 poke contrl , 123 63046 vdisys 63048 return 63049 ' ------------------------------------------------ 63050 MOUSEEDITOR: 63052 dim a$(16),b$(16) 63054 a$( 0)="---*--*----*----":b$( 0)="--******--***---" 63056 a$( 1)="--*--*----*-----":b$( 1)="-******--****---" 63058 a$( 2)="---*--*---*-----":b$( 2)="--**********----" 63060 a$( 3)="---*--*--*------":b$( 3)="--*********-----" 63062 a$( 4)="---*---*--*-----":b$( 4)="--*********-----" 63064 a$( 5)="----*-*--*------":b$( 5)="---*******------" 63066 a$( 6)="----------------":b$( 6)="--********------" 63068 a$( 7)="--*********-----":b$( 7)="-*************--" 63070 a$( 8)="--************--":b$( 8)="-**************-" 63072 a$( 9)="--*********--**-":b$( 9)="-***************" 63074 a$(10)="--*********---*-":b$(10)="-***************" 63076 a$(11)="--*********--**-":b$(11)="-***************" 63078 a$(12)="--************--":b$(12)="-***************" 63080 a$(13)="--*********-----":b$(13)="-**************-" 63082 a$(14)="---*******------":b$(14)="--*********-----" 63084 a$(15)="----------------":b$(15)="---*******------" 63086 for a = 0 to 15 63088 gridfront = 0: gridback = 0 63090 for b = 15 to 0 step -1 63092 if mid$(a$(a),b+1,1)="*" then bit = 1 else bit = 0 63094 gridfront = gridfront + 2 ^(15 - b) * bit 63096 if mid$(b$(a),b+1,1)="*" then bit = 1 else bit = 0 63098 gridback = gridback + 2^(15 - b) * bit 63100 next 63102 poke intin + a * 2 + 42, gridfront 63104 poke intin + a * 2 + 10, gridback 63106 print gridfront, gridback 63108 next 63110 goto mousenew 63112 '--------------------------------------------------- 63140 '--------------- MOUSEDATA ------------------------- 63141 HAMMER: 63142 data 96,480,960,1984,3968,8064 63143 data 7936,16256,15872,32512,32512,65408 63144 data 65408,65472,63424,65504,25568,65520 63145 data 496,62456,248,508,124,254 63146 data 62,127,31,63,14,31 63147 data 4,14 63150 COFFEE: 63151 data 4624,16184,9248,32376,4640,16368 63152 data 4672,16352,4384,16352,2624,8128 63153 data 0,16320,16352,32764,16380,32766 63154 data 16358,32767,16354,32767,16358,32767 63155 data 16380,32767,16352,32766,8128,16352 63156 data 0,8128 63160 WORM: 63161 data 0,8064,8064,16320,16320,32736 63162 data 26208,65520,30560,65520,32736,65532 63163 data 29132,65534,16318,32767,8054,16383 63164 data 7782,16383,7372,16382,7384,16380 63165 data 4080,8184,2022,4095,60,2046 63166 data 24,62 63199 '------------------------------------------------- 63200 MOUSEDATA: 63202 '---> restore line 63204 for a = 0 to 15 63206 read gridfront,gridback 63208 poke intin + a * 2 + 42, gridfront 63210 poke intin + a * 2 + 10, gridback 63212 next 63214 '------------------------------------------------- 63250 MOUSENEW: 63252 poke contrl , 111 63254 poke contrl + 6, 37 63256 poke intin , 5 63258 poke intin + 2, 5 63260 poke intin + 4, 1 63262 poke intin + 6, 0 63264 poke intin + 8, 1 63266 vdisys 63268 out 2,7 63270 return 63272 '--------------------------------------------------- 63280 MOUSESHAPE: 63282 '-----> MOUSENUMBER 63286 if mousenumber > 7 then return 63288 add# = gb 63290 gintin = peek(add# + 8) 63292 addrin = peek(add# + 16) 63294 poke gintin, mousenumber 63296 poke addrin, 0 63298 gemsys(78) 63300 return 63301 '--------------------------------------------------- 63302 ' 63400 POLYMARK: 63402 ' ----> XPOS ; YPOS 63404 ' ----> MARKFORM ; MARKSIZE 63406 ' 63408 poke contrl , 18 63410 poke contrl + 2, 0 63412 poke contrl + 6, 1 63414 poke intin, markform 63416 vdisys 63418 poke contrl , 19 63420 poke contrl + 2, 1 63422 poke contrl + 6, 0 63424 poke ptsin , 0 63426 poke ptsin + 2, marksize 63428 vdisys 63430 ' 63432 MARKSETTING: 63434 ' (----> XPOS ; YPOS ) 63436 poke contrl , 7 63438 poke contrl + 2, 1 : ' or more 63440 poke ptsin , xpos + 1 63442 poke ptsin + 2, ypos + 38 63444 vdisys 63446 return 63448 '--------------------------------------------------- 63500 FILLPATTERN: 63502 ' -----> restore MONSTER 63504 poke contrl , 112 63506 poke contrl + 6, 16 63508 for st = 0 to 30 step 2 63510 read MONSTER 63512 poke intin + st, monster 63514 next: vdisys 63516 return 63518 ' ----------------------------------------------- 64000 RECTANGLE: 64002 ' -----> XPOS1 : YPOS1 : XPOS2 : YPOS2 64004 poke contrl , 11 64006 poke contrl + 2, 2 64008 poke contrl + 6, 0 64010 poke contrl + 10, 1 64012 poke ptsin , XPOS1 + 1 64014 poke ptsin + 2, YPOS1 + 38 64016 poke ptsin + 4, XPOS2 + 1 64018 poke ptsin + 6, YPOS2 + 38 64020 vdisys 64022 return 64024 ' -------------------------------------------------- 64026 ' 64030 RECTANGLEROUND: 64032 ' -----> XPOS1 ; YPOS1 ; XPOS2 ; YPOS2 64034 ' -----> FILLING 0 or <> 0 64035 ' 64036 poke contrl , 11 64038 poke contrl + 2, 2 64040 poke contrl + 6, 0 64042 if FILLING = 0 then poke contrl + 10,8 else poke contrl + 10,9 64044 poke ptsin , XPOS1 + 1 64046 poke ptsin + 2, YPOS1 + 38 64048 poke ptsin + 4, XPOS2 + 1 64050 poke ptsin + 6, YPOS2 + 38 64052 vdisys 64054 return 64056 '-------------------------------------------------- 64057 ' 64100 POLYGON2: 64102 ' -----> XPOS ; YPOS 64104 ' RADIUS ; ANGLES 64106 phi = 3.141593/angles/2 64108 STAR: 64110 ' -----> PHI 64112 poke contrl , 9 64114 poke contrl + 6, 0 64116 poke contrl + 2, angles 64118 for angle = 0 to angles * 4 step 4 64120 poke ptsin+angle , 1+xpos+cos(phi*angle)*radius 64122 poke ptsin+(angle+2), 38+ypos+sin(phi*angle)*radius 64124 next 64126 vdisys 64128 return 64130 '-------------------------------------------------- 64140 POLYGON: 64142 ' -----> ANGLES ; XCOORD ; YCOORD 64144 poke contrl , 9 64146 poke contrl + 6, 0 64148 poke contrl + 2, angles 64150 for i = 1 to angles 64152 poke ptsin + (i - 1) * 4, xcoord(i) + 1 64154 poke ptsin + 2 + (i - 1) * 4, ycoord(i) + 38 64156 next 64158 vdisys 64160 return 64162 '--------------------------------------------------- 64200 LINESEND: 64201 ' -----> BEGINFORM ; ENDFORM 64202 poke contrl , 108 64204 poke contrl + 2, 1 64206 poke contrl + 6, 0 64208 poke intin , BEGINFORM 64210 poke intin + 2, ENDFORM 64212 vdisys 64214 return 64216 '-------------------------------------------------- 64217 ' 64220 LINETHICKNESS: 64222 ' -----> THICK 64224 poke contrl , 16 64226 poke contrl + 2, 1 64228 poke contrl + 6, 0 64230 poke ptsin, THICK 64232 poke ptsin + 2, 0 64234 vdisys 64236 return 64238 '------------------------------------------------- 64239 ' 64240 LINEPATTERN: 64242 ' -----> PATTERN 64244 ' 1 - 7 64246 poke contrl , 15 64248 poke contrl + 2, 0 64250 poke contrl + 6, 1 64252 poke intin, PATTERN 64254 vdisys 64256 return 64258 '------------------------------------------------ 64259 ' 64300 POLYLINE: 64301 ' -----> NUMBER ; XCOORD ; YCOORD 64302 poke contrl , 6 64304 poke contrl + 6, 0 64306 poke contrl + 2, number 64308 for i = 0 to number 64310 poke ptsin + i * 4, xcoord(i) + 1 64312 poke ptsin + 2 + i * 4, ycoord(i) + 38 64314 next 64316 vdisys 64318 return 64320 '--------------------------------------------------- 65000 TEXTMODE: 65002 ' -----> TEXTKIND: 65004 ' 0 = normal 1 = double strike 2 = light 65006 ' 4 = italics 8 = underlined 16 = hollow 65008 ' or combinations 65010 ' 65012 poke contrl , 106 65014 poke contrl + 2, 0 65016 poke contrl + 6, 1 65018 poke intin, TEXTKIND 65020 vdisys 65022 return 65024 '------------------------------------------------ 65025 ' 65030 TEXTSIZE: 65032 ' -----> SIZE: 65034 ' < 9 = very small 9 = small 65036 ' 10 - 15 = normal 16 - 17 = big 65038 ' 18 - 19 = very big 65040 ' 65042 poke contrl , 107 65044 poke contrl + 2, 0 65046 poke contrl + 6, 1 65048 poke intin, SIZE 65050 vdisys 65052 return 65054 '------------------------------------------------- 65055 ' 65060 TEXTOUTPUT: 65062 ' -----> TEXT$ ; XPOS ; YPOS 65064 ' text on scale 65066 for i = 0 to len(TEXT$ ) - 1 65068 poke intin + i * 2, asc(mid$(TEXT$ , i + 1, 1)) 65070 next i 65072 poke intin + i * 2, 0 65074 poke contrl , 8 65076 poke contrl + 2, 1 65078 poke contrl + 6, len(TEXT$ ) + 1 65080 poke ptsin , XPOS + 1 65082 poke ptsin + 2, YPOS + 38 65084 vdisys 65086 return 65088 '------------------------------------------------ 65089 ' 65100 TEXTANGLE: 65102 ' -----> ANGLE: 65104 ' angle = 0 ; 900 ; 1800 ; 2700 degrees 65106 poke contrl , 13 65108 poke contrl + 2, 0 65110 poke contrl + 6, 1 65112 poke intin, ANGLE 65114 vdisys 65116 return 65118 '----------------------------------------------- 65119 ' 65130 TEXTFORM: 65132 ' -----> FORM (1 - 4) 65134 ' 65136 ' 3 = XOR 4 = revers, mix 65138 poke contrl ,32 65140 poke contrl + 2,0 65142 poke contrl + 6,1 65144 poke intin, form 65146 vdisys 65148 return 65150 '----------------------------------------------- 65151 ' 65200 CLIPPING: 65202 ' -----> XPOS1, YPOS1, XPOS2, YPOS2 65204 poke contrl , 129 65210 poke intin , 1 : 'Clipping on (0 = uit) 65212 poke ptsin , xpos1 : '0 65214 poke ptsin + 2, ypos1 : '0 65216 poke ptsin + 4, xpos2 : '600 65218 poke ptsin + 6, ypos2 : '400 65220 vdisys 65222 return 65224 ' ----------------------------------------------- 65250 FRAMING: 65252 ' -----> FRAME (0,1) 65254 poke contrl , 104 65256 poke intin , frame 65258 vdisys 65260 return 65262 ' ----------------------------------------------- 65300 LETTERSIZING: 65302 ' -----> LETTERSIZE 65304 poke contrl , 12 65306 poke ptsin + 2 , lettersize 65308 vdisys 65310 return 65312 ' ----------------------------------------------- GfABASIC@PPPTXXXvddd)X*8888888888999:nQMOVEOTDLLAMPDARKNSEDRWUSPFLAGXO1VDOARKINOCVNIWNODRODODOBJECTSDOORSDRSWORDSVERBSINIT LOCATIONSCOMMANDACTION LOKATIONSL1L2L3L4L5L6L7L8L9L8L9OBJECTSSINGLE INTERPRETQUITINV PRINTVERBS PRINTWORDSGETDROPEXAMGOEATO1O2O3O4O5O6O7E1E2E3E4E5E6E7E8E9OPENCLOSELOCKUNLOCKE34O8BREAKCUT HOUSE ' a basic adventure By Stefan Posthuma  y,FtEFoQ^Fa,F Q^ZFhFEEFQVFa,FFE,FQ,FPF82The adventure has ended....press space to continueFxF2 QZS FtQFSqF *initialise variables, objects and doors  n+FiRFEF2*@ ! FRXEGF$Q@ !@ ! F R*F RFAEF* FREGFQ F RF EFi *%Welcome to HOUSE.. a simple adventureFF%.FE print location descriptions  r+F EFaEF EFa EFa EFa EFaEFaEF  SF(#It's too dark, I can't see a thing!FEFd F wL!!!! ! ! ! !F TF!,F F.F +FhTEGF T Ft: There is a "@ " "@ " here.Fi F T8Fi.F +Fd^You are in the entrance hall of the house. The hall is quite large, there are some paintings"FXR with strange, staring faces hanging at the walls. The exit door is to the south."F61There is a room to the north and one to the east.FEF EFr EFr EF,.F, +F`YThis is the Armoury. All kinds of weird weapons are lying around. Some rags of fog drift"F ^W around, and make it very sinister. There is a room to the south and one to the east."Fkhb Near the exit to the east stands a large suit of armour which carries a rather mean looking axe.F. EFn E@@Fn.FE E+F@ WEFetnAs you passed the suit of armour, it suddenly emitted strange sounds and droppedits axe, splitting you in two.FF,&Well, the point is that you have died.FdEFsEFs YFrlYou are in an extremely small room. Everything is covered in a thick layer of dust, and some dead rats lie"FZU around. A staircase leads up and there is a room tothe west and a door to the south.F E Fn EFF EFF EFF F.FE E+F jcThis must be the kitchen. There is a small table and a chair here, and some faint light streams"Fsrl through a window. There is a rather robust looking door to the north and the entrance hall is to the west.F? EFnE@F EFn.FE E+ F޸This is the landing. Some loose floorboards lie around, and the floor looks likeit could collapse any moment. There is a room to the south and one to the east. The staircase leads downFF E@@Fh E``FhE@@F .F $+ FjeYou are now in the bedroom. There is a very large bed in the corner and the onlyexit is to the north.FE F .FE '+ FޓWorkshop. There is a workbench in a corner and the floor is covered with sawdust. The sharp smell of glue violates your nostrils. Exit west.F E F .FE + F ]@FeWow! This must be some secret study. There is a desk in the middle of this tiny room, which is full of books and stuff. The shadows of the candle make it look very spooky..There is an opening to the north.F FE``F .FE )+FzAs you leave the house, the door slams shut and the house shudders and shakes. You run away as the entire house collapses"Fvo. Loud cries come from the ruins and strange creatures wander around. Suddenly eveything becomes black and you"Fcd^ find yourself back in your room, where you were experimenting with magic teleport spells.FFTOIt seems that you survived the House to which you were pulled when teleporting.F82Congratulations, you've managed to crack this one.Fe.(I hope you've learned something from it.FtEFu.FE 'ask command and evaluate it  E+FcF"=`FF" _F Huh?FF F _F E FFEC@ F `F,,F `NFE;@ FE=@6  F8,F F.F "single command entered , i+FrEFr$ `QUITSTOPENDFR,FEFr F& a INVENTORYINVIFR,FEFr F a2LOOKLF,FEFr F a\VERBSF,FEFr F aWORDSF,FEFr F0 aNSEWUDFEFEF,F F bF& I'm not sure I can follow you...FR F .F  +F*$Are you sure you want to quit? (Y/N)FSFFESFbRnyF byFt.)Many have tried but few have succeeded...FEFsEFt bFy Wise decisionF F).F) +FYou are carrying:FEFacEGF cx F (A "@ " "@ FEF FE c(F cFAbsolutely nothing!F F.F n+FoRFodEGz FDQFo dZendwordsFT  ""F cFF.F +FRFdEGz FDQF dZendverbsF  ""F dJFF.F interpret command  n+FeRF@EF,EF,EF,EF,FEQF4F e@ZendwordsFX e8FEFdEF FEdF eFseEGF< e@ @  @ FEF@EF@EF F efF F f:FHI'm sorry but the word ""% is not in my vocabulary. (try WORDS)F, fF  fF, f  FI can't see any "FEFe F FE FERFEFeEFeFEQF4F gZendverbsF g FEFdEF FEfF gXFs,I don't know how to "" (try VERBS)F  hFo h Fw* g @ ``Fv8It is really hard to "" something in the dark.Fy hFi hLDOOR FTOWhat door? I can't see any door. This house is really getting to you, isn't it?F hFt6wL!!!!!!!!!+!,!-!.!1!1!2Fh F F F F.F E+F` hFwYou can't take that!F ipF  i  F!You already have it!F ilF  iF Fe You are carrying too much!F( ihF OK!F EFi4FE F F F.F +F iF,&You're talking complete nonsense here.F- j F' i FlYou don't have it!Fl jF Dropped.F  EF5FE F F.F +FE jDOORF jl Fu It is open.F jF j Fu It is closed.F jFi$It is closed and firmly locked.F F  F FEF! kFiEF!wL!!!!! !!F k|F! kT`Fn Say what???FEF? kxF wL"!#!$!%!&!'!(!)!*F FE F kDOORFcI can't see any "F F .F A+"F  lZFitoThey're a collection of really bizar paintings. The eyes just keep following you. They almost look alive....FEF  Fl.Fl +#Fh m(@PPFhފIt shines and looks like it has been used a lot. In fact it looks like it was used very recently...there is some fresh blood on it......FEF  FE mpFABFeB=You are not some kind of bug that can dig through the ground.F |XFEFEF F= FE0 |NSWEUDFTry that one againF F.F I+Fi }0  FsTOPull yourself together...stuffing that in your mouth wouldn't do you much good.F }FlVPIt tasted really good until you almost broke your teeth on a file that was in itFr  EFo@ EF F.F door handling  o++F  ~,DOORFBDOORFYou can't be seriousF- $F  z Fr"This door doesn't have a lockF  Fs  FaIt is already unlocked.F Fi  FYou must have the key!FF F  Ok...Klick!F EF  F F F F.F 0+1FEF FoEF,&Examine it first, then think about it.Fk F nFkEF   F,&You'll need a hammer or so to do this!Fk jF'4.The box shatters, revealing a pair of scissorsFl EFe@ EF F F FNice tryF F.F E+2F  F!  @@ F*$You'll need something sharp to do itF F'zLike a maniac, you tear the pillow open. Feathers are flying everywhere. A key falls out of the corpse of the poor pillow.Fo@ ETORNF EF  Fz Fe Don't even think about it.F  F.F lperform action  e+Fo* L`` ` FEF ^FEF FE.FE DATA ! A|F V"",HAMMER,7,SMALL,BOX,8,PAIR OF,SCISSORS,-1,SATIN,PILLOW,6,STALE,BREAD,4,"",FILE,-1 LIT,CANDLE,2,LARGE,KEY,-1  "|FA2,1  ,|FsJNORTH,SOUTH,WEST,EAST,UP,DOWN,DOOR,PAINTINGS,TABLE,CHAIR,STAIRCASE,SUIT FSUIT OF ARMOUR,STAIRS,WEAPONS,AXE,WINDOW,RAT,RATS,FOOTPRINTS,PRINTS 2FLOORBOARDS,BOARDS,BED,WORKBENCH,BENCH,SAWDUST d endwords T |FFGET,TAKE,DROP,EXAMINE,EXAM,STUDY,GO,WALK,EAT,OPEN,CLOSE,LOCK,UNLOCK BREAK,SMASH,CUT endverbs D`  'l+~&'&&B\xQS_ TUW&YZ&[[\V]\T$`zdb bd*chi~j.y|uNuvv~wZwx(klhn4p qRrrs} x2#include long int var; short int index; synchronize(routine) int (*routine)(); /* pointer to (=address of) function */ { register long *vblqueue; register short *nvbls; register long i,j; register short bool=0; register long save; /* next install a routine in the VBL-queue */ save=Super(0); /* switch to supervisor status */ nvbls=0x454; /* address of number of VBL routines */ i=(*nvbls); /* get the number */ vblqueue=0x456; /* address of pointer to VBL queue */ vblqueue=(*vblqueue); /* address of VBL queue */ for(j=0;jH@ЃdHA@B@H@хk HAҁHAрSB BbNuNlpNNuCDEJEgJBgJjBEBQ*HE?<>0rHGGdHGGdSWDуdi\?<>0rHGGdHGGdSWDуdiN?<>0rHGGdHGGdSW2 H@N8?<,>CEdGH@0r`?<`JBgVB&8TTDуdQRBNuDAр&AdRAрAрDуNuprt|=|  g +g -f .g20  b 0e 9b da`RF` .f 0e 9b dajSF` Eg efX +g -f 0e 9oSH`00  b&Hz0  b E Do`HJjDDDS4</NJJFkSFk&aQNJ`Ha"FFaQL8N6.JgtBnNupr$<NuJBk4<rpAC v JBGfABASICltttxxxx    AXPYPXYKIDFREEQQQQQQQQQQQQQAXAYPLEASECLICKONTHEACTIONPOINTFORMOUSEINLEFTBLOCKBTYKCTYAVHAHABACKBACJACTIONPOINT EDIT_FILL EDIT_MOUSE EDIT_SPRITE SET_RASTERGOODBYEINITBThe Amazing Cracking Conspiracy and Delta Software Productions FProudly present: Pattern Editor V1.4a, Sunday, September 28th, 1986  r(Published in ST NEWS Volume 1 Issue 5  u:This program is Public Domain and may be spread freely r h,FFXF { FP)!"Please select the|Editor you want:!!FILL|MOUSE|SPRITE!FwL!!FF! +F* FYFE FFE FF,F $&!3!!;F0$$!2!!<F0"'D!:! END OF INPUTFFEE%#P  FE%#Q  FB rRJF%!!F\# !# !# !# F$ E  # FEF<EGFEb F "F %!F$H! ! !CFa FB RJF%!!F\# !# !# !# F2 E ## # FEFEGFEb F F %!F$H! ! !CF FB Z  00@@R FF ERF { Fތ)!bShould I Store your work|or quit without saving?|File will be saved as a|.LST-File (Can be MERGEd)!! SAVE | QUIT !F FF fA:\*.LST!FILL.LST!F7O!M!FBEGF &M! DATA MKI$(&Xp )F F! F.F  +Fd* ! FYFE%%FE FF,F E FFE FF,F $&!3!!;F0$$!2!!<F0"'D!:! END OF INPUTFFEE%#P  FE%#Q  FB rRJF%!!F\# !# !# !# F$ E  # FEFnEGFEb F TF  FB RJF%!!F\# !# !# !# F2 E ## # FEFEGFEb F F  FB R JF%!!F\# !# !# !# F$ E  # FEFEGFEb F F  FB R JF%!!F\# !# !# !# F2 E ## # FEFEGFEb F F  FB 2Z  00@@R F(F|FXY !( "@Please Click On The Action Point For The Mouse In The Left BlockFe { FFE%#P  FE%#Q  FR FF JF-F F { Fތ)!bShould I Store your work|or quit without saving?|File will be saved as a|.LST-File (Can be MERGEd)!! SAVE | QUIT !F  F fA:\*.LST! MOUSE.LST!F7O!M!F$M! DATA MKI$(&Xp )Fn$M! DATA MKI$(&Xp )F)M! DATA MKI$(1)FM! DATA MKI$(0)FM! DATA MKI$(1)FEGF &M! DATA MKI$(&Xp )F F!EGF&M! DATA MKI$(&Xp )F F! F.F K +F* ! FYFE%%FE FF,F E FFE FF,F $&!3!!;F0$$!2!!<F0"'D!:! END OF INPUTFFEE%#P  FE%#Q  FB 8RJF%!!F\# !# !# !# F$ E  # FEF4EGFEb F F  FB dRJF%!!F\# !# !# !# F2 E ## # FEF`EGFEb F FF  FB R JF%!!F\# !# !# !# F$ E  # FEF~EGFEb F dF  FB R JF%!!F\# !# !# !# F2 E ## # FEFEGFEb F F  F B Z  00@@R FF|F(XY !( "APlease Click On The Action Point For The Sprite In The Left BlockF { FFE%#P  FE%#Q  FjR FF JF-F( F { FF)!Which Sprite type do you want?!! NORMAL|XOR!FS JJFEF \FEF FE EA F { Fތ)!bShould I Store your work|or quit without saving?|File will be saved as a|.LST-File (Can be MERGEd)!! SAVE | QUIT !F PF fA:\*.LST! SPRITE.LST!F7O!M!F$M! DATA MKI$(&Xp )Fn$M! DATA MKI$(&Xp )Fn M! DATA MKI$()F)M! DATA MKI$(0)FM! DATA MKI$(1)FLEGF &M! DATA MKI$(&Xp )F&M! DATA MKI$(&Xp )F F! F.FK+FE EGF.!!!F.!!!F xF2!!!F.F+Fl@!FE(!!! FC8' !H!!THE ACC AND DSP PROUDLY PRESENTSFO4' !H! PATTERN EDITOR VERSION 1.4aF(!!!PFT6)!Hit Return to Continue!!OK!FFl@!Fr.F8TXZ' Scroll Message Editor V1.3 ' ' Software written by Richard Karsmakers ' Actual scroll developed by Jos Schilders ' ' This program is Shareware ' ' This program must be used with GfA Basic V2.0 ' @Checkres @Init Do @Getkey If A=187 @Load Endif If A=188 @Save Endif If A=189 @Edit Endif If A=190 @Scroll Endif If A=191 @New Endif If A=192 @Message Endif If A=196 System Endif Loop Procedure Checkres Res=Xbios(4) !Which is the resolution? If Res<>2 !No high res? Deftext 1,17,0,32 Setcolor 1,0,0,0 Text 70,70,"ONLY SM12x!" Label12: For X=0 To 7 Setcolor 0,7,7,X Pause 0.0001 Next X For X=7 Downto 0 Setcolor 0,7,7,X Pause 0.0001 Next X Goto Label12 Endif Return !If high res, continue execution Procedure Init Spoke 16745024,0 Deffill 1,2,24 Pbox 0,0,639,399 Deffill 1,0 Pbox 50,10,590,50 Deftext 1,1,0,32 Text 112,42,"Scroll Message Editor V1.3" Pbox 20,70,620,385 Deftext 1,1,0,13 Text 154,100,"PLEASE SELECT ONE OF THE FOLLOWING OPTIONS:" Deftext 1,16,0,13 Text 114,140," Load String F 1" Text 114,160," Save String F 2" Text 114,180," Edit F 3" Text 114,200," Scroll F 4" Text 114,220," New F 5" Text 114,240," Save Message File F 6" Text 114,260," Quit F10" Deftext 1,1,0,13 Text 126,350,"Scrolling Design and Development by Jos Schilders" Text 190,370,"Programming by Richard Karsmakers" Deftext 1,0,0,13 Pbox 0,286,640,305 ' String data for the default scrolling text A$=" Welcome to the Scroll Message Editor V1.3, written in November 1986 by Richard Karsmakers " A$=A$+"for ST NEWS Volume 1 Issue 6. Thanks to Jos Schilders, who designed the original scrolling routine. " A$=A$+"His routine only had to be improved a bit (like adding synchronisation and integer variables). " A$=A$+"With the use of this program, it is possible to create scrolling messages that can easily be MERGEd into " A$=A$+"your own programs. Simply call the procedure and that's all. It's all extremely flexible and simple. This program belongs " A$=A$+"to the Shareware, and you can freely use the MERGEd in subroutine in your own (commercial) programs. " A$=A$+"If you want to extend your gratitude to me, you can do that by thanking me (or The ACC) in your " A$=A$+"program using the scrolling routine, or paying any amount of money on my giro account: " A$=A$+"Number 5060326 t.n.v. Richard Karsmakers, Helmond, The Netherlands. " A$=A$+"A short user manual: * Pressing any key quits the scroll * Pressing F1 in 'Edit' or 'New' mode " A$=A$+"enables you to type in an ASCII code (which DOES NOT appear on the screen) for a character " A$=A$+"that cannot be gained through the keyboard * Hitting F10 quits most modes * Hitting return closes " A$=A$+"down the 'New' mode * Pressing the left and right arrow keys scrolls the text in 'Edit' mode * " A$=A$+"Texts may not be longer than 32766 characters (32 Kb) * When in 'Edit' mode, the character to " A$=A$+"the rightmost side of the screen is changed when hitting an alphanumeral key * When " A$=A$+"SAVEing a text string, another file using the same name is automatically deleted * This is also the case " A$=A$+"when you are SAVEing a 'message file' * 'Quit' returns to the desktop, but if you want to examine " A$=A$+"the programming techniques I used, you can do this by pressing ALTERNATE, SHIFT and CONTROL " A$=A$+"simultaneously in the GfA Basic interpreter (not the run-only interpreter!) * " A$=A$+" I hope you will like this small (but handy?!) programming tool............. " @Scroll Return Procedure Load Showm Alert 3,"The string in memory|will be lost!",1,"OK|SHIT!",A If A=2 Goto Label1 Endif A$="" Fileselect "\*.SCR","",Lo$ If Lo$="" !Avoid bus error Goto Label1 Endif If Exist(Lo$)=0 !Avoid File not found error Goto Label1 Endif Open "I",#1,Lo$ Input #1,Q Q=Q/255 For X=0 To Q Line Input #1,Buf$ !Line input is used because the string might use ',' A$=A$+Buf$ Next X Close #1 Label1: Alert 0,"READY!",1,"OK",Dummy Hidem @Scroll Return Procedure Save Showm Fileselect "\*.SCR","",Sa$ If Sa$="" !Avoid bus error Goto Label2 Endif If Exist(Sa$)=-1 !Avoid file exists error Kill Sa$ Endif Q=Len(A$) Open "O",#1,Sa$ Print #1,Q Print #1,A$ Close #1 Label2: Alert 0,"READY!",1,"OK",Dummy Hidem Return Procedure Scroll C=0 Hidem Print At(1,19);Space$(80) L=Len(A$) Do C=(C+1) Mod L Print At(80,19);Mid$(A$,C,1) For I%=1 To 8 Get 1,288,639,303,B$ Put 0,288,B$ Vsync Next I% Exit If Inp?(2) Loop Showm Pause 10 Print At(1,19);Space$(80) A=Inp(2) Return Procedure Getkey A=Inp(2) Return Procedure New Alert 3,"The string in memory|will be lost!",1,"OK|SHIT!",U If U=2 Goto Label10 Endif A$=" " X=0 Do @Getkey If A=13 !RETURN key (closes down mode) A$=A$+" " A$=A$+Chr$(A) Endif Exit If A=13 If A=187 !Function key 1? @Getcode Goto Label4 Endif If A=8 And X>0 !backspace check X=X-1 Buffer$=A$ A$=Left$(Buffer$,Len(Buffer$)-1) Print At(40,19);" "; Get 0,288,639,303,B$ Put 8,288,B$ If Len(A$)>39 Print At(1,19);Mid$(A$,Len(A$)-39); Endif Print At(1,19);" "; Goto Label3 Endif If A=34 !Disable quote (gives mess in message file) Goto Label3 Endif If A=156 !Enable pound sign () Goto Label4 Endif If A<32 Or A>126 Goto Label3 Endif Label4: A$=A$+Chr$(A) Get 8,288,639,303,B$ Put 0,288,B$ Print At(40,19);Chr$(A); Inc X Exit If X>32766 !String too long? Label3: Loop Pause 10 Print At(1,19);Space$(80) Label10: Return Procedure Getcode Alert 2,"Please type in|the Character code|you want after|hitting Return",1,"OK",Dummy Label5: @Getkey If A<48 Or A>57 Goto Label5 Endif A=A-48 D=A*100 Label6: @Getkey If A<48 Or A>57 Goto Label6 Endif A=A-48 E=A*10 Label7: @Getkey If A<48 Or A>57 Goto Label7 Endif A=A-48 F=A A=D+E+F Return Procedure Edit C=0 Hidem Print At(1,19);Space$(80) L=Len(A$) Do @Getkey Exit If A=196 If A=203 C=C-1 If C<0 C=0 Goto Label8 Endif Get 0,288,639,303,B$ Print At(1,19);" " Put 8,288,B$ If C>79 Print At(1,19);Mid$(A$,C-79,1) Endif Goto Label8 Endif If A=205 C=C+1 If C>Len(A$) C=C-1 Goto Label8 Endif Get 8,288,639,303,B$ Put 0,288,B$ Print At(80,19);Mid$(A$,C,1) Goto Label8 Endif If A=187 @Getcode Mid$(A$,C,1)=Chr$(A) Print At(80,19);Mid$(A$,C,1) Endif If A<32 Or A>126 Goto Label8 Endif Mid$(A$,C,1)=Chr$(A) Print At(80,19);Mid$(A$,C,1) Label8: Loop Pause 10 Print At(1,19);Space$(80) A=Inp(2) Return Procedure Message Showm Fileselect "\*.LST","MESSAGE.LST",Me$ If Me$="" Goto Label11 Endif If Exist(Me$)=-1 !Avoid File exist error Kill Me$ Endif Open "O",#1,Me$ Print #1,"' This procedure can be MERGEd into your own programs" Print #1,"' a$ = the string containing the text" For X=1 To Len(A$) Step 60 Print #1,"a$=a$+";Chr$(34);Mid$(A$,X,60);Chr$(34) Next X Print #1,"@Scroll" Print #1,"Procedure Scroll" Print #1,"C=0" Print #1,"Hidem" Print #1,"Print At(1,19);Space$(80)" Print #1,"L=Len(A$)" Print #1,"Do" Print #1,"C=(C+1) Mod L" Print #1,"Print At(80,19);Mid$(A$,C,1)" Print #1,"For I%=1 To 8" Print #1,"Get 1,288,639,303,B$" Print #1,"Put 0,288,B$" Print #1,"Vsync" Print #1,"Next I%" Print #1,"Exit If Inp?(2)" Print #1,"Loop" Print #1,"Showm" Print #1,"Pause 10" Print #1,"Print At(1,19);Space$(80)" Print #1,"A=Inp(2)" Print #1,"Return" Close #1 Label11: Hidem Return ' End of program! gJjv-| Bb BkH>aaNRFBdL8?N<JBga2SF Be BgQRB`ApdR e <rRF&0xafEv+0JFjDFv-Hƌd0BFHF 0HF0ANuprt|`HQ2: A d@C 5e*!R 0c 9c0`<R"_`^2:C0 Ef"_NuHQN|aCr  g 00VJAgB @ nN @mHJ@j0.4DBUBk0QSAg Q.`S@k 0`0BAF "_Nu.WAkQA" 0g` @eA0NuaVHNuaWHNuAd RdQRB>Ge GbFGNu G0dFGNu~NuAd RdQRB6Ce0 C/jC C@j C jr0H@{0DH@Nur{0Nu{0NutNuJj(:,af AfBfNu&<x*<NҀHnr$g4jDk( b4<J@`@[H@0Nu4<Ѐ[Nu4<NuNuAd RdQRBBkBjDBJjDNupNufJj fJAkNupNdRdRrxaAffBWHNuJjDBDA@JBfprJjDEDD@JEfvxNuaغBffAVHNuCDEaEf fDUHNu]HNuCDEaEffDftNuJBgGfABASICpHBBBB>)H*++ + +2+P+P+P+l++++XBIPEEKDEEKLPEEKACVAADXXFLABELLKEYSSEBPSPREFADENSMDSFSTSIHIEXLDSCLOLADFREERSCSMAACDRLOADCOBEVMEMFMGSRFVPMPTCLBELLKEYKENASEBPSPRECPFADENSMDSFSTSIHIEXJJLDFNETSCLAFRRSCSXSPEEKSDPEEKMENACCAAABSTRSMIDBEGININVERTLABEL1TRACKSFILEJOINLABEL2PROCEEDABOUTINITINVERTFINITOLADENIDMEMCNTLRPHYSTOPMEMBOTMEMTOPSEEKRATE WHICHRATEFVERIFY WHICHFLAGBOOTDEVPALMODESCREENPTDECIMALASCIIHOCMDLOADCONTERMNFLOPSDISKBUFPDSKBUFPSYSBASEENDOSREADSECTBOOTSECT DISKERRORGO_ONDFREEBPB4The Amazing Cracking Conspiracy proudly presents  hDThe Ultimate Examining Utility V2.8, Sunday, September 28th, 1986  h(Published in ST NEWS Volume 1 Issue 5  uFThis program belongs to the Public Domain, and may be copied freely ,FInstall menu bar n F ^F2When an error occurs, branch to subroutine "Ho" vLFrvLFFLFQFBreak routine +F N)@!)This program cannot|be stopped!|Cute, eh?!!Continue!F.F$Here, all menu titles are checked +FFF R  QuitFi,F F& R  About Examine F,F F$ S  View Decimal F,F F" S4  View ASCIIFl,F F& Sd  Invert Screen Fr,F F S  memcntlrF,F F S  phystopF,F F S  _membotF, F F  T  _memtopF, F F $ T4  seekrate... Fo, F F " T`  _fverify...F, F F T  _bootdevFg,F F T  palmodeF,F F T  _cmdloadFb,F F U  contermF,F F U,  _nflopsF,F F UV  _dskbufpFD,F F U  _sysbaseFf,F F U  end_osFn,F F$ U  Boot Sector FF,Fm F U  DFreeF, F F }@Fh.FQuit program u+F,*Make screen white with black characters l@!FYF"Quit program without alert box aFa.F*This is the "About Examine" subroutine +F )!!!OK!Fe.FLthis subroutine first checks the state of the screen colors, then inverts +F E@F E2 F W% JF|l@!F WFl@!F F.F<From here on downward, the system variables are displayed +FE F E2 F Ep FN)!)Memory Controller|Configuration Nibble|is!!%!F.F+F1E F E4 F En F:)!Physical Top of RAM|is!!$!F.F+ FE@ F E4 F En F B)!Bottom of Available Memory|is!!$!F.F+ FE F E4 F En F >)!Top of Available Memory|is!!$!F.F+ FE F E3 F Ep F  YJF E6F ZJF! E0000FF FE" _v?@@ 1JFiEBELL ONF _FEEBELL OFFF FE" _?@@ 1JFiEREP ONF _FEEREP OFFF FEF)!Console Terminal|is!!%||!F.FE+FE F E3 F EA FB)!"Number of|Floppy Disks attached|is!!!F.F+FE F E4 F En F D)! 1024-byte Disk Buffer|Pointer is!!$!F.F+FE@ F E4 F En F P)!+Base of Operating System|(In ROM or RAM)|is!!$!F.F+FE F E4 F En F T)!0Last byte+1 that is used|in Low RAM by the|OS is!!$!F.F(Here, all disk function are performed +F EFE FLNow, BIOS function 4 is called to read a sector -the bootsector- into a$ 4=BIOS function number, rwabs $2=Read sector, ignore disk change > Leaving away the 2, and making a 0 of it, would sometimes 8 sometimes result in an error -14 (Disk was changed) 6L:Varptr(a$)=Tells BIOS where to put the sector(s) d1=Read one sector 00=Start at logical sector 0 (The bootsector) o0=Drive number (0=A) c4E!!z !!! F d* JF,F F dF JF-F FCalculate serial number E?@@@ F2E7: 7>@ 7< F EA F2)!The Serial Number is:!!!F,F e JF-F FBytes per sector eE?@@@ FE7: 7< F EA F4)!Bytes per Sector|is:!!!F,F e JF-F FSectors per cluster E>@` F E7 F EA F8)!Sectors per Cluster|is:!!!F,F fH JF-F FReserved sectors =E?@p@ FE7: 7< F EA Fd)!DReserved Sectors at the|Beginning of the disk|(Incl. Bootsector) is:!!!F,F g JF-F FFATs E>@ F E7 F EA F@)! FAT tables on the|whole disk is:!!!Fo,F g JF-F FDirectory entries E?@@ FE7: 7< F EA F@)!Directory entries|(maximal) is:!!!FB,F hd JF-F F Sectors E?@ @ FE7: 7< F EA F@)!Sectors on the disk|(total) is:!!!Fc,F i JF-F FMedia descriptor byte E>@0 F E7 F EA FH)!*The Value of the|Media Descriptor Byte|is:!!!Fs,F i JF-F FSectors per FAT E?@8@ FE7: 7< F EA F:)!Sectors per FAT entry is:!!!F,F jb JF-F FSectors per track E?@H@ FE7: 7< F EA F6)!Sectors per Track is:!!!F,F k JF-F FSides  E?@X@ FE7: 7< F EA F*)! Sides is:!! !F,F k JF-F FHidden sectors F!E?@h@ FE7:! 7(@@@ 7>(@ 7:( F (En F6)!The load address is:!!$(!Fm,F q JF-F FFAT buffer E?@,@ FJE7< 7>@@@ 7>@ 7: F En F^)!NAXJ@jNNuNJ@g,A,BBgHQ?<=NAP FJ@k??<>NAXtNutNuaHQ` @gS@@CNu   aH@@`"aH@@`a0) 4a3B HA2;i`0^ M / hawA~FNuAXr%eee%NuA]NuA>A6HP 0 0 &0&?< NN\Hx?< NN\JfNu vN)@p `H@)@prtNAHplrtNB 2pNpNpapaprapalpalpalpaTpaTpaTBp'a?<NNT@B){L9|0<rtNpapap9@p`pvNv`v`vj`v `v`v`v`?Aa*` Al 2l 4)lVH)lRprtNAl 2l 4HVNu9Cp rtNAv` Av `Avl 2l 4)lVHNaB0,l 2HNua40,HNua*0,l 4HNua0,l 22,l 44,HHHNuN9||BlBlrҌpsNBNu@((?<NN.?<NNX@LvA HA HNuNup9@HA)A,Nr FN @e024E$ Bb5B5A6CC5CK5CAB008:Dk`Ek\00<,>,SFSGFnHGnDDDk9DBlDEk9EBlFcllGcll0,lb 0,lcNufpmrtA)HA)HNpNHHPNr4 _:8><DbFEbGCHP@dʾAdBD2ƞE29|C???FF22N23BRG0@\@N"2)INf(* 9AJA)H@@[000][ˈN Evz`* [g" ]g |g QSz` zQSpQ][ɈN Dvx`* [g" ]g |g QSx` xQSpQ]Bp4NTHNu@9@JpNNTr|<N @xepw2A$JBjDFHB t`0QBl9F)lVTAtp 9| N2(g"P@g2RADAH""l`r2oZAe 1@#)I`Nuk1@Nup NN"l`dpNAtrdJhk\QpaNH ld$l`"Hg: k&@0+R`g k#&@0+S@H3 Q&f)I`LNuApNN$Np$BS@kH2QNupC ұd"X0Pg"RA$D#Nu"X0NuNJ@gpNu _0HpN _0HpNp"_0HqNp"_0HqNE ұeHHQ0)N$_$ZR@H`2QNu$Y0gHR@@"D%$X0P2g# R@%NupE $ $X0dP.gRG,D%pr Y2dP.gRG,D!p4Ae4v`VfANuNWHNu2)A IJAfr4(Ae*RBBc0*SA?Np$E$R`QˈN ENup`(* 0(iNp$E 4R`Q$D 4R`QˈN DN ENu2p <0Np`QNuH&N րN jNuHRp` HRpJQfpNNq Y Qfd ЀЀNuNN$_& if"QdփփHRNlNN~,Nq8DRzXEEg"7PNqR$HBJBgpNJgJigp`eetЂ`"ЀeЁdp`ЀeЀe"Ѕe$W.H@@NL"2` NqR YEjrd0` SjN" KC`e N`d \N l\Ӭ\ NupNd d3 d# d# # d# # # # d# # # # # # # # dB` # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # QNu??<NMXNu?k?<NM"UAf J@fH@NuDW?<NMXNu0,p2,rR@RANuS@SA9@p9ArNu9@pN4, 6fprta0,2,NuA4, 6f9@9Ap rt`C l ", Ⲭ dfѬ SA 0! Nup"N"p`tdbBA0Hg:<R@f|0Np*JFk*HQ/??<?NAXfX ENuJkpNp`p`\F( &I.` ??<NMXJ[j E&DkNuak NupNuakfpNupNtddA0oH?<?B?<BNA Jk.,?<?B?<BNA *kBg?/?<BNA JkNuNp`pNu)H9@Jp4NT9|&J&f H LNu P&Nu9|&Jl&lHByeC! B,&LNu-W)K20, 8k8@ gJl&f"Nu , 8g"P 8 @/, 8N  8fQ 8J,'gNupB <``L@ H)l26)z @W , Jf`CfSHj-D@Hd0H@H 0H@0`fSC\fS , @a"C]fApNXNHHP?< NA\NuH@aa/a a Nu@0 9c^Nu| PC>$Fehler # ][Abbruch]\f*&lX)K\)ld` lp ,BQjNup(NT)l g,vARC( g9CJ9|Lp!,NT FPeNu:A JpBQA/)H )l gBlJpNTB Aprt0 0BBB R@ @efA000 0PB0 *00 000\0X0 *0000 0P0BX0, *@00p1| 1|QBX0 $HTH0P &0 *0,NupNSk [0NupNuHPaH8 _&X Pf/|~ K! zag @ ep 24C"2 S@ػ Td BTA3A0C4$I2a222B"0@2A\xvaRg<2#M 4B3BS@ -f ػ Td>BAAb8RGRC`3RSG5GC5C J1DcaRF F e`RG GcdNuXASF1F41R 1h4 x1EDgVA)H)H 9|J?<NNTU@g,ACg dRhdRh(gpL8NTp>L8NAJ0?C bL000zH?A/.)HpNTLrHH/>Bl/,ff.f.ffNu l /.g&, ^`D&, N`>&, R`8&, V`2&, Z`,2,/4WAARA0,/6A hfRAS@f9A/,&, Jo ? CN0`@k Ap0(/.NuA Nup)@JphNTLtH &JKBCH .A/~0 1PP1P1PA L? &<@>AFG0000X0000X0000X0000C ~AJ0g0  pi, NT"F QNuYp-KNu"l`Yd&-KNN"l`YepN&#k"C-KN"Cփk փk2##`փk##`3#`$Y8gHRDD*D%H8#$c2g# HRDD%H`"X0gBPHR@@"D#NuAU`NAUNAQNA4>NAN^NA2NN4`NHNVpNC킺NHPND How to use ST NEWS&"_NfN#>AGNpNC킺NHPND QuitT"_NfN$HxND Are you sure?HPN8YES|NOr"_ N+@ -UWHfN#N$ <N+@ -NnNN,zNfN#R -"<N&pNpNNZAUNNHpNC킺NHPND Invert Screen Color "_NfN$TA2HNpNC킺NHPN8 About ST NEWS"_NfN$A2NpNC킺NHPN8 Invert Screen"_NfN$ -UVHfN$AYNN$A2HNpNC킺NHPND Change Hertz"_NfN%*ATNpNC킺NHPND Something about Interrupts4"_NfN%NDDOC01C큘NlA3NAIDNpNC킺NHPND Little Computer People"_NfN%NDDOC02C큘NlA3NAIDNpNC킺NHPND The DiscP"_NfN&LNDDOC03C큘NlA3NAIDNpNC킺NHPND System Variables4"_NfN&NDDOC04C큘NlA3NAIDNpNC킺NHPND Diskmanipulation I4"_NfN' NDDOC05C큘NlA3NAIDNpNC킺NHPND GfA Basic V1.0"_NfN'fNDDOC06C큘NlA3NAIDNpNC킺NHPN8 Sound Programming"_NfN'NDDOC07C큘NlA3NAIDNpNC킺NHPND BIOS Functions"_NfN( NDDOC08C큘NlA3NAIDNpNC킺NHPN8 Zork I (Solution)"_NfN(~NDDOC09C큘NlA3NAIDNpNC킺NHPN8 Diskmanipulation II"_NfN(NDDOC10C큘NlA3NAIDNpNC킺NHPND XBIOS Functions II"_NfN)>NDDOC11C큘NlA3NAIDNpNC킺NHPN8 GfA Basic I"_NfN)NDDOC12C큘NlA3NAIDNpNC킺NHPN8 Low to High Converter"_NfN)NDDOC13C큘NlA3NAIDNpNC킺NHPND GEMDOS Functions"_NfN*VNDDOC14C큘NlA3NAIDNpNC킺NHPN8 Tempelmon"_NfN*NDDOC15C큘NlA3NAIDNpNC킺NHPND MIDI"_NfN*NDDOC16C큘NlA3NAIDNpNC킺NHPN8 Psygnosis Games"_NfN+ZNDDOC17C큘NlA3NAIDNpNC킺NHPND GfA Basic II"_NfN+NDDOC18C큘NlA3NAIDNpNC킺NHPN8 GEM VDI Calls I"_NfN,NDDOC19C큘NlA3NAIDNpNC킺NHPN8 XBIOS Functions I"_NfN,nNDDOC20C큘NlA3NAIDNpNC킺NHPND GEM VDI Calls II"_NfN,NDDOC21C큘NlA3NAIDNpNC킺NHPND Ultimate Examining Utility4"_NfN-4NDDOC22C큘NlA3NAIDNpNC킺NHPND Pattern Editorl"_NfN-NDDOC23C큘NlA3NAIDNpNC킺NHPN8 GfA Basic III"_NfN-NDDOC24C큘NlA3NAIDNpNC킺NHPN8 Starfiend"_NfN.@NDDOC25C큘NlA3NAIDNpNC킺NHPN8 MC 68000 Part I"_NfN.NDDOC26C큘NlA3NAIDNpNC킺NHPND Two Chess Programs4"_NfN.NDDOC27C큘NlA3NAIDNpNC킺NHPN8 Scroll Message Editor"_NfN/^NDDOC28C큘NlA3NAIDNpNC킺NHPN8 Strip Poker"_NfN/NDDOC29C큘NlA3NAIDNpNC킺NHPND Extensor"_NfN0 NDDOC30C큘NlA3NAIDNpNC킺NHPN8 GEM VDI Calls III"_NfN0jNDDOC31C큘NlA3NAIDNpNC킺NHPN8 Michtron Software"_NfN0NDDOC32C큘NlA3NAIDNpNC킺NHPND Writing Adventures4"_NfN1(NDDOC33C큘NlA3NAIDNpNC킺NHPND Our Correspondence Address 4"_NfN1NDDOC34C큘NlA3NAIDNpNC킺NHPN8 Editorial"_NfN1NDDOC35C큘NlA3NAIDNpNC킺NHPN8 ST NEWS Colofon"_NfN2DNDDOC36C큘NlA3NAIDNN -UVHfN2jAYNN2 <@N+@ -NnNN,JBfN2p"<@N&N2p"<@N&NBN8jST NEWS Volume 1 Compendium|Program Designed & Developed|by Richard Karsmakers|Published Januari 18th 1987HPN8GREAT!r"_ N+@NHxND)Please Insert the|ST NEWS Disk|in drive A&HPNDSwellar"_ N+@ANlNNDDATA\4HPA큘"_NjC큞NlA큞C큘NlA큘N&N,zNfN3A3FNN3pNpINHPA큘r"_NpN+@&p"-&N\C큤NlpNpNNANlp"<N>pQC킺N6B pdA N/- N"C킺N - C킺NHPND***4"_Ng NN4N`NqNq/- A C킺N - R/A C킺NpNHmN8 Welcome to the one and only ST NEWS Volume 1 Compendium! Idea by Commedia, program designed and developed by Richard Karsmakers. "_NjC큶NlHmNDwThis disk combines the best articles that have appeared in all issues of ST NEWS that were launched in 1986, hoping to a"_NjC큶NlHmN8^serve everyone that found those a bit clumsy. A short usermanual for this version of ST NEWS: "_NjC큶NlHmN8:This program works on both color-and monochrome monitors, "_NjC큶NlHmND=but some options will not be available in one of both modes. "_NjC큶NlHmNDkThis version of ST NEWS is very easy to use: You simply move the mousepointer to a menu title, after which ,"_NjC큶NlHmNDa drop-down menu will appear. Simply highlight your selection and click the left mouse button. Once you're in page-viewing mode, 4"_NjC큶NlHmNDwit is possible to move one page up or down with the arrow up-and arrow down keys respectively. Hitting the key labeled i"_NjC큶NlHmN8rUNDO causes this mode to be aborted. Hitting ESC, ^C, ^G, ^Q, ^Z or F10 has the same effect. When you are in menu "_NjC큶NlHmN8Xmode, hitting these keys causes a total abortion of the program (to the GEM desktop). "_NjC큶NlHmND_Selecting INVERT SCREEN from the menu bar causes the screen to be inverted in monochrome mode. "_NjC큶NlHmNDcSelecting CHANGE HERTZ only has effect on color monitors; it toggles screen to normal or big size. "_NjC큶NlHmN8Another option has been "_NjC큶NlHmNDincluded in the page viewing mode: Pressing S enters the 'Statistics' funtion; you will then be able to see the number of lines, pages "_NjC큶NlHmN8Band the actual size of the document currently residing in memory. "_NjC큶NlHmN8>Pressing any key causes a return to the actual page you left. "_NjC큶NlHmN8If you have any suggestions for improvals to this program, please contact us at our correspondence address (ST NEWS, Kievitstraat 50, 5702 LE, Helmond, The Netherlands). "_NjC큶NlHmNDWe would also like to hear about any bugs you might discover! Some of the 'bugs' we removed in this version: We now define the scroll text only once, which we h"_NjC큶NlHmN8did every time the scroll was activated in the previous issue. Furtheron, we have now opened the possibility to store ST NEWS on hard disk, "_NjC큶NlHmNDdisk drive B, memory disk or even CD Rom, since we've got rid of the device A: load. Also, the whole issue can be put in another folder; k"_NjC큶NlHmND{the program doesn't start looking into the root directory anymore, which it used to do. We have also disabled the ALT-HELP o"_NjC큶NlHmN8Voption, so that you won't have to wait all that time if you hit ALT-HELP by accident. "_NjC큶NlHmN8ZWe apologize for the inconveniences that occured during the previous issue's setup; we've "_NjC큶NlHmN8gotten rid of these nasty habits! We hope you will now like this definate setup even more than you did with the previous issue. "_NjC큶NlHmNDThe source file of this program (written in GfA Basic V2.0) will not be available; you'll have to wait a while until Volume 2 Issue 2 appears, for which c"_NjC큶NlHmN8a documented source will be made. A documented source file of ST NEWS Volume 2 Issue 1 is still available: Just pay 75 Dutch guilders "_NjC큶NlHmN8on giro account number 5060326, t.n.v. Richard Karsmakers, Helmond, The Netherlands. People who live outside the EEC should add "_NjC큶NlHmND/five extra guilders for additional post costs. K"_NjC큶NlHmN8Please write your own address "_NjC큶NlHmN8down very clearly so I can send the documents to the right address! The following people helped designing this program: Jos Schilders (who designed the rough scrolling routine), "_NjC큶NlHmNDyFrank Lemmen (who checked all the routines that only worked or worked different on a 1 Meg computer or on a double-sided o"_NjC큶NlHmND%disk drive) and, last but not least, t"_NjC큶NlHmN8>Stephen Thorne and Anthony Rush of Commedia in Amsterdam, who "_NjC큶NlHmN8lsupported us throughout all projects and who took care that we were able to get the right documentation for "_NjC큶NlHmN8lthe things we'd been working on! Also thanks to all the people that have reacted to our new set-up and that "_NjC큶NlHmN8came with suggestions for improvals and additions! You can hit any key or mousebutton to leave this scrolling message...... "_NjC큶NlNB.pNpNnpNrpNvANl&<x*<NNrNANl&<x*<NN"<N -UWHfNGNdpNNnppNNzNdprN pPNNnNzA큶N+@*R. -.*\HfNG <.Ѝ/ -* _`NdprPN Hmp"-."_N,NnNz+| pA N?<ANl&<x*<NN??<ANl&<x*<NN?A큼" NBgANl&<x*<NN?A큼"N -UWHfNHN"N`dNqpN/NNnzN+|BANlvNA퀐NANl&<x*<NA퀄NBRBmAONpN$VHgNJj`BZB^BbpN+@AUANlvNA퀐NSB -2NnH -BNnN&<x*<NL8NNN+@:AONNJT -^Nn&<x*<NpJBgp/ -:&\HpJBgp$VHfNMNJT -^SWHfNN*+|>ANlvNA퀐NRBAONNJT -bSWHfNNBNNHNJTAN^NA큤N <:Ѝ/p _ѐNOA퀐NlHANl&<x*<NL8NTgNQ@Hmp"-:"_N,HPpN"_NfNPANNNO ->NnvNN/A퀐NlHA~NlL8NN"NHmp"-:"_N,NR>R: -:&\HgNQ@`pN -2NnH -BNnN&<x*<NL8NN/ -:" A0N?<NNT+@ -UWHfNQp"<@N&A 0NR2 -JWHfNRNtNdNPSorry! No Low res allowed!NzpNANjNHA 0ARBN?<NNT+@NAJNlvNHAPNlvNL8NHAVNlL8NN?Bg?<NN\A\NlvNHAbNlvNL8NHAhNlL8NN??<?<NN\Bg?<?<NN\Bg?<?<NN\NpN+@ -Nn&<x*<NpJBgp/ -Nn&< x*< NpJBgp/ -Nn&<x*< NpJBgp/ -Nn&<x*<NpJBgp/ -Nn&<x*<NpJBgp/ -Nn&<x*< NpJBgp$VHfNTNHxND Are you sure? HPN8YES|NOr"_ N+@ -UWHfNT@NTNAUNNH - WHfNTHxND Are you sure?HPN8YES|NOr"_ N+@ -UWHfNTNTNHN+|  -N WHfNT <"-N&NT <"-N&N -n"<@N> -"<BN> -v"<DN> -z"<FN>NpN$VHfNU\pN+@`N <@N+@n <BN+@ <DN+@v <FN+@zAJ 0AP @0AV 0Bm`BmfBmlN <N+@ -RWHfNUNV - R%_WHfNV,N8 DiagnosticC큞NlNVFN8 Program/DataC큞NlHxNDUse of 4HPA큞"_NjHPND Cartridges|is not allowed!4"_NjHPNDAbortr"_ N+@NHNNtB*BmHNdNPWait a minute...Nz+|A큤NA킦NHmp"-"_N,HPp N"_NfNWR*N`NqNq -*Nn&<x*<N$ADNADNlNADNADNl&<x*<NADNNdN^+This document has the following statistics:4NzNdNPSize : -&NVNzNdNPLines : -*NVNzNdNPPages : ADN^NzNdNzNdN^-Press any key to return to Page Viewing Mode!!NzpNANjAXNAONN+|>ANlvNA퀐N -2NnH -BNnN&<x*<NL8NNN+@:NHxNDMSorry, but this function has|not been implemented in this|version of ST NEWS!HPN8SHITr"_ NA NjNNHInfo About ST NEWS----------------------------Features-Programs-------------------- Low to High Converter Ultimate Examining Utility Pattern Editor Scroll Message Editor-Novels---------------------- The Disc Starfiend-Reference------------------- System Variables Sound Programming BIOS Functions GEMDOS Functions XBIOS Functions I XBIOS Functions IIEducation-Courses-------------- MC 68000 Part I MIDI Writing Adventures-ST Basic GEM--------- GEM VDI Calls I GEM VDI Calls II GEM VDI Calls III-SF Disk Drives------- Diskmanipulation I Diskmanipulation II-GfA Basic------------ GfA Basic I GfA Basic II GfA Basic IIIRegulars Our Correspondence Address Editorial ST NEWS ColofonDiverse-(P)reviews------------------ Little Computer People GfA Basic V1.0 Tempelmon Psygnosis Games Two Chess Programs Strip Poker Extensor Michtron Software-Diverse--------------------- Zork I (Solution) Something about InterruptsOptions Invert Screen Change Hertz How to use ST NEWS--------------------- Quit***" J.F,(B66 6D @ 2 : < 8 : 8 : < < 4 > : 2 . 8 6 8 : : D 8 6 2 8 < > 4 2 : : < F 2 8  (F V<&"Z Vfff H( L8PbH6& jn RFF*bx  jn RFF*bx \NlvNHAbNlvNL8NHAhNlL8NN??<?<NN\Bg?<?<NN\Bg?<?<NN\NpN+@ -Nn&<x*<NpJBgp/ -Nn&< x*< NpJBgp/ -Nn&<x*< NpJBgp/ -Nn&<x*<NpJBgp/ -Nn&<x*<NpJBgp/ -#a000000 #b000000 #c0007777000600070055200505552220770557075057705503110802 #d #E 93 02 #W 00 00 0A 01 1E 17 07 A:\*.*@ #W 00 00 2A 01 1D 17 00 @ #W 00 00 0E 09 15 0B 00 @ #W 00 00 2E 09 15 0B 00 @ #M 00 01 00 FF B DISK DRIVE B@ `@ #M 00 00 00 FF A DISK DRIVE A@ @ #T 00 03 02 FF TRASH@ @ #F FF 04 @ *.*@ #D FF 01 @ *.*@ #G 03 FF *.APP@ @ #G 03 FF *.PRG@ @ #F 03 04 *.TOS@ @ #P 03 04 *.TTP@ @ AP 0AV @0Bm`BmfBmlN <N+@ -RWHfNVNV - R%_WHfNVLN8 DiagnosticC큞NlNVfN8 Program/DataC큞NlHxNDUse of 4HPA큞"_NjHPND Cartridges|is not allowed!4"_NjHPNDAbortr"_ N+@NHNNtB*BmHNdNPWait a minute...Nz+|A큤NA킦NHmp"-"_N,HPp N"_NfNW>R*N`NqNq -*Nn&<x*<N$ADNADNlNADNADNl&<x*<NADNNdN^+This document has the following statistics:4NzNdNP