Family Basic programs from 任天堂のファミリーコンピュータファミリーベーシックがわか

Started by UglyJoe, August 13, 2012, 08:09:31 pm

Previous topic - Next topic

UglyJoe

Hey hey.  Some of you might remember me mentioning a book / cassette combo that I got a couple of weeks ago.  Well, I've finally gotten the cassette programs to load, so I figured I'd start collecting them here.  The book is called 任天堂のファミリーコンピュータファミリーベーシックがわかる本 or, as I've (more than likely incorrectly) translated Nintendo Family Computer and Family Basic Guide Book.  There are 10 programs in all, and each has a background-graphics track as well.  

My recording process involved capturing the cassette to a WAV file via a portable cassette player and the line-in jack on my PC.  The cassette player, while okay for music, is rather lacking when it comes to dumping data (hello, 80sFreak!).  Luckily, with some post-processing in Audacity, I was able to get the recordings clean enough to load after some trial-and-error (thanks, frank_fjs!).  Once I got the recordings cleaned up, I converted them into Nestopia's .tp file format and loaded them into the emulator.  I then used Nestopia's tape-recorder features to get a pristine recording.  

I'll post the original recordings (from the cassette) when I'm done, for those who want to get the full tape-loading experience.  Enjoy!


Game 1:
カニトリ ゲーム (Crab Game)

This is a pretty basic "slide-and-shoot" game, where you move Mario left and right and try to shoot the moving crab.  The crab fires back in a very dumb manner, so you can stand in the same place and it'll rarely hit you.  The background graphics appear to be purely cosmetic, as both the crab and the projectiles go right through them.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGEN2:CGSET,0:SPRITEON:VIEW
12 Y=4:CH=0:T1=0:NM=2:TE=0
15 LOCATE7,0:PRINTTE:LOCATE25,0:PRINTNM
20 DEFMOVE(0)=SPRITE(0,3,1,2,0,0):POSITION0,100,192:MOVE0
30 DEFMOVE(1)=SPRITE(14,5,1,6,0,0):POSITION1,12,20:MOVE1
40 DEFSPRITE0,(0,0,0,1,0)=CHR$(213)
100 'MAIN
105 IFMOVE(2)=0THENERA2
110 S=STICK(0):T=STRIG(0)
120 IF MOVE(0)=0 ONS GOSUB500,550
135 IF T1=1 GOSUB650
140 IF T1=0 AND T=8 GOSUB600
150 IF YPOS(1)>170THEN155
152 IF MOVE(2)=0 GOSUB700
155 IF CH=4 AND MOVE(1) GOSUB900
160 IF MOVE(1)=0 THEN ONY GOSUB430,450,480,400
180 GOSUB 750
190 GOSUB 800
199 GOTO100
400 DEFMOVE(1)=SPRITE(14,3,1,108):MOVE1:Y=1:RETURN
430 DEFMOVE(1)=SPRITE(14,5,1,10):MOVE1:Y=2:RETURN
450 DEFMOVE(1)=SPRITE(14,7,1,108):MOVE1:Y=3:RETURN
480 DEFMOVE(1)=SPRITE(14,5,1,10):MOVE1:Y=4:CH=CH+1:RETURN
500 IF XPOS(0)>210 THEN RETURN
510 DEFMOVE(0)=SPRITE(0,3,1,3):MOVE0:RETURN
550 IF XPOS(0)<30 THEN RETURN
560 DEFMOVE(0)=SPRITE(0,7,1,3):MOVE0:RETURN
600 T1=1:TX=XPOS(0)+8:TY=YPOS(0):SPRITE0,TX,TY:RETURN
650 TY=TY-5:IFTY<30THENSPRITE0:T1=0:RETURN
660 SPRITE0,TX,TY:RETURN
700 DEFMOVE(2)=SPRITE(12,5,1,((180-YPOS(1))/2))
710 POSITION2,XPOS(1),YPOS(1)+16:MOVE2
720 RETURN
750 IF XPOS(0)<XPOS(2) AND XPOS(0)+12>XPOS(2) AND YPOS(0)<YPOS(2) AND YPOS(0)+12>YPOS(2) THEN 770
760 RETURN
770 NM=NM-1:LOCATE 25,0:PRINT NM;" ":IF NM<0 THEN 1500
780 DEF MOVE(0)=SPRITE(10,1,1,10):CH=0:Y=4:MOVE0:PLAY"O3F0CFCFC"
785 IF MOVE(0) THEN 785
790 RETURN 20
800 IF XPOS(1)<TX AND XPOS(1)+12>TX AND YPOS(1)<TY AND YPOS(1)+12>TY THEN 820
810 RETURN
820 SPRITE0:TX=XPOS(0):TY=YPOS(0):TE=TE+5:LOCATE 7,0:PRINT TE;"0"
830 DEF MOVE(1)=SPRITE(10,1,1,8):MOVE 1
835 PLAY"O3F0EGFEGFEG"
840 IF MOVE(1) THEN 840
849 T1=0:CH=0:Y=4:RETURN 30
900 CUT0:Z=(XPOS(0)-XPOS(1))/2
910 DEFMOVE(1)=SPRITE(14,3,1,Z):MOVE1
920 IF MOVE(1) THEN920
925 DEF MOVE(0)=SPRITE(10,1,2,50):MOVE0
926 PLAY"O3C0GEBAGECDFAGEB"
928 IF MOVE(0) THEN 928
930 CH=0:NM=NM-1:IF NM<0 THEN 1500
940 RETURN15
1500 CLS:SPRITE OFF
1510 LOCATE 5,5:PRINT"テンスウ ";TE;" テン"
1520 LOCATE 5,8:PRINT"モウイチド シマスカ Y/N"
1530 A$=INKEY$:IF A$=""THEN 1530
1540 IF A$="Y" THEN RUN

[close]




Game 2:
キーボード レッスン (Keyboard Lesson)

This is a nifty keyboard practice game.  There are 26 boxes with enemies hiding behind them.  Each box corresponds to a letter key on the keyboard.  The start of the game prompts you for a speed (1-5) and then the game begins.  Enemies will pop out of the boxes one at a time and you have to hit the corresponding key before the enemy hides again.  It's sort of like a 26-hole whack-a-mole.  Pretty fun if you like typing games.  This one is pretty useless without the background data, so be sure to load it!



Files: BG Data  Program Data

Source code:
Spoiler

5 GOSUB 2000
10 CGSET,0:SPRITE ON:VIEW
15 PAUSE 30:PLAY"C1R5C1R5C1R5":PAUSE 30
20 DE=0:TE=0:TT=0
100 'MAIN
110 IF MOVE(0)=0 AND Y=0 GOSUB 500
120 IF MOVE(0)=0 AND Y=1 GOSUB 550
130 GOSUB 600
150 IF MOVE(0)=0 AND DE>29 AND Y=0 THEN 1500
199 GOTO 100
500 Z=RND(26)+1:IF F=Z THEN500
505 DE=DE+1:F=Z:LOCATE 5,22:PRINTDE;" "
510 ON Z RESTORE 3000,3010,3020,3030,3040,3050,3060,3070,3080,3090,3100,3110,3120,3130,3140,3150,3160,3170,3180,3190,3200,3210,3220,3230,3240,3250
520 READ A,B,C
530 DEF MOVE(0)=SPRITE(A,1,L,10,1,0):POSITION0,B,C:MOVE0:PLAY"O5C0O4C":Y=1:RETURN
550 DEF MOVE(0)=SPRITE(A,5,L,10,1):MOVE0:Y=0:RETURN
600 A$=INKEY$
610 IF A$=CHR$(Z+64) THEN 630
620 RETURN
630 DEF MOVE(0)=SPRITE(10,1,1,6,1):MOVE0:PLAY"O3G0CGCGC"
640 IF MOVE(0) THEN640
645 TE=TE+(55-L*5):Y=0:TT=TT+1:ERA 0
648 IF DE>29 THEN 1500
649 LOCATE 20,22:PRINTTE;" ":RETURN
1500 PAUSE30:CLS:SPRITE OFF
1505 IF DE=TT THEN LOCATE 5,5:PRINT"パ-フェクト ボ-ナス 3000":TE=TE+3000
1510 LOCATE3,8:PRINT"アナタ ノ テンスウ ハ ";TE;" テン デス"
1520 LOCATE 8,12:PRINT"モウイチド シマスカ ? "
1525 LOCATE 8,14:PRINT"ヤメル トキ ハ N キ-"
1530 LOCATE 8,16:INPUT A$
1540 IF A$="N" THEN END
1550 RUN
2000 CLS:PRINT"      <<< キ-ボ-ド レッスン >>>"
2005 LOCATE 3,5:PRINT "*** ムズカシサ ハ ドレグライ ? ***"
2010 LOCATE7,8:PRINT "1-5 1ガ イチバン ハヤイ "
2020 LOCATE 7,10:PRINT"RETURN キ- ヲ オシテネ":PRINT
2030 INPUT"       ";L
2040 RETURN
3000 DATA 11,16,38
3010 DATA 5,48,38
3020 DATA 2,80,38
3030 DATA 3,112,38
3040 DATA 11,144,38
3050 DATA 2,176,38
3060 DATA 5,208,38
3070 DATA 14,16,78
3080 DATA 8,48,78
3090 DATA 9,80,78
3100 DATA 13,144,78
3110 DATA 14,176,78
3120 DATA 15,208,78
3130 DATA 14,16,118
3140 DATA 11,48,118
3150 DATA 5,80,118
3160 DATA 2,144,118
3170 DATA 11,176,118
3180 DATA 8,208,118
3190 DATA 9,16,158
3200 DATA 11,48,158
3210 DATA 2,80,158
3220 DATA 8,112,158
3230 DATA 14,144,158
3240 DATA 7,176,158
3250 DATA 5,208,158

[close]




Game 3:
ムーンベース 2 (Moonbase 2)

I'm racking my brain trying to think of what the prequel to this game was!  This one is kinda...bad.  You have ships that fly in from the left and the right, and you have Mario standing there like an idiot.  Mario can fire one shot at a time and has a limited number of shots.  The objective, as far as I can tell, is to hit as many ships as possible.  The game ends when you are out of shots.  What makes the game bad is that you can't move.  What makes the game worse is that the collusion detection is bad and the input processing is bad.  Also, you shots sometimes randomly disappear.  "Buggy", I guess, is the right word for it.  BG graphics look neat on this one, but are totally cosmetic.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGSET,0:SPRITE ON:VIEW
20 FORI=0TO2:DEFSPRITEI,(0,1,1,1,0)="ドデビバ":NEXT
30 FORI=3TO5:DEFSPRITEI,(0,1,1,0,0)="ギグゲゴ":NEXT40 FORI=0TO3:READA,B,C,D,E,F:DEFMOVE(I)=SPRITE(A,B,C,D,E,F):NEXT
50 DEFSPRITE 6,(0,1,0,1,0)=CHR$(21)+CHR$(20)+CHR$(23)+CHR$(22):SPRITE 6,110,160
90 P1=0:P2=0:X1=21:Y1=45:X2=219:Y2=107:T1=1:T2=0:NT=30:TE=0:TX=120:TY=160:T1=0
100 IF MOVE(3)=0 THEN T1=0:ERA3:POSITION3,120,160
104 LOCATE21,0:PRINTNT;"  "
105 S=STICK(0):T=STRIG(0)
123 IFT1=1THEN130
125 IFT=8THENNT=NT-1:GOSUB850
130 IF XPOS(0)<XPOS(3) AND XPOS(0)+16>XPOS(3) AND YPOS(0)<YPOS(3) AND YPOS(0)+16>YPOS(3) GOSUB900
140 IF XPOS(1)<XPOS(3) AND XPOS(1)+16>XPOS(3) AND YPOS(1)<YPOS(3) AND YPOS(1)+16>YPOS(3) GOSUB950
168 IFMOVE(0)=-1THEN170
169 GOSUB600
170 IFMOVE(1)=-1THEN180
175 GOSUB650
180 GOSUB500
185 IF MOVE(3)=0ANDNT<1THEN1500
190 GOSUB550
195 IFMOVE(0)=0THENC1=0:ERA0
197 IFMOVE(1)=0THENC2=0:ERA1
198 IFMOVE(2)=0THENERA2
199 GOTO100
500 IFP1=0THENY1=Y1+3:GOTO503
501 Y1=Y1-3:GOTO505
503 IFY1>107THENP1=1:Y1=107:GOTO510
505 IFY1<45THENP1=0:Y1=45:GOTO510
510 SPRITE0,X1,Y1:SPRITE1,X1,Y1+27:SPRITE2,X1,Y1+54:RETURN
550 IFP2=0THENY2=Y2+3:GOTO553
551 Y2=Y2-3:GOTO555
553 IFY2>107THENP2=1:Y2=107:GOTO560
555 IFY2<45THENP2=0:Y2=45:GOTO560
560 SPRITE3,X2,Y2:SPRITE4,X2,Y2+27:SPRITE5,X2,Y2+54:RETURN
600 YP=RND(60)+50:POSITION0,20,YP:MOVE0:PLAY"O3G0C":RETURN
650 YP=RND(60)+50:POSITION1,220,YP:MOVE1:PLAY"O3C0G":RETURN
850 T1=1:POSITION3,TX,TY:MOVE3:RETURN
900 POSITION2,XPOS(0),YPOS(0):ERA0,3:TE=TE+100:MOVE2:T1=0
905 PLAY"O4C0GCGCG"
910 IFMOVE(2)THEN910
912 LOCATE 8,0:PRINTTE;" "
915 POSITION3,120,160:ERA2,3:RETURN
950 POSITION2,XPOS(1),YPOS(1):ERA1,3:TE=TE+50:MOVE2:T1=0
955 PLAY"O4C0GCGCG"
960 IFMOVE(2)THEN960
962 LOCATE 8,0:PRINTTE;" "
965 POSITION3,120,160:ERA2,3:RETURN
1500 PAUSE30:CLS:SPRITEOFF:LOCATE5,6:PRINT"アナタ ノ テンスウ ハ"
1510 LOCATE 10,8:PRINTTE;" テンデス"
1520 LOCATE 5,12:PRINT"ゲ-ム ヲ ツヅケマスカ ?  Y/N"
1530 A$=INKEY$:IF A$=" "THEN1530
1540 IF A$="N" THEN END
1550 IF A$="Y" RUN
1560 GOTO 1530
2000 DATA9,3,1,60,0,0,8,7,1,60,0,0,10,2,1,8,0,0,12,1,1,56,0,0

[close]




Game 4:
スターシップ (Starship)

Another slide and shoot!  You control Mario along the bottom, running left and right and shooting upward.  The enemy ships appear from the middle of the shape in the middle of the screen.  At times, they appear to fly along the paths drawn in the background, but at other times they do not.  The game itself is decent at best, but the code does show off a good way to define enemy attack patterns in games like these.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGEN2:CGSET,0:SPRITEON:VIEW
15 Y=0:TE=0:NM=2:J=0
20 DEFMOVE(0)=SPRITE(0,3,1,3,0,0):POSITION0,20,200:MOVE0
30 LOCATE 25,0:PRINTNM
100 S=STICK(0):T=STRIG(0)
110 IF MOVE(0)=0 ONS GOSUB 200,220
130 IF MOVE(2)=0 AND T=8 GOSUB250
140 IF MOVE(1)=0 AND Y=0 GOSUB 400
150 IF MOVE(1)=0 AND Y=1 GOSUB 450
155 IF MOVE(3)=0 AND J=1 THEN J=0:ERA 3
160 IF J=0 GOSUB500
170 GOSUB550
199 GOTO100
200 IFXPOS(0)>228 RETURN
210 DEFMOVE(0)=SPRITE(0,3,1,2):MOVE0:RETURN
220 IF XPOS(0)<20 RETURN
230 DEFMOVE(0)=SPRITE(0,7,1,2):MOVE0:RETURN
250 DEFMOVE(2)=SPRITE(12,1,1,100,0,0):POSITION2,XPOS(0)+8,YPOS(0):MOVE2:RETURN
400 Z=RND(8)+1:IF F=Z THEN 400
410 Y=1:F=Z:ON Z RESTORE 2000,2010,2020,2030,2040,2050,2060,2070
420 READA,B,C,D
430 DEFMOVE(1)=SPRITE(9,A,1,B,1,1):POSITION1,C,D:MOVE1:RETURN
450 READ A,B
460 IF A=999 THEN Y=0:RETURN
470 DEFMOVE(1)=SPRITE(9,A,1,B,0):MOVE1:RETURN
500 IF XPOS(1)-16<XPOS(0) AND XPOS(0)<XPOS(1)+16 AND YPOS(1)-16<YPOS(0) AND YPOS(0)<YPOS(1)+16 THEN 520
510 RETURN
520 ERA0:DEFMOVE(0)=SPRITE(10,1,1,30):POSITION0,XPOS(0),YPOS(0):MOVE0:PLAY"O4C0GCGCGC":NM=NM-1:J=1
525 IF MOVE(1) THEN 525
530 IF NM<0 THEN 1500
549 RETURN 20
550 IF XPOS(1)<XPOS(2) AND XPOS(1)+10>XPOS(2) AND YPOS(1)<YPOS(2)+2 AND YPOS(1)+14>YPOS(2) THEN 570
560 RETURN
570 ERA2:POSITION2,250,250:DEFMOVE(1)=SPRITE(10,1,1,10):MOVE1:PLAY"O4C0DEFGAB":TE=TE+10:LOCATE 8,0:PRINTTE;" ":Y=0:J=0:RETURN
1500 CLS:SPRITEOFF:LOCATE10,10:PRINT" トクテン  ";TE
1510 LOCATE 8,18:PRINT"モウイチド シマスカ Y/N"
1520 A$=INKEY$:IF A$=""THEN1520
1530 IF A$="N" THEN END
1540 RUN
2000 DATA 8,10,81,67,7,8,6,8,5,6,4,1,3,1,2,1,1,1,8,1,7,4,6,2,5,40,4,12,3,30,4,15,5,20,999
2010 DATA 1,10,159,67,3,8,4,8,5,6,6,1,7,1,8,1,1,1,2,1,3,4,4,2,5,40,6,12,7,30,6,15,5,20,999
2020 DATA 1,20,127,67,3,15,4,1,5,1,6,1,7,1,8,1,1,1,3,6,4,2,5,25,4,8,3,1,2,1,1,1,8,1,7,1,6,1,5,30,6,16,7,20,5,20,999
2030 DATA 1,20,111,67,7,35,6,1,5,1,4,1,3,1,2,1,1,1,7,1,6,1,5,25,6,8,7,1,8,1,1,1,2,1,3,1,4,1,5,30,4,16,3,75,5,24,999
2040 DATA 3,10,159,95,4,2,5,20,6,2,7,50,8,1,1,1,2,1,3,1,4,1,5,45,999
2050 DATA 7,10,81,95,6,2,5,34,4,2,3,50,2,1,1,1,8,1,7,1,6,1,5,40,999
2060 DATA 5,24,121,123,4,1,3,30,2,1,1,1,8,1,7,40,6,2,5,34,999
2070 DATA 5,28,121,123,6,1,7,30,8,1,1,1,2,1,3,40,4,2,5,28,999,0

