BBCBasic – ESP32VGA

Here the list of a test program for the modified BBCBasic, for the sound you need to connect a headphone or a pair of loudspeakers to the audio output of the ESP32 terminal:

10 REM SET GRAPHIC MODE
20 MODE 1
30 REM
40 REM ** POINTS **
50 FOR I = 0 TO 100
60 REM Set random pen color
70 R=RND(1)*255:G=RND(1)*255:B=RND(1)*255
80 GCOL R,G,B
90 REM Draw a pixel at random position
100 X=RND(1)*640
110 Y=RND(1)*480
120 PLOT X,Y
130 NEXT I
140 DUR = 200
150 FOR FREQ = 100 TO 2000 STEP 50
160 GOSUB 430
170 NEXT FREQ
180 FOR I=1 TO 120
190 MOVE 0,4
200 NEXT I
210 CLG
220 REM
230 REM ** LINES **
240 FOR I = 0 TO 100
250 REM Set random pen color
260 R=RND(1)*255:G=RND(1)*255:B=RND(1)*255
270 GCOL R,G,B
280 REM Draw a line
290 X1=RND(1)*640: Y1=RND(1)*480
300 X2=RND(1)*640: Y2=RND(1)*480
310 DRAW X1,Y1,X2,Y2
320 NEXT I
330 DUR = 200
340 FOR FREQ = 2000 TO 100 STEP -50
350 GOSUB 430
360 NEXT FREQ
370 FOR I=1 TO 120
380 MOVE 4,0
390 NEXT I
400 CLG
410 MODE 0
420 END
430 REM Generate a sound sine waveform (0),
440 REM frequency Hertz, duration in milliseconds, audio volume max
450 SOUND 0,FREQ,DUR,127
460 FOR I=1 TO 100:NEXT I
470 RETURN

Loading