-
Notifications
You must be signed in to change notification settings - Fork 0
/
basicheader.bas
146 lines (146 loc) · 6.82 KB
/
basicheader.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
10 REM ******************************
20 REM * AGON LIGHT 2 *
30 REM * BBC BASIC *
40 REM * AUTO HEADER FILE *
50 REM * BY STEVE LOVEJOY *
60 REM * ICON BY ARNOLD MESZAROS *
70 REM ******************************
80 :
90 PRINT TAB(3,4) "MODE 0 = 80x60: 16 colours (640x480) 60hz"
100 PRINT TAB(3,6) "MODE 1 = 80x60: 4 colours (640x480) 60hz"
110 PRINT TAB(3,8) "MODE 2 = 80x60: 2 colours (640x480) 60hz"
120 PRINT TAB(3,10) "MODE 3 = 80x30: 64 colours (640x240) 60hz"
130 PRINT TAB(3,12) "MODE 4 = 80x30: 16 colours (640x240) 60hz"
140 PRINT TAB(3,14) "MODE 5 = 80x30: 4 colours (640x240) 60hz"
150 PRINT TAB(3,16) "MODE 6 = 80x30: 2 colours (640x240) 60hz"
160 PRINT TAB(3,18) "MODE 7 = 40x25: 16 colours (320x240) 60hz (orig bbc teletext mode)"
170 PRINT TAB(3,20) "MODE 8 = 40x30: 64 colours (320x240) 60hz"
180 PRINT TAB(3,22) "MODE 9 = 40x30: 16 colours (320x240) 60hz"
190 PRINT TAB(3,24) "MODE 10 = 40x30: 4 colours (320x240) 60hz"
200 PRINT TAB(3,26) "MODE 11 = 40x30: 2 colours (320x240) 60hz"
210 PRINT TAB(3,28) "MODE 12 = 40X25: 64 colours (320x200) 70hz"
220 :
230 COLOUR 2
235 INPUT TAB(3,32)"PICK A SCREEN MODE"; mode%
240 INPUT TAB(3,32)"TYPE B FOR BASIC PROMPT> or M FOR MOS PROMPT* "; BorM$
250 PROC_LOAD_VARS : REM LOAD VARS.
260 PROC_LOAD_LOGO : REM LOAD UDF CHARS FOR LOGO.
270 PROC_DRAW_LOGO : REM DRAW LOGO TO SCREEN.
280 PROC_TITLE_TEXT : REM DRAW TEXT TO SCREEN.
290 PROC_DRAW_COLOUR_PALETTE : REM DRAW CURRENT PALETTE TO SCREEN.
300 PROC_READYUP : REM DRAW READY UP TEXT TO SCREEN AND SET PROMPT.
310 :
320 NEW : REM CLEAR PROGRAM FROM MEMORY.
330 REM END OF PROGRAM.
340 :
500 DEF PROC_DRAW_LOGO : REM **** DRAW_LOGO ****
510 REM DISPLAY THE LOGO LINE BY LINE.
520 REM FROM PREVIOUSLY USER DEFINED CHARS.
530 COLOUR 14: PRINT TAB(2,1);" ";CHR$(200);CHR$(201);" ";
540 COLOUR 14: PRINT TAB(2,2);" ";CHR$(202);CHR$(203);" ";
550 COLOUR 14: PRINT TAB(2,3);" ";CHR$(204);CHR$(205);CHR$(206);CHR$(207);" ";
560 COLOUR 14: PRINT TAB(2,4);CHR$(208);CHR$(209);CHR$(210);CHR$(211);CHR$(212);CHR$(213);" ";
570 COLOUR 14: PRINT TAB(2,5);CHR$(214);CHR$(215);CHR$(216);CHR$(209);CHR$(217);CHR$(218);" ";
580 COLOUR 14: PRINT TAB(2,6);CHR$(219);CHR$(220);CHR$(221);CHR$(222);CHR$(223);CHR$(224);" ";
590 COLOUR 14: PRINT TAB(2,7);CHR$(225);CHR$(226);CHR$(227);CHR$(228);CHR$(229);CHR$(230);" ";
600 COLOUR 14: PRINT TAB(2,8);CHR$(231);CHR$(232);CHR$(233);CHR$(234);CHR$(235);CHR$(236);" ";
610 ENDPROC : REM END PROC_DRAW_LOGO.
620 :
700 DEF PROC_TITLE_TEXT : REM **** TITLE_TEXT ****
710 REM DISPLAY TITLE SCREEN TEXT AND INFO LINE BY LINE.
720 PRINT TAB(10,1);"* AGON LIGHT2 with eZ80 CPU *"
730 PRINT TAB(10,3);"MODE:";M%;" (";W%;"x";H%;") COLOURS:";C%;
740 VDU 31,10,5 : REM POSITION CURSOR.
750 *VERSION : REM PRINT BBC BASIC VERSION.
760 PRINT TAB(10,7)"BASIC Bytes Free: ";F%;
770 ENDPROC : REM END PROC_TITLE_TEXT.
780 :
790 DEF PROC_DRAW_COLOUR_PALETTE : REM **** COLOUR_PALATTE ****
800 REM DISPLAY THE CURRENT COLOUR PALLETTE.
810 VDU 23,238,255,255,255,255,255,255,255,255 : REM FILLED CHAR FOR COLOUR PALLETTE.
820 :
830 VDU 31,0,10 : REM MOVE CURSOR, LOOP COLOURS, PRINT COLOURED FILLED CHAR.
840 FOR PC% = 0 TO C% -1 : REM 1ST 32 COLOURS.
850 COLOUR PC%
860 IF PC% <= 31 THEN PRINT ;CHR$(238);
870 NEXT PC%
880 :
890 IF C% >= 32 THEN VDU 10 : VDU 13 : REM MOVE CURSOR, LOOP COLOURS, PRINT COLOURED FILLED CHAR.
900 FOR PC% = 31 TO C% -1 : REM LAST 32 COLOURS.
910 COLOUR PC%
920 IF PC% > 31 THEN PRINT ;CHR$(238);
930 NEXT PC%
940 ENDPROC : REM END PROC_DRAW_COLOUR_PALETTE.
950 :
960 DEF PROC_READYUP : REM **** READYUP ****
970 REM SET COLOURS.
980 COLOUR BG%: COLOUR FG%
990 REM MOVE CURSOR DOWN AND LEFT.
1000 VDU 10 : VDU 13 : VDU 10
1010 REM SET READY PROMPT.
1020 PRINT "AGON READY."
1030 IF BorM$ = "M" OR BorM$ = "m" THEN *BYE
1040 :
1050 ENDPROC : REM END PROC_READYUP.
1060 :
1090 DEF PROC_LOAD_LOGO : REM **** INIT ****
1100 REM AGON LIGHT "Sitting Kung Fu man" LOAD LOGO CHARS.
1110 REM (second number after the (23 VDU cmd) is the char number, then the char data).
1120 VDU 23,200,7,15,31,31,31,31,31,63
1130 VDU 23,201,192,224,240,240,240,240,240,248
1140 VDU 23,202,63,63,31,15,15,15,7,7
1150 VDU 23,203,248,248,240,224,224,224,192,192
1160 VDU 23,204,0,1,7,15,31,63,127,127
1170 VDU 23,205,7,199,199,195,227,225,240,240
1180 VDU 23,206,192,195,195,135,135,15,15,31
1190 VDU 23,207,0,0,224,240,248,252,252,254
1200 VDU 23,208,0,0,1,1,3,3,7,7
1210 VDU 23,209,255,255,255,255,255,255,255,255
1220 VDU 23,210,248,248,248,240,224,225,193,195
1230 VDU 23,211,63,63,127,255,255,255,255,255
1240 VDU 23,212,255,255,255,255,255,255,223,223
1250 VDU 23,213,0,0,128,128,128,192,192,192
1260 VDU 23,214,7,7,15,15,15,15,15,31
1270 VDU 23,215,255,247,231,231,231,199,135,130
1280 VDU 23,216,199,135,135,143,15,15,31,31
1290 VDU 23,217,207,207,207,199,199,195,129,1
1300 VDU 23,218,224,224,224,240,240,240,240,240
1310 VDU 23,219,31,31,31,31,15,15,15,31
1320 VDU 23,220,128,128,128,128,129,143,135,143
1330 VDU 23,221,31,63,15,0,128,224,224,195
1340 VDU 23,222,252,240,128,0,3,7,35,243
1350 VDU 23,223,1,1,1,129,193,225,241,241
1360 VDU 23,224,240,240,240,240,240,240,240,240
1370 VDU 23,225,31,31,3,3,3,3,7,15
1380 VDU 23,226,223,255,255,255,255,255,254,254
1390 VDU 23,227,199,135,135,7,15,15,31,31
1400 VDU 23,228,241,241,241,248,248,248,248,248
1410 VDU 23,229,253,255,255,255,255,255,255,127
1420 VDU 23,230,240,248,248,224,224,224,240,248
1430 VDU 23,231,31,63,63,63,31,31,15,0
1440 VDU 23,232,254,252,252,252,248,248,224,0
1450 VDU 23,233,31,60,32,0,0,0,0,0
1460 VDU 23,234,120,28,12,12,0,0,0,0
1470 VDU 23,235,127,127,127,127,127,63,15,0
1480 VDU 23,236,248,252,252,252,252,248,240,0
1490 VDU 23,237,255,254,252,248,240,224,192,128
1500 ENDPROC : REM END PROC_LOAD_LOGO
2000 :
2010 DEF PROC_LOAD_VARS : REM **** LOAD VARS ****
2020 M% = mode%: REM SCREEN MODE.
2030 BG% = 132: REM BACKGROUND COLOUR (blue)
2040 FG% = 15: REM FOREGROUND COLOUR (white)
2050 MODE M%: COLOUR BG%: COLOUR FG%: CLS
2060 W% = FN_GETBYTE_VDP(&13): REM GET SCREEN WIDTH IN CHARS.
2070 H% = FN_GETBYTE_VDP(&14): REM GET SCREEN HEIGHT IN CHARS.
2080 C% = FN_GETBYTE_VDP(&15): REM GET NUMBER OF COLOURS.
2090 F% = HIMEM-LOMEM: REM GET FREE BASIC BYTES.
2110 ENDPROC : REM END PROC_LOAD_VARS.
2120 :
2510 DEF FN_GETBYTE_VDP(V%): A% = &A0: L%=V%: = USR(&FFF4)
2520 DEF FN_GETWORD_VDP(V%): = FN_GETBYTE_VDP(V%) +256 *FN_GETBYTE_VDP(V% +1)
2100 ENDPROC : REM END PROC_LOAD_VARS.
2110 :
2510 DEF FN_GETBYTE_VDP(V%): A%=&A0: L%=V%: =USR(&FFF4)
2520 DEF FN_GETWORD_VDP(V%): =FN_GETBYTE_VDP(V%)+256*FN_GETBYTE_VDP(V%+1)
2530 :