[close]




Game 5:
サンスウゴッコ (Arithmetic Fun)

Are you ready for some math!?  This game will ask you for your name, and then ask you to pick which Arithmetic function you want to work on: addition, subtraction, multiplication, or division.  It will ask you 10 questions in total, while playing an animation and some sounds depending on if you answer correctly or incorrectly.  At the end, it will display your score and play a tune if you've done well.



Files: No BG Data  Program Data

Source code:
Spoiler

10 CLS:TA$="タ シ ザ ン":HI$="ヒキ ザ ン":KA$="カ ケ ザ ン":WA$="ワリ ザ ン":X$="    10 ダイ "
20 GOSUB5000
30 CLS:LOCATE3,5:PRINT"サンスウゴッコ ノ ハジマリ デス。"
40 LOCATE3,7:PRINT"シタカラ モンダイ ヲ エランデ クダサイ"
50 LOCATE7,10:PRINTTA$;".....1"
60 LOCATE7,12:PRINTHI$;".....2"
70 LOCATE7,14:PRINTKA$;".....3"
80 LOCATE7,16:PRINTWA$;".....4"
90 INPUTA
100 CLS:S=0:M=0:ONA GOTO 1000,2000,3000,4000
1000 LOCATE6,8:PRINTTA$,X$
1010 GOSUB6000
1020 FOR I=1TO10:GOSUB5500
1050 LOCATE8,16:PRINTX;" タス";Y;" ワ ??"
1060 INPUTK
1070 IF K=X+Y THEN 1100
1080 GOSUB7000:NEXT:GOTO9000
1100 GOSUB8000
1110 NEXT:GOTO9000
2000 LOCATE6,8:PRINTHI$,X$
2010 GOSUB6000
2020 FOR I=1 TO 10
2040 GOSUB5500
2050 LOCATE 8,16:PRINTX+Y;"ヒク ";X;" ワ ??"
2060 INPUT K
2070 IF K=Y THEN 2100
2080 GOSUB7000:NEXT:GOTO9000
2100 GOSUB8000
2110 NEXT:GOTO9000
3000 LOCATE 6,8:PRINTKA$,X$
3010 GOSUB6000
3020 FOR I=1TO10
3040 GOSUB5500
3050 LOCATE8,16:PRINTX;" カケル ";C;" ワ ??"
3060 INPUT K
3070 IF K=X*C THEN 3100
3080 GOSUB7000:NEXT:GOTO9000
3100 GOSUB8000:NEXT:GOTO9000
4000 LOCATE6,8:PRINTWA$,X$
4010 GOSUB6000
4020 FOR I=1 TO 10
4040 GOSUB5500
4050 LOCATE 8,16:PRINTX*C;"ワル ";C;" ワ ??"
4060 INPUT K
4070 IF K=X THEN 4100
4080 GOSUB7000:NEXT:GOTO9000
4100 GOSUB8000:NEXT:GOTO9000
5000 LOCATE 5,5:PRINT"アナタ ノナマエ ヲ イレテクダサイ"
5010 INPUT NA$:RETURN
5500 X=RND(20)+1:Y=RND(20)+1:C=RND(7)+3
5505 IFX1=X AND Y1=Y THEN5500
5510 X1=X:Y1=Y:LOCATE5,14:PRINT"ダイ ";I;" モン":RETURN
6000 LOCATE3,10:PRINT"イイデスカ?"
6005 LOCATE3,11:PRINTNA$;" サン ガンバッテ クダサイ":PAUSE80
6010 LOCATE3,12:PRINT"ジャ-- ソロソロ イキマショウ":PAUSE50:RETURN
7000 CLS:G=10:M=M+1:GOSUB9500
7010 PRINT"ホラホラ ヨ--ク カンガエテ":RETURN
8000 CLS:G=RND(8):S=S+1:GOSUB9500
8010 LOCATE5,5:PRINT"ツギモ ガンバロ--- !!!":RETURN
9000 CLS:IF M=0 THEN LOCATE5,8:PRINT"アナタ ハ テンサイダ !!!":PLAY"O4C4O3GC:O3E4BE:O3G4DG":PAUSE200:GOTO9040
9010 LOCATE8,6:PRINT"アナタ ノ ケイサン ハ"
9020 LOCATE10,8:PRINT"10 モンチュウ "
9030 LOCATE8,10:PRINTS;"モン セイカイ シマシタ "
9040 LOCATE8,15:PRINT"ツギモ ガンバロウ !!!!!":PAUSE300:CLS
9050 GOTO30
9500 CLS:SPRITE ON:CGSET 1,0
9510 FOR N=0 TO 7
9520 DEF MOVE(N)=SPRITE(G,N+1,1,64,0,0):NEXT
9530 MOVE 0,1,2,3,4,5,6,7
9531 IF G=10THEN PLAY"O1C4ECRC3ECRC2ECRC1EC":GOTO9540
9533 PLAY"T1O4C1B1DEG1CDE1"
9540 IF MOVE(0) THEN9540
9550 SPRITE OFF:RETURN

[close]




Game 6:
バウンド ボンボン (Bound Bon-Bon)

It's Mario versus some random sprites!  The enemies bounce around at different arcs and speeds.  You control Mario.  Move him left and right to line up your shot, then press the 'A' button to throw a ... rope, I guess?  If the enemy bounces into the rope, it explodes.  Alright!  It's an interesting concept, I think (the rope attack) and could be fun to try and tweak it a bit.  The BG data makes things look a little prettier, and shows off how you can save room for more programming logic if you type all of HUD text in the BG data rather than in a series of PRINT statements.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGEN2:CGSET,0:SPRITEON:VIEW:NM=3:ID=220 DEFSPRITEI,(0,1,0,0,0)="XYZ「":BH=15
30 DEFMOVE(0)=SPRITE(0,3,1,4,0,0):POSITION0,120,167:MOVE0
35 Y1=25:C1=0:RESTORE2000
40 LOCATE8,2:PRINTTE:LOCATE20,2:PRINTNM
100 S=STICK(0):T=STRIG(0)
110 IFC1=0THENB1=B1+1:GOSUB300
120 IFC1=1THENB1=B1-1:GOSUB300
130 IFMOVE(0)=0ONS GOSUB200,230
145 IFT=8ANDX2=0GOSUB400
150 IFX2=1GOSUB450:GOSUB800
165 GOSUB750:GOTO100
200 IFXPOS(0)>215RETURN
210 DEFMOVE(0)=SPRITE(0,3,1,3):MOVE0:RETURN
230 IFXPOS(0)<25RETURN
240 DEFMOVE(0)=SPRITE(0,7,1,3):MOVE0:RETURN
300 IFB1=BH THENC1=1:GOTO310
305 IFB1=1THENC1=0
310 B0=B1:GOSUB600
320 IFY1>214THENW1=1:GOTO325
322 IFY1<25THENW1=-1
325 IFW1=1THENY1=Y1-ID:GOTO340
330 Y1=Y1+ID
340 IFBH=15THENSPRITE0,Y1,A:A1=A
342 IFBH=10THENSPRITE0,Y1,B:A1=B
344 IFBH=5THENSPRITE0,Y1,C:A1=C
349 RETURN
400 XX=(XPOS(0)/8)-1:X2=1:X3=17:XF=(XX*8)+20:YH=(X3*8)+32
410 LOCATEXX,X3:PRINTCHR$(211):RETURN
450 X3=X3-1:YG=(X3*8)+24:IFX3=3THEN470
460 LOCATEXX,X3:PRINTCHR$(211)
465 IFX3=3THEN470
468 RETURN
470 X2=0:FORU=17TO4STEP-1:LOCATEXX,U:PRINT" ":NEXT:RETURN
480 IF ID=10THENID=2:RETURN
490 RETURN
500 IFBH=5THENSP=SP-1:I=0:DEFSPRITE0,(0,1,0,0,0)="XYZ「":TE=TE+5:LOCATE8,2:PRINTTE;"0":PLAY"O4C1DEFG#GACDEF":GOSUB470:ID=ID+1:GOSUB480:BH=15:RETURN35
510 IFBH=15THENBH=10:I=0:B1=2:DEFSPRITE0,(0,1,0,0,0)="89:;":PLAY"::O3G0DAFC":GOSUB470:W1=W1*-1:RETURN
520 IFBH=10THENBH=5:I=0:B1=2:DEFSPRITE0,(0,1,0,0,0)="チツテト":PLAY"::O4G0DAFC":GOSUB470:W1=W1*-1:RETURN
600 ON B0 RESTORE2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014
610 READ A,B,C:RETURN
750 IF XPOS(0)<Y1+10 AND XPOS(0)+12>Y1+2 AND 165<A1+16 THEN770
760 RETURN
770 DEFMOVE(0)=SPRITE(10,1,1,40):MOVE0:PLAY"B0AGFEDC":PAUSE90:NM=NM-1:LOCATE20,2:PRINTNM
780 IFNM<1THEN1500
790 RETURN30
800 IFY1<XF AND Y1+16>XF AND YG<A1+12 AND YH>A1 GOSUB500
810 RETURN
1500 DEFMOVE(0)=SPRITE(10,1,1,10):MOVE0:NM=NM-1:IFNM<0THEN1800
1510 Y1=25:BH=15:GOTO30
1800 CLS:SPRITEOFF:LOCATE5,10:PRINT"GAME OVER!!!"
2000 DATA50,100,130
2001 DATA51,101,132
2002 DATA53,104,138
2003 DATA56,109,150
2004 DATA60,115,167
2005 DATA65,122,0
2006 DATA71,132,0
2007 DATA78,143,0
2008 DATA86,155,0
2009 DATA95,167,0
2010 DATA105,0,0
2011 DATA116,0,0
2012 DATA130,0,0
2013 DATA150,0,0
2014 DATA167,0,0

[close]




Game 7:
ダイマジン アタック (Daimajin Attack)

This is a Breakout clone that has you bouncing a ball off of a paddle in order to break bricks laid out above you.  The animation is pretty choppy and the logic for bouncing the ball off of the bricks seems a bit flawed, but it is, overall, a pretty impressive program.  The data listed at the end of the program correlates with the BG graphics.  You could make custom levels (1 = brick, 0 = no brick) if you really felt like it.  I haven't looked over the code too much, but I wonder how hard it would be to not need all of the data at the end and instead rely upon only the BG graphics.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGSET,0:SPRITEON:CGEN3:NT=5:DIM C(13,15)
30 DEFSPRITE0,(0,1,0,1,0)=CHR$(227)+CHR$(227)+CHR$(32)+CHR$(32)
38 RESTORE2000:FORI1=3TO14:FORI=3TO13:READA:C(I,I1)=A:NEXT:NEXT
40 VIEW:NB=105:PX=65
45 LOCATE21,12:PRINTSC;"0":LOCATE21,17:PRINTNT
50 BX=RND(12)+4:BY=18:TP=1:PT=2:SPRITE0,PX,190
100 S=STICK(0):ONS GOSUB200,220
115 LOCATE BX,BY:PRINT" ":GOSUB250
125 IFTP=1THENBX=BX-1
127 IFTP=2THENBX=BX+1
130 IFPT=1THENBY=BY+1
132 IFPT=2THENBY=BY-1
140 GOSUB330
160 IF BY<15 AND BY>1 AND BX>1 AND BX<14 GOSUB500
199 PAUSE5:GOTO100
200 IFPX>122THENPX=122:RETURN
210 PX=PX+12:SPRITE0,PX,190:RETURN
220 IFPX<32THENPX=32:RETURN
230 PX=PX-12:SPRITE0,PX,190:RETURN
250 IFBX>14THENTP=1:PLAY"G0":RETURN
260 IFBX<2THENTP=2:PLAY"G0":RETURN
270 RETURN
330 LOCATEBX,BY:PRINTCHR$(207):IFBY<3THENPT=1:PLAY"B0":RETURN
360 IFPT=1ANDBY>19GOSUB380
370 RETURN
380 T1=(BX*8)+16:IF PX<T1+12ANDPX+20>T1 THEN PT=2:PLAY"C0":RETURN
390 PLAY"O3C1B1DEG1CDE1":NT=NT-1:IFNT<1RETURN1500
395 LOCATE21,17:PRINTNT:PAUSE50:LOCATEBX,BY:PRINT" ":RETURN50
500 IFPT=1AND C(BX,BY+1)=1THENC(BX,BY+1)=0:L=BX:K=BY+1:PT=1:GOSUB600
510 IFPT=2AND C(BX,BY-1)=1THENC(BX,BY-1)=0:L=BX:K=BY-1:PT=1:GOSUB600
520 IFC(BX,BY)=1 THENC(BX,BY)=0:L=BX:K=BY:GOSUB600
530 RETURN
600 LOCATEL,K:PRINT" ":NB=NB-1:SC=SC+2:PLAY"C0":LOCATE21,12:PRINTSC;"0":IFTP=1THENTP=2:GOTO620
610 TP=1
620 IFNB=0RETURN38
630 RETURN
1500 CLS:SPRITEOFF
1510 LOCATE5,8:PRINT"イマ ノ スコア ";SC;"0"
2000 DATA 1,0,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,0,1
2001 DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
2002 DATA 1,1,0,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,1,1
2003 DATA 1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1
2004 DATA 1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0
2005 DATA 0,1,1,0,0,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0

[close]




Game 8:
マリオ シューター (Mario Shooter)

And we're back to the slide-and-shoot genre.  This one happens to be kind of fun.  You control Mario on the bottom of the screen, moving left and right.  You can fire two shots at a time (one left and one right using 'B' and 'A', respectively).  Your shots come out at a 45-degree angle and will bounce off of the walls as they move up.  The goal is to hit the current enemy as it moves down slowly from the top of the screen.  Mario has a limited number of shots, though, so aim carefully.  When you're out of shots, the game is over and your score is presented.  The gameplay is pretty smooth and it's actually pretty fun.  Once again, the game is relying on the code to determine where the walls are rather than using the BG data, so custom levels will be difficult to achieve.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGEN2:CGSET,0:SPRITEON:VIEW
20 DEFMOVE(0)=SPRITE(0,3,1,4,0,0):POSITION0,120,168:MOVE0
30 P8=0:P4=0:L=0:TE=0:TA=30
100 S=STICK(0):T=STRIG(0)
110 IFMOVE(0)=0 ONS GOSUB500,550
130 IFMOVE(1)=0 AND P8=1GOSUB650
135 IFT=8 AND P8=0 GOSUB600
140 IFMOVE(2)=0 AND P4=1GOSUB750
145 IFT=4 AND P4=0 GOSUB700
158 IFMOVE(5)=0THENL=0:GOTO165
160 IFL=1THEN170
165 GOSUB800
170 IFXPOS(5)<XPOS(1)ANDXPOS(5)+16>XPOS(1)ANDYPOS(5)<YPOS(1)ANDYPOS(5)+16>YPOS(1)GOSUB1000
180 IFXPOS(5)<XPOS(2)ANDXPOS(5)+16>XPOS(2)ANDYPOS(5)<YPOS(2)ANDYPOS(5)+16>YPOS(2)GOSUB1100
199 GOTO100
500 IFXPOS(0)>198RETURN
530 DEFMOVE(0)=SPRITE(0,3,1,2):MOVE0:RETURN
550 IFXPOS(0)<38RETURN
580 DEFMOVE(0)=SPRITE(0,7,1,2):MOVE0:RETURN
600 DEFMOVE(1)=SPRITE(12,2,1,4,0,0):POSITION1,XPOS(0)+8,YPOS(0):MOVE1:P8=1:P1=1:TA=TA-1
610 LOCATE23,0:PRINTTA;" ":RETURN
650 IFYPOS(1)<40THEN P8=0:ERA1:POSITION1,120,168:RETURN140
651 D2=XPOS(1)/8-2:A2=-(D2=0)-(D2=8)-(D2=18)-(D2=26)
652 IF A2=1 AND P1=0 THEN P1=1:GOTO665
653 IF A2=1 AND P1=1 THEN P1=O:GOTO672
654 IFP1=1THEN665
655 GOTO672
665 DEFMOVE(1)=SPRITE(12,2,1,3):MOVE1:RETURN140
672 DEFMOVE(1)=SPRITE(12,8,1,3):MOVE1:RETURN140
700 DEFMOVE(2)=SPRITE(12,8,1,2,0,0):POSITION2,XPOS(0),YPOS(0):MOVE2:P4=1:P2=0:TA=TA-1
710 LOCATE23,0:PRINTTA;" ":RETURN
750 IFYPOS(2)<40THENP4=0:ERA2:E2=0:POSITION2,120,168:RETURN
751 D1=XPOS(2)/8-2:A=-(D1=0)-(D1=8)-(D1=18)-(D1=26)
752 IF A=1 AND P2=1 THEN P2=0:GOTO765
753 IF A=1 AND P2=0 THEN P2=1:GOTO772
754 IFP2=0THEN765
755 GOTO772
765 DEFMOVE(2)=SPRITE(12,8,1,3):MOVE2:RETURN158
772 DEFMOVE(2)=SPRITE(12,2,1,3):MOVE2:RETURN158
800 X=RND(180)+24:G=RND(2)
805 IF TA<1 THEN 1500
810 IFG=1THENG=2:GOTO830
820 G=5
830 DEFMOVE(5)=SPRITE(G,5,4,60,0):POSITION5,X,30:MOVE5:L=1:RETURN
1000 ERA1:P8=0:L=0:TE=TE+5:DEFMOVE(5)=SPRITE(10,1,1,8):MOVE5:PLAY"O4G0CGCGC"
1010 LOCATE8,0:PRINTTE;"0"
1020 IFTA=0THEN1500
1030 POSITION1,100,168:RETURN
1100 ERA2:P4=0:L=0:TE=TE+5:DEFMOVE(5)=SPRITE(10,1,1,8):MOVE5:PLAY"O4G0CGCGC"
1110 LOCATE8,0:PRINTTE;"0"
1120 IFTA=0THEN1500
1130 POSITION1,100,168:RETURN
1500 SPRITEOFF:CLS:LOCATE5,10:PRINT"アナタノ テンスウ ハ"
1510 LOCATE5,12:PRINTTE;"0  テン デス"

[close]




Game 9:
ピンポン1 (Ping Pong 1)

It's Pong!  This is a pretty straight-forward Pong clone.  The graphics are a lot smoother than the Breakout clone from before.  It's two-player only, and the bouncing physics are seemingly random, but it does play pretty well.



Files: BG Data  Program Data

Source code:
Spoiler

10 CGEN3:CGSET,0:SPRITEON:VIEW:PLAY"T2M1V10O3"
15 Y1=90:Y2=90:TP=1:PT=1:BX=120:BY=100:ID=0
20 DEFSPRITE0,(0,0,1,1,0)=CHR$(207)
30 FORI=1TO4:DEFSPRITEI,(0,0,1,1,0)=CHR$(226):NEXT
50 SPRITE1,20,Y1:SPRITE3,20,Y1+8:SPRITE2,228,Y2:SPRITE4,228,Y2+8
60 LOCATE1,21:PRINT"1PLAYER ";P1:LOCATE15,21:PRINT"2PLAYER  ";P2
100 S1=STICK(0):S2=STICK(1)
110 ONS1 GOSUB299,299,299,200,299,299,299,220
120 ONS2 GOSUB299,299,299,250,299,299,299,270
130 ON TP GOSUB300,350
140 ON PT GOSUB400,450
150 GOSUB480
199 GOTO 100
200 IFY1>168RETURN
210 Y1=Y1+4:SPRITE1,20,Y1:SPRITE3,20,Y1+8:RETURN
220 IFY1<32RETURN
230 Y1=Y1-4:SPRITE1,20,Y1:SPRITE3,20,Y1+8:RETURN
250 IFY2>168RETURN
260 Y2=Y2+4:SPRITE2,228,Y2:SPRITE4,228,Y2+8:RETURN
270 IFY2<32RETURN
280 Y2=Y2-4:SPRITE2,228,Y2:SPRITE4,228,Y2+8:RETURN
299 RETURN
300 IF BX<5THENTP=2:P2=P2+1::RETURN1000
310 BX=BX-6:RETURN
350 IF BX>240THENTP=1:P1=P1+1:RETURN1000
360 BX=BX+6:RETURN
400 IF BY<32THENPT=2:PLAY"A0":RETURN
410 BY=BY-ID:RETURN
450 IF BY>174THENPT=1:PLAY"A0":RETURN
460 BY=BY+ID:RETURN
480 SPRITE0,BX,BY
500 IF TP=1ANDBX<26ANDBX>20ANDBY>Y1-8ANDBY+8<Y1+22THENTP=2:ID=RND(6):PLAY"C0E":RETURN
510 IF TP=2ANDBX>220ANDBX<234ANDBY>Y2-8ANDBY+8<Y2+22THENTP=1:ID=RND(6):PLAY"B0G":RETURN
520 RETURN
1000 LOCATE1,21:PRINT"1PLAYER  ";P1:LOCATE15,21:PRINT"2PLAYER  ";P2
1010 PT=1:BX=120:BY=100:ID=0:PLAY"T1O2CDET2O3EGAC":PAUSE80
1020 IF P1=21 OR P2=21THEN1500
1030 GOTO 100
1500 CLS:SPRITE OFF
1510 IF P1>P2 THENKA=1:GOTO1530
1520 KA=2
1530 LOCATE 7,5:PRINTP1;"  タイ ";P2;" デ "
1540 LOCATE 5,8:PRINT"PLAYER";KA;" ノ カチ"
1550 LOCATE 8,12:PRINT"モウイチド シマスカ "
1560 LOCATE 6,14:PRINT"ヤメル トキ ハ N キ-"
1570 A$=INKEY$:IF A$=""THEN1570
1580 IF A$="N"THENEND
1590 RUN

[close]




Game 10:
ピンポン2 (Ping Pong 2)

It's a Pong variant!  This game plays like the previous game, but the ball is pulled downward and bounces with an arc off of the bottom of the screen, like a ping-pong ball.



Files: BG Data (same as Game 9)  Program Data

Source code:
Spoiler

