Skip to content

Instantly share code, notes, and snippets.

@fknaopen
Created December 8, 2016 15:21
Show Gist options
  • Save fknaopen/c6bf598c843450f21fe5457da707d562 to your computer and use it in GitHub Desktop.
Save fknaopen/c6bf598c843450f21fe5457da707d562 to your computer and use it in GitHub Desktop.
JR-100 BASIC: TINY SPACE MOUSE
10 REM \8E\8E TINY SPACE MOUSE \8E\8E
20 POKE18,$2F:POKE19,$FF:OPTIONCMODE1:GOTO250
30 REM ----MAIN
40 PICKK:BEEP1:BEEP0:IFK=0GOTO80
50 IFK=$47 GOSUB120:GOTO80
60 X1=(K=$42)-(K=$56):P=PEEK(X+X1):IFP>$83GOSUB220
70 POKEX,$80:X=X+X1:POKEX,$4A
80 Z=RND(20):POKE$3F07,Z:U=USR($306D):IFRND(N)=0POKE$C103+Z,$88
85 U=USR($320A):W=W-(W>0):IF(W>1)*(W<5) POKE1,$70
90 T=T+1:LOCATET/83,0:PRINT" ";:IF(PEEK($3FF0)=1)+(T>1750)GOTO440
100 A=(A=0)*(RND(50)=0)*($C103+RND(20))+(A<>0)*A:IFA=XGOSUB240
105 POKEA,$86
110 FORI=1TO30:NEXT:GOTO40
115 REM ---- FLOOR UP
120 P=PEEK(X-32):IF(F>249)+(P=$84)*(W<1)RET
130 FORI=1TO2:P=PEEK(X-32):Z=RND(20):POKE$3F07,Z:IFF>241 POKE$3F03,2
140 POKE$305B,Z:POKE$3055,RND(20):POKE$3057,RND(20):POKE$3059,RND(20)
145 IF(F=242)*(I=2) BEEP1:GOSUB530
150 BEEP0:BEEP1:P=PEEK(X-32):IFP>$83GOSUB220
160 IFA<>0 A=A+32:IFA>$C3BF POKEA-32,$80:A=0
170 U=USR($3000,X):U=USR($306D):U=USR($320A):IFA=XGOSUB240
175 Z=RND(20):POKE$3F07,Z:IFRND(N)=0POKE$C103+Z,$88
180 NEXTI:F=F+1:LOCATE12,25:PRINTF;:S=S+R:LOCATE9,25:PRINTS;"0";
190 W=W-2*(W>0):N=13-R*3/2+1-F/30:T=T+2:IFN<1N=1
200 RET
210 REM ---- TOUCH
220 IFP=$84 X1=0:RET
230 IF(P>$86)+(P=$85)POKE$3FF0,1:RET
240 POKEX,$4A:POKE1,$40:BEEP:POKE1,$AA:BEEP:POKE1,$D0:BEEP1
245 W=50:S=S+20*R:LOCATE9,25:PRINTS;"0":A=0:RET
250 RESTORE670:FORI=$C020TO$C04F:READI$:I$="$"+I$:POKEI,VAL(I$):NEXT
260 FORI=$C000TO$C007:POKEI,0:NEXT:IFPEEK($3010)=$80GOTO280
270 FORI=$3000TO$3284:READI$:I$="$"+I$:POKEI,VAL(I$):NEXT
280 GOSUB550
290 S=0:M=5:R=1:H$=CHR$(17)+CHR$(20)+CHR$(20)+CHR$(20)
300 F=1:A=0:GOSUB330:N=13-R*3/2+1:IFN<1N=1
310 U=USR($31E8):W=0:T=83:POKE$3FF0,0:GOSUB420:X=$C30D:POKEX,$4A
320 POKE1,$70: POKE$3F03,1:GOTO30
330 REM ----SCREEN
340 U=USR($3158):FORI=0TO17STEP2:LOCATEI,2:PRINTFLD(1);"$";SPC(20);"$"
350 LOCATEI+1,2:PRINTFLD(1);"$$$$$$$$$$$$$$$$$$$$$$";:FORJ=1TO4
360 LOCATEI+1,RND(20)+3:PRINTFLD(1);" ";:NEXT:NEXT
370 FORI=17TO22:LOCATEI,2:PRINTFLD(1);"$$$$$$$$$$$$$$$$$$$$$$";:NEXT
380 LOCATE0,25:PRINT"\E4\EE\EE\EE\EE\EE\E6":LOCATE1,25:PRINT"\F2SPACE\E8":LOCATE2,25
390 PRINT"\F2MOUSE\E8":LOCATE3,25:PRINT"\E3\94\94\94\94\94\F6":RESTORE
400 FORI=5TO17STEP3:READI$:LOCATEI,25:PRINTI$:NEXT:LOCATE6,25:PRINTH;"0"
410 LOCATE9,25:PRINTS;"0":LOCATE12,25:PRINTF:LOCATE15,25:PRINTR:RET
420 LOCATE18,25:PRINTM-1:FORI=2TO22:LOCATEI,0:PRINT"\F2";:NEXT:RET
430 DATA HISCORE,SCORE,FLOOR,ROUND,LEFT
435 REM ----DEAD
440 IFP=$85POKE1,$70:BEEP:POKE1,$AA:BEEP:POKE1,$50:BEEP:GOTO500
450 POKE1,$AA:FORI=1TO4:POKEX,$4A:BEEP:POKEX,$4B:BEEP:NEXT
455 M=M-1:IFM>0 POKEX,$80:GOTO310
460 LOCATE9,7:PRINT"[GAME OVER]":LOCATE19,6:PRINT"PUSH [S] KEY!";
470 H=H*(H>S)+S*(S>=H):PICKK:IFK<>83GOTO470
480 POKE1,$70:GOTO290
490 REM ----CLEAR
500 GOSUB610:LOCATE9,7:PRINT"\8ECLEAR !\8E";R:S=S+1750-T:R=R+1
510 FORI=$FFTO5STEP-5:POKE1,I:BEEP:NEXT:GOTO300
520 REM ----UFO
530 LOCATE0,2:PRINTFLD(1);" %%%";H$;"% %":POKE$C117,$80:RET
540 REM ----DEMO
550 CLS:PRINT" [TINY SPACE MOUSE]":LOCATE4,13:PRINT"[G]"
555 LOCATE5,14:PRINT"\88"
560 LOCATE6,10:PRINT"[V]\86\8A\89[B]":LOCATE15,8:PRINT"PUSH [S] KEY !"
570 LOCATE17,4:PRINT"(P)1985 BY HEART LAND"
580 PICKK:IFK<>83GOTO580
590 BEEP:RET
600 REM ----CLEAR 2
610 LOCATE16,3:PRINTFLD(1);"% %":POKE1,$FF:FORI=1TO250:BEEP1:BEEP0:NEXT
620 FORI=14TO0STEP-1:LOCATEI,3:PRINTFLD(1);"%%%";H$;"% %";H$;" ";
630 POKE1,I*9:BEEP:NEXT:LOCATE0,3:PRINT" ";H$;" ":RET
660 REM ----DATAS
670 DATAAA,00,AA,24,24,AA,00,AA,EF,EF,C7,C7,EF,EF,EF,EF
680 DATA3C,7E,E3,ED,E3,6E,3C,00,00,01,32,49,5D,FD,FE,00
690 DATA1C,20,38,D6,BA,FE,38,10,00,40,9C,92,BA,BF,7F,00
700 DATAFF,3F,00,86,80,A7,00,CE,C3,C0,09,A6,00,B7,3F,02,80,7F
710 DATA25,05,B6,3F,02,A7,20,8C,C1,02,26,EC,FE,3F,00,86,4A,A7
720 DATA00,BD,30,2B,39,00,00,CE,C1,03,B6,3F,03,80,02,25,10,86
730 DATA80,A7,00,08,8C,C1,17,26,F6,86,01,B7,3F,03,39,86,84,A7
740 DATA00,08,8C,C1,17,26,F8,CE,C1,03,86,80,A7,03,A7,13,A7,0E
750 DATAA7,0E,86,02,B7,3F,03,39,00,00,00,00,00,00,00,00,00,00
760 DATA00,CE,C3,F7,BD,30,7D,00,00,00,09,8C,C0,E1,26,F4,39,BD
770 DATA31,40,A6,00,FF,3F,04,B7,3F,06,80,87,25,1B,B6,3F,06,80
780 DATA88,26,26,86,20,B7,30,F5,86,88,B7,30,F3,A6,20,80,83,25
790 DATA24,80,03,20,01,39,B6,3F,07,80,0A,25,05,86,87,A7,00,39
800 DATA86,89,A7,00,39,BD,30,F8,A6,00,80,83,25,05,86,88,A7,00
810 DATA39,8B,39,26,06,86,01,B7,3F,F0,39,8B,4A,26,05,86,80,A7
820 DATA00,39,B6,3F,06,80,88,27,0D,A6,20,80,84,25,02,20,05,86
830 DATA88,B7,30,F3,86,80,A7,00,86,88,A7,20,39,00,00,00,25,16
840 DATAB7,30,BD,B7,30,F5,86,21,B7,30,E2,86,88,B7,30,C3,86,89
850 DATAB7,30,F3,39,86,00,B7,30,BD,B7,30,F5,86,20,B7,30,E2,86
860 DATA88,B7,30,C3,86,87,B7,30,F3,86,01,B7,30,C5,B7,30,D8,B7
870 DATA30,F1,09,39,00,00,00,00,00,00,00,00,00,00,86,00,B7,30
880 DATAC5,B7,30,D8,B7,30,F1,39,00,00,00,00,00,00,00,00,00,00
890 DATA00,00,86,00,CE,C3,FF,A7,00,09,8C,C0,FF,26,F8,39,00,00
900 DATA00,00,00,00,00,00,00,00,86,17,B7,3F,0A,09,FF,3F,08,B6
910 DATA3F,0A,80,01,27,12,B7,3F,0A,00,00,80,86,26,EC,86,80,A7
920 DATA00,BD,31,98,20,E3,39,00,00,00,00,00,86,00,B7,3F,0C,09
930 DATAA6,00,80,80,26,05,86,01,B7,3F,0C,08,08,A6,00,80,80,26
940 DATA07,B6,3F,0C,8B,02,B7,3F,0C,B6,3F,0C,80,00,00,00,27,12
950 DATA80,01,27,0D,80,01,27,0B,00,00,B6,3F,07,80,0A,25,02,09
960 DATA09,86,86,A7,00,39,00,00,00,00,00,00,00,00,00,00,00,00
970 DATA00,00,CE,C0,E0,A6,00,B7,3F,0D,80,83,26,04,86,84,20,09
980 DATAB6,3F,0D,80,87,25,04,86,80,A7,00,08,8C,C4,00,26,E2,39
990 DATADE,82,8C,00,00,26,01,39,86,80,A7,00,B6,3E,00,80,02,26
1000 DATA05,08,C6,01,20,1C,8B,01,26,05,09,C6,02,20,13,86,20,08
1010 DATA80,01,26,FB,96,B5,80,0A,25,04,C6,01,20,02,C6,02,A6,00
1020 DATABD,32,72,80,00,26,0C,DE,82,86,80,A7,00,CE,00,00,DF,82
1030 DATA39,80,02,26,05,F7,3E,00,DE,82,DF,82,86,86,A7,00,A6,20
1040 DATABD,32,72,80,02,27,05,C6,00,F7,3E,00,39,00,80,00,26,01
1050 DATA39,80,8A,24,04,8B,07,24,03,86,02,39,86,01,39
1060 REM (C)1985 FUKUOKA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment