World shattering Z80 machine code effect routine. Each time the code is called the screen shakes once, so a single call gives a ‘hit by a missile’ effect, and multiple calls give an earthquake.
Appears on
Library tape of the Indiana Sinclair Timex User’s Group.
Source Code
10 REM USE LIST 2d RETURN :H\\ NEW o AND g GO SUB i{= CLEAR GO SUB a{= CLEAR LIST \ RETURN :H\\ NEW o AND g GO SUB i{= CLEAR GO SUB a{= CLEAR LIST <>oo 20 BORDER 5: PAPER 5: LET a=2: LET b=7: CLS 30 FOR i=0 TO 21 40 PRINT AT i,8; INK a; PAPER b; FLASH 1;" STOP THE TAPE " 50 LET c=a: LET a=b: LET b=c: NEXT i 60 PRINT #1;AT 1,0; INK 9;" PRESS ANY KEY TO TURN PAGE", 70 RANDOMIZE USR 26727 80 IF INKEY$="" THEN GO TO 70 90 BORDER 7: PAPER 7: INK 9: BRIGHT 0: CLS : BORDER 5 100 PRINT AT 18,0; INK 2;" Wizard Prang "; INK 1;"presents-"," "; PAPER 6;" EARTHQUAKE "; PAPER 7," another world shattering Z80 machine code effect routine." 110 REM DRAW MOUNTAINS 120 PLOT 8,40: DRAW 24,0: DRAW 37,48: DRAW 24,-40: PLOT 86,60: DRAW 50,64 130 DRAW 5,-6: DRAW 5,4: DRAW 4,-7: DRAW 5,8: DRAW 48,-88: PLOT 182,75: DRAW 24,24: DRAW 31,-40 140 DRAW 7,0: PLOT 116,98: DRAW 13,1: DRAW 7,-5: DRAW 11,5: DRAW 10,-4: DRAW 4,5: DRAW 9,-5 150 GO SUB 380: REM CODE POKER 160 REM SHAKE IT UP 170 FOR i=1 TO 3: LET a=USR 40000: PAUSE (RND*10)+1: NEXT i 180 PRINT AT 1,17; FLASH 1;"\.'\.'";AT 2,16;"\'.\.'\.'\'.";AT PI,17;"\'.\.'"; FLASH 0;AT 4,17;"!!!",," !!!": REM Turns on volcano! 190 FOR i=1 TO 20: LET a=USR 40000: PAUSE (RND*10)+1: NEXT i 200 PRINT AT 0,0; INK 2; FLASH 1;" R to REPEAT- Other to CONTINUE ": PRINT ,,,,,,,,,, 210 PAUSE 0 220 IF INKEY$="r" OR INKEY$="R" THEN PRINT AT 0,0,,: GO TO 160 230 CLS : PRINT " This routine is relocatable and requires about 80 bytes of memory, so you could stick it in a REM like we do with our 'STOP TAPE' siren, or in the printer buffer or wherever." 240 PRINT " At the moment, the code is at address 40000, and also in DATA statements in BASIC, at line 3000, in decimal form. Each time the code is called the screen shakes once, so a single call gives a 'hit by a missile' effect, and multiple calls give an earthquake." 250 PRINT " You will be able to SAVE the code on its own via the menu on the next page, or just edit the BASIC to suit yourself."," There are lots of REMs."'" Press Q to turn page, or any other to see a single shake." 260 PAUSE 0 270 IF INKEY$="q" OR INKEY$="Q" THEN GO TO 300 280 RANDOMIZE USR 40000: GO TO 260: REM SINGLE SHAKE 290 REM MENU 300 CLS : PRINT '''''TAB 5;"Press R to Read Again"''TAB 5;"Press Q to Quit"''TAB 5;"Press S to SAVE CODE " 310 IF INKEY$<>"" THEN GO TO 310 320 PAUSE 0 330 IF INKEY$="r" OR INKEY$="R" THEN RUN 90 340 IF INKEY$="q" OR INKEY$="Q" THEN BORDER 7: CLS : PRINT AT 10,8;"START THE TAPE": LOAD "" 350 IF INKEY$="s" OR INKEY$="S" THEN CLS : PRINT AT 10,4;"SAVE ""QUAKE""CODE 40000,80" 360 GO TO 300 370 REM QUAKE code in decimal data form, with loader. Locates code at 40000, change to suit. 380 RESTORE 400: FOR i=0 TO 76: READ code: POKE 40000+i,code: NEXT i: RETURN 390 REM The '118's are machine code equivalents of 'PAUSE 1'. Replace with zeroes for faster shake. 400 DATA 58,0,64,245,58,255,90,245,58,255,87,245,33,0,64,84,93,1,254,26,35,237,176,251,118,118,118,118,58,255,87,50,254,87,33,255,90,84,93,1,253,26,43,43 410 DATA 237,184,251,118,118,118,118,118,118,33,0,64,84,93,1,254,26,35,237,176,241,50,255,87,241,50,255,90,241,50,0,64,201 420 SAVE "QUAKE" LINE 10: PRINT FLASH 1;"Verify...": VERIFY ""