home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-05-25 | 3.3 KB | 87 lines |
- 10 ' M E N U . B A S 5/25/87 11:49 am
- 20 '
- 30 ' MENU provides a menu for access to Amy's First Primer. It loads
- 40 ' a picture with the menu on it, and then let's a child select the
- 50 ' desired program by moving a big blue arrow up or down with the
- 60 ' cursor keys. The name of the program is also highlighted in blue when
- 70 ' the arrow points to it. When the child presses the ENTER key, the
- 80 ' program with the arrow pointing to it will be run.
- 90 '
- 100 ' Converted for IBM-PC Screen 1
- 110 '
- 120 CLEAR ,48000 : SCREEN 1 : COLOR 0,1 : KEY OFF : CLS
- 130 LOCATE 22,12 : PRINT "AMY'S FIRST PRIMER 1.2"
- 140 LOCATE 24,1 : PRINT " copyright 1985, Computing Specialties";
- 150 '
- 160 '
- 170 ' Poke subroutine ALOAD into memory.
- 180 '
- 190 DEF SEG : ALOAD= 48000
- 200 FOR IB=0 TO 95 : READ BYTE : POKE ALOAD+IB,BYTE : NEXT IB
- 210 DATA &H55, &H8B, &HEC, &H8B, &H5E, &H0A, &H8A, &H0F, &HB5, &H00, &H8B, &H77
- 220 DATA &H01, &H8B, &H5E, &H08, &H8B, &H07, &H8E, &HC0, &HBF, &H00, &H00, &HA4
- 230 DATA &HE2, &HFD, &HB0, &H00, &HAA, &H1E, &H06, &H1F, &H07, &HB0, &H00, &HB4
- 240 DATA &H3D, &HBA, &H00, &H00, &HCD, &H21, &H72, &H24, &H8B, &HD8, &HB9, &H07
- 250 DATA &H00, &HBA, &H00, &H00, &HB4, &H3F, &HCD, &H21, &H3B, &HC1, &H74, &H05
- 260 DATA &HB8, &H0D, &H00, &H75, &H0F, &HBE, &H05, &H00, &H8B, &H0C, &HB4, &H3F
- 270 DATA &HBA, &H00, &H00, &HCD, &H21, &HB8, &H00, &H00, &H8B, &H7E, &H06, &H26
- 280 DATA &H89, &H05, &HB4, &H3E, &HCD, &H21, &H06, &H1F, &H5D, &HCA, &H06, &H00
- 290 '
- 300 ' Load the menu picture onto the screen.
- 310 '
- 320 SEG2%=&HB800 : BERR%=0 : FILE$="MENU1.PIC" : CALL ALOAD(FILE$,SEG2%,BERR%)
- 330 MYNAME$="AMY"
- 340 LOCATE 22,15-LEN(MYNAME$) : PRINT MYNAME$;
- 350 '
- 360 ' Initialize all necessary variables.
- 370 '
- 380 UP$=CHR$(0)+CHR$(72) : DN$=CHR$(0)+CHR$(80)
- 390 TITLE$(1)="ABC SONG"
- 400 TITLE$(2)="BEARY FUN LETTERS"
- 410 TITLE$(3)="BUNNY LETTERS"
- 420 TITLE$(4)="BEARY FUN COUNTING"
- 430 TITLE$(5)="HELP THE FROGGY"
- 440 TITLE$(6)="LOAD THE TRUCK"
- 450 '
- 460 ' Get the arrow into an array, then point it at the first
- 470 ' program on the menu.
- 480 '
- 490 DIM ARROW(200) : GET (6,1)-(55,28),ARROW : LINE (6,1)-(55,28),0,BF
- 500 N=1 : X=6 : Y=1 : PUT (X,Y),ARROW,XOR : ROW=3 : COL=22 : L=1
- 510 ' LOCATE ROW,COL : PRINT TITLE$(N);
- 520 WHILE INKEY$<>"" : WEND
- 530 '
- 540 ' Wait until one of the three command keys are pressed.
- 550 ' The up arrow will move the arrow up and select the previous
- 560 ' program. The down arrow will move the arrow down and select
- 570 ' the next program. The ENTER key will run the selected program.
- 580 '
- 590 K$=INKEY$ : IF K$="" THEN 590
- 600 IF K$=CHR$(13) THEN GOTO 790
- 610 IF K$=UP$ AND N>1 THEN N=N-1
- 620 IF K$=DN$ AND N<6 THEN N=N+1
- 630 '
- 640 ' Remove the arrow from the current program and place it on the
- 650 ' newly selected program. Also change the current program name
- 660 ' back to red and the new program name to blue.
- 670 '
- 680 PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(L);
- 690 Y=6+(N-1)*24 : ROW=N*3 : L=N
- 700 PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(N);
- 710 WHILE INKEY$<>"" : WEND
- 720 '
- 730 ' Go back for another key press.
- 740 '
- 750 GOTO 590
- 760 '
- 770 ' The ENTER key was pressed, execute the selected program.
- 780 '
- 790 ON N GOTO 800,810,820,830,840,850
- 800 RUN"ABC"
- 810 RUN"BEARABC"
- 820 RUN"BUNNY"
- 830 RUN"BEAR123"
- 840 RUN"FROG"
- 850 RUN"TRUCK"
- 860 END
-