10
20 :
30 PRINT"OSBYTE Calls"
40 A%=-1:X%=0:Xmax%=0
50 ON ERROR IF FNerr END
60 REPEAT
70 IFX%<Xmax%:X%=X%+1 ELSE A%=A%+1:PROCrange
80 PROCtest
90 UNTILA%=255
100 :
110 PRINT'"OSWORD Calls"
120 PRINT:PROC_Basic
130 END
140 :
150 DEFFNerr
160 IF ERR<128:REPORT:PRINT:END
170 VDU19,255,255,255:REPORT:PRINT
180 =0
190 :
200 DEFPROCrange
210 Xmax%=0:X%=0
220 IF A%=0:X%=1:ENDPROC
230 IF A%=1:A%=128:X%=-10:Xmax%=11:ENDPROC:
240 IF A%=129:X%=-256:Xmax%=-256:ENDPROC :
250 IF A%=136:A%=160:Xmax%=127:ENDPROC :
260 IF A%=161:Xmax%=127:ENDPROC :
270 IF A%=162:A%=164
280 IF A%>163:X%=&FF00:Xmax%=X%:ENDPROC :
290 ENDPROC
300 :
310 DEFPROCtest
320 READ A$:Y%=(X%AND&FFFF)DIV256
330 PRINT"*FX ";A%;",";X%AND&FF;",";Y%;TAB(17);"A=";FNh(A%,2);" X=&";FNh(X%,2);" Y=&";FNh(Y%,2);" ";
340 PRINTA$;SPC(26-LENA$);"Result: ";:U%=USR&FFF4
350 PRINT"&";FNh((U% AND &FFFF00)DIV256,4);:IF (U%AND&1000000):PRINT" Cy";
360 PRINT:ENDPROC
370 :
380 DEFFNd(n%):=RIGHT$(" "+STR$n%,3)
390 DEFFNh(n%,d%):=RIGHT$("0000000"+STR$~n%,d%)
400 :
410 DEFPROC_Basic
420 PRINT"BBCBASIC OS Interface"
430 ENDPROC
440 FOR A%=-10 TO 10
450 READ A$
460 PRINT"ADVAL(";A%;")=";ADVAL(A%);TAB(14);A$
470 NEXT
480 PRINT"INKEY(-256)=";INKEY-256
490 :
500 :
510 ENDPROC
520 DATA OS Version
530 DATA Mouse buffer,Speech buffer,SOUND 3 buffer,SOUND 2 buffer,SOUND 1 buffer,SOUND 0 buffer
540 DATA Printer buffer,RS232 output buffer,RS232 input buffer,Keyboard input buffer
550 DATA Last ADC Chann/Buttons,ADC Channel 1,ADC Channel 2,ADC Channel 3,ADC Channel 4
560 DATA ??,??,Mouse X,Mouse Y,??,??
570 DATA ??,INKEY,Read high address,Read OSHWM (PAGE),Read MEMTOP (HIMEM),Read MEMTOP for MODE,Read POS/VPOS
580 DATA Read MODE/CHR$
590 DATA Graph x1, (internal coords),Graph y1, (internal coords),Graph x2, (internal coords),Graph y2, (internal coords),Text x1,Text y1,Text x2,Text y2
600 DATA Graphics origin X,(external coords),Graphics origin Y,(external coords),GXPOS,(external coords),GYPOS,(external coords),Last GXPOS,(external coords),Last GYPOS,(external coords)
610 DATA POS,VPOS,POINT at gcursor,VDU queue 8/WS,VDU queue 7/WS,VDU queue 6/WS,VDU queue 5/WS,VDU queue 4,VDU queue 3,VDU queue 2,VDU queue 1,VDU queue 0
620 DATA GXPOS,(internal coords),GYPOS,(internal coords)
630 DATA Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS
640 DATA Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS,Graphics WS
650 DATA 6845 cursor address,,Text window size,,MSB of HIMEM,Bytes/char,Addr of TopLeft,,Bytes/screen row,,Screen size in pages,Current mode,Screen map
660 DATA Text foreground,Text background,Graphics foreground,Graphics background
670 DATA Graphics AND,Graphics EOR,Control code vector,,Last 6845 Start setting,Number of colours,Pixels/byte,Right pixel mask,Left pixel mask,Input cursor X,Input cursor Y
680 DATA "Ttxt char | VDU 23,16","Font flags | VDU 23,6",Font &20/&30 | Dot state,Font &40/&50 | ECF number,Font &60/&70 | ECF frgnd,Font &80/&90 | ECF bkgnd,Font &A0/&B0 | X=81?,Font &C0/&D0 | GCOL bkgnd,Font &E0/&F0 | GCOL bkgnd
690 DATA Palette 0,Palette 1,Palette 2,Palette 3,Palette 4,Palette 5,Palette 6,Palette 7,Palette 8,Palette 9,Palette 10,Palette 11,Palette 12,Palette 13,Palette 14,Palette 15,Unused
700 DATA ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
710 DATA ,,,,,,,,,,,,,,
720 DATA Addr of OS vars,,Addr of ROM pointer table,,Addr of ROM info table,,Addr of key trans table,,Addr of VDU vars,
730 DATA ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,