10 CGEN3:CGSET,0:SPRITEON:VIEW
15 PLAY"M1V10Y2T3O4":P1=100:P2=100:Y1=25:TP=1:PT=1
20 DEFSPRITE0,(0,0,0,1,0)=CHR$(207)
25 FORI=1TO6:DEFSPRITEI,(0,0,0,1,0)=CHR$(226):NEXT
30 PALETS 0,&HF,&H30,&H26,&H12
35 RESTORE2000:Y1=100:ID=3
40 SPRITE 1,16,P1:SPRITE 2,16,P1+8:SPRITE3,16,P1+16:SPRITE4,232,P2:SPRITE5,232,P2+8:SPRITE6,232,P2+16
100 S1=STICK(0):S2=STICK(1):F1=STRIG(0):F2=STRIG(1)
105 GOSUB400
110 ONTP GOSUB300,310
120 ONPT GOSUB330,340
125 GOSUB350
130 ONS1 GOSUB299,299,299,200,299,299,299,220
140 ONS2 GOSUB299,299,299,250,299,299,299,270
150 SPRITE1,16,P1:SPRITE2,16,P1+8:SPRITE3,16,P1+16:SPRITE4,232,P2:SPRITE5,232,P2+8:SPRITE6,232,P2+16
199 GOTO100
200 IFP1>160RETURN
210 P1=P1+8:RETURN
220 IFP1<32RETURN
230 P1=P1-8:RETURN
250 IFP2>160RETURN
260 P2=P2+8:RETURN
270 IFP2<32RETURN
280 P2=P2-8:RETURN
299 RETURN
300 B1=B1+1:RETURN
310 B1=B1-1:RETURN
330 Y1=Y1+ID:RETURN
340 Y1=Y1-ID:RETURN
350 B0=B1:GOSUB600
360 IFB1=15THENTP=2:PLAY"G0":GOTO380
370 IFB1=1THENTP=1
380 SPRITE0,Y1,A:RETURN
400 IF Y1<25 AND Y1>15 AND P1-6<A+6 AND P1+28>A+2 THEN PT=1:ID=3:PLAY"C0":GOSUB495:RETURN
410 IF Y1>220 AND Y1<230 AND P2-6<A+6 AND P2+28>A+2 THEN PT=2:ID=3:PLAY"B0":GOSUB495:RETURN
420 IF Y1<10 AND PT=2 THEN T2=T2+1:PT=1:GOSUB 480:GOTO440
430 IF Y1>240 AND PT=1 THENT1=T1+1:PT=2:GOSUB 480:GOTO440
440 IF T1=21 OR T2=21 RETURN1500
450 RETURN
480 LOCATE0,22:PRINT"PLAYER1 ";T1:LOCATE14,22:PRINT"PLAYER2 ";T2
490 PLAY"O4G0FEABEGFAFECGEFC":Y1=100:ID=3:RETURN
495 IF PT=1 AND F1=8 THEN ID=ID+5:RETURN
496 IF PT=2 AND F2=8 THEN ID=ID+5:RETURN
499 RETURN
600 ONB0 RESTORE2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014
610 READA:RETURN
1500 IF T1>T2 THEN A$="PLAYER 1":TE=T1:T=T2:GOTO1520
1510 A$="PLAYER 2":TE=T2:T=T1
1520 PAUSE50:CLS:SPRITEOFF
1530 LOCATE5,5:PRINT"WINNER";A$
1540 LOCATE8,8:PRINTTE;"  タイ  ";T
1550 LOCATE5,10:PRINT"モウ イチド シマスカ  Y/N"
1560 A$=INKEY$:IFA$=""THEN1560
1570 IFA$="N"THENEND
1580 RUN
2000 DATA50
2001 DATA51
2002 DATA53
2003 DATA56
2004 DATA60
2005 DATA65
2006 DATA71
2007 DATA78
2008 DATA86
2009 DATA95
2010 DATA105
2011 DATA116
2012 DATA130
2013 DATA152
2014 DATA176

[close]

80sFREAK

Hmmm, is this file same as you uploaded yesterday? I don't remeber any background tiles, but file was loaded without error :(

I thought to start thread "Family Basic nerdy nights", but you appeared faster :)
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

P


UglyJoe

Quote from: 80sFREAK on August 13, 2012, 11:03:46 pm
Hmmm, is this file same as you uploaded yesterday? I don't remeber any background tiles, but file was loaded without error :(


The program is the same as the "side a sample" program I posted the other day (although this should be a much clearer recording).  The background tiles are loaded from a second recording.

I guess I should mention how to load the backgrounds, as I don't think it's been covered on the forums before:


  • From the BASIC prompt, type SYSTEM and press enter.

  • Choose BG GRAPHICS from the menu (option #2)

  • Once you're in the graphics editor, press the ESC key once or twice until a menu appears in the upper left.

  • Use the arrow keys to select the FILE option, and then press the space key.

  • From the save/load screen, press the L key to choose loading.

  • Press enter at the filename prompt.

  • Begin playback of the BG Data file.  You should see the filename appear after 10-15 seconds.  It will repeat the filename a couple of times as time goes on, and the screen may blink/flicker.

  • When the file is done playing back, you'll be returned to the graphics editor with the loaded graphics in place.

  • Press the ESC key once or twice to get menu to appear in the upper left, and then press the STOP key to return to the SYSTEM menu.

  • Press 1 to get back to the BASIC prompt.  You can now use the VIEW command to display your background graphics at any time.



It's probably worth pointing out, also, that these recordings are for the 2.X versions of Family Basic.  They more than likely will not work if you try to load them with V3.

80sFREAK

Ah, ok. Yesterday i tried another old trick to run machine code from Family Basic. If someone interested, i can make short "how to"
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

Frank_fjs

Thank you so much for making these available!

I will be able to learn a great deal from these sample programs.

Re the backgrounds, yeah, kind of sucks how they have to be loaded/saved separately but not a big issue once you know how it works.

80sFREAK

There is no bankswitching, so  all subroutins should be avaliable. I'm pretty sure, it's possible to load background graphics from Basic programm
I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy

UglyJoe

Quote from: 80sFREAK on August 14, 2012, 05:20:47 am
Ah, ok. Yesterday i tried another old trick to run machine code from Family Basic. If someone interested, i can make short "how to"


Definitely interested, especially if you got it to work.  Make a new thread, though :D

jpx72


UglyJoe

 :pow: BUMP :pow:

I'm on to Side B, now.  I was having some trouble getting things to record/transfer properly, but I've gotten it all taken care of.  Side B starts with a math game, and has four other interesting games following it.  Stay tuned!

80sFREAK

I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy


P

Nice job transferring this data. I hear cassette tapes noticeably decline in quality after about 30 years and Family Basic is almost 30 years now so all the data on these tapes are at risk.

Gokko means to play (like what kids are doing). So the title would probably be "Play with Arithmetics", "Make-believe Arithmetic", "Arithmetic Play" or something. Manuel can probably translate it much better.

Looking forward to see more games!  :bub:

UglyJoe

Ah, Google Translate was telling me "pretend", which didn't make sense to me.  I guess if it's usually in the context of "kids playing", or some such, I'll just stick with a loose translation of "Arithmetic Fun".  Thanks!

Game 6 is up!

80sFREAK

I don't buy, sell or trade at moment.
But my question is how hackers at that time were able to hack those games?(c)krzy