SHORTCUTS ZX Computing, November 1986 Ray Elder presents another prize winning collection of readers' routines. - - - - - - - - - - PRINTING WINDOWS Robert Glavas, a regular writer from Bury, sent us an unusual program to allow you to print a section or window of the screen to a ZX or Alphacom printer. The Machine code is relocatable and once you've entered or reloaded the program load in your previously saved screen by LOAD "" SCREEN$ and type GO TO 1. Answer the prompts and the required window will be produced. (LISTING 1) [file: PrtWindows] - - - - - - - - - - REFLECTIONS Mark Batts of Abbots Langly supplied us with LISTING 2 [file: Reflect], a program to drive you round the bend. Try it. - - - - - - - - - - A SOUND PROGRAM [The penultimate number in line 30 was 236 in the listing ] [but this does DJNZ -20 which is before the start of the code,] [so it crashed. 244 keeps it in a valid loop, but as it's just] [sending a6 to port 254 all the time all it does is change the] [border to yellow with no sound. JimG] Supplied by Michael Toner who lives in Belfast, this short program (LISTING 5) [file: Sound] will liven up the old Beep. Once entered and RUN just type RANDOMIZE USR 65511 to have your ears tickled. [The actual locations are 65488 and 65503. JimG] - - - - - - - - - - RANDOM SELECTION [I had to add the high-lighted parts as otherwise it would go] [into an infinite loop if all NG elements of N() were filled ] [before the last I loop iteration. JimG] Ian Skillen proves the ZX81/TS1000 is surviving in Chicago, but his routine for selecting non repeated random numbers over a set number of selections can be used on any ZX computer. (LISTING 6) [file: random] - - - - - - - - - - QL DUMP A rare beast indeed from Mr L.W. Tomlin of London. More of a tip really but for [the] slowly fading QL. He tells us that there is a screen dump utility on the EASEL cartridge called GPRINT_PRT and should work with any Epson type printer. Load it by typing a=RESPR(2000): LBYTES MDV1_GPRINT_PRT,a When you want to print a screen either from within a program or after loading a pre-designed screen simply type CALL a. I tried it with a Shinwa CP80 and it worked. - - - - - - - - - - BREAK & DISPLAY From the Netherlands comes LISTING 3 and 4 [file: Break&Disp], courtesy of Rene Uittenbogaard. One is to add some protection to your program (3), and (4) splits the screen into two sections, the top half staying unchanged but the lower half scrolling up. Great for adventure game writers. Your program goes from line 20 onwards and all you have to do is use the command PRINT FN p$("Text goes in the string") with a maximum of 32 characters at a time. - - - - - - - - - - PROGRAM PROTECTION 2 Tony Porritt offers the system they use in Cleveland for protecting their listings. At this rate ZXC readers will have the most secure programs in the world! Remember to only add line one after your program has been tested and is bug free else you're stuck. (LISTING 7) LISTING 7 1 LET l=USR "a"-768: POKE 23606,l-256*INT (l/256): POKE 23607,INT (l/256)-1: DATA 15,30,12,1,9,31 2 REM program starts here - - - - - - - - - - TOPSY TURVEY [file: topsy] This routine is an interesting means of turning the display upside down. The code is loaded to 32000 but it is relocatable and can be placed anywhere you wish. Use it by RANDOMIZE USR address. This one came from the I.O.W. and was written by David Hiscock. - - - - - - - - - - 3D WINDOW & TEXT [file: WindowText] Two from Alec Goodyear, the first to draw a 3D "window" on the screen. As written you have to enter the positions, but these dimensions could be built into a program. The second allows text to be input to a specified position and length. Again the parameters could be built into a program if desired. [Correction added at line 172 to stop accidental repetition. JimG]