home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #3.1
/
RBBSIABOX31.cdr
/
zzap
/
xsystat.bas
< prev
next >
Wrap
BASIC Source File
|
1984-05-27
|
4KB
|
86 lines
10 REM Program by; Crisp
20 REM refrence; "CONFIG.BAS" by; Peter G. Wohlmut
30 REM "POKEPEEK.DOC" auther unknown
40 REM ***** see "I/O ADDRESS MAP" in the technical reference manual *****
50 CLS:KEY OFF:DEF SEG:POKE &H5C,25
60 TEMP=INP(&H61)
70 REM ***** turn off keyboard and read switches
80 OUT &H61,&HC8
90 SW1=INP(&H60)
100 SW2H=(INP(&H62) AND &HF)
110 REM ***** turn keyboard back on
120 OUT &H61,TEMP
130 SW2L=(INP(&H62) AND &HF)
140 SW2=16*SW2H+SW2L
150 REM ***** draw and label switches
160 LOCATE 1,12:PRINT " SW1 SW2 "
170 LOCATE 2,12:PRINT "┌─╥─╥─╥─╥─╥─╥─╥─┐ ┌─╥─╥─╥─╥─╥─╥─╥─┐"
180 LOCATE 3,12:PRINT "│ ║ ║ ║ ║ ║ ║ ║ │on │ ║ ║ ║ ║ ║ ║ ║ │"
190 LOCATE 4,12:PRINT "│ ║ ║ ║ ║ ║ ║ ║ │ │ ║ ║ ║ ║ ║ ║ ║ │"
200 LOCATE 5,12:PRINT "└─╨─╨─╨─╨─╨─╨─╨─┘ └─╨─╨─╨─╨─╨─╨─╨─┘"
210 LOCATE 6,12:PRINT " 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 "
220 LOCATE 3,31:PRINT CHR$(24)
230 REM ***** draw switch status
240 FOR I=0 TO 7
250 IF (SW1 AND 2^I)/2^I=1 THEN 270
260 LOCATE 3,I*2+13:PRINT "▀":GOTO 280
270 LOCATE 4,I*2+13:PRINT "▄"
280 IF (SW2 AND 2^I)/2^I=1 THEN 300
290 LOCATE 3,I*2+33:PRINT "▀":GOTO 310
300 LOCATE 4,I*2+33:PRINT "▄"
310 NEXT I
320 REM ***** find status in ram
330 DEF SEG=&H40
340 REM ***** memory size
350 TOTMEM=256*PEEK(&H14)+PEEK(&H13)
360 IOMEM=256*PEEK(&H16)+PEEK(&H15)
370 REM ***** equipment flags (bits 1,8,13 not used)
380 EQUIPFLAG=256*PEEK(&H11)+PEEK(&H10)
390 SYSBRDMEM=((EQUIPFLAG AND 2^3+2^2)/2^2+1)*16
400 IF (EQUIPFLAG AND 2^0)=0 THEN DISKS=0:GOTO 420
410 DISKS=(EQUIPFLAG AND 2^7+2^6)/2^6+1
420 VI=(EQUIPFLAG AND 2^5+2^4)/2^4
430 IF VI=0 THEN VIDINIT$="No graphics card set"
440 IF VI=1 THEN VIDINIT$="40x25 Color card"
450 IF VI=2 THEN VIDINIT$="80x25 Color card"
460 IF VI=3 THEN VIDINIT$="80x25 Mono card"
470 SERIAL=(EQUIPFLAG AND 2^11+2^10+2^9)/2^9
480 IF (EQUIPFLAG AND 2^12)=2^12 THEN GAME$="YES" ELSE GAME$="NO"
490 PARALLEL=(EQUIPFLAG AND &HC000)/2^14
500 REM ***** print status from ram
510 LOCATE 8,19:PRINT "Status according to RAM":PRINT
520 PRINT "Total Memory",TOTMEM;"Kbytes";TAB(40);"Disk drives",DISKS
530 PRINT "I/O Memory",IOMEM;"Kbytes";TAB(40);"Parallel ports",PARALLEL
540 PRINT "Sys Brd Mem",SYSBRDMEM;"Kbytes";TAB(40);"Serial ports",SERIAL
550 PRINT "Video def",VIDINIT$;TAB(40);"Game adapter",GAME$
560 REM ***** find keyboard status
570 INSERTTGL=(PEEK(&H17) AND &H80)/&H80
580 CAPLCKTGL=(PEEK(&H17) AND &H40)/&H40
590 NUMLCKTGL=(PEEK(&H17) AND &H20)/&H20
600 SCRLCKTGL=(PEEK(&H17) AND &H10)/&H10
610 ALTERN=(PEEK(&H17) AND &H8)/&H8
620 CONTRL=(PEEK(&H17) AND &H4)/&H4
630 LFTSFT=(PEEK(&H17) AND &H2)/&H2
640 RGTSFT=(PEEK(&H17) AND &H1)/&H1
650 REM ***** print keyboard status
660 LOCATE 15,1
670 PRINT "Insert mode",INSERTTGL;TAB(40);"Alternate",ALTERN
680 PRINT "Caps lock",CAPLCKTGL;TAB(40);"Control",CONTRL
690 PRINT "Number lock",NUMLCKTGL;TAB(40);"Left shift",LFTSFT
700 PRINT "Scroll lock",SCRLCKTGL;TAB(40);"Right shift",RGTSFT
710 PRINT:PRINT "press ESC to end"
720 IF INKEY$=CHR$(27) THEN SYSTEM ELSE 560
730 REM ***** RS232 and Printer address's
740 FOR I=1 TO 4:J=I*2-1
750 SERIAL$(I)=HEX$(PEEK(J))+HEX$(PEEK(J-1))
760 PRINTR$(I)=HEX$(PEEK(J+8))+HEX$(PEEK(J+7))
770 NEXT I
780 REM ***** current video mode
790 CV=PEEK(&H49)
800 IF CV=0 THEN CV$="40x25 BW"
810 IF CV=1 THEN CV$="40x25 Color"
820 IF CV=2 THEN CV$="80x25 BW"
830 IF CV=3 THEN CV$="80x25 Color"
840 IF CV=4 THEN CV$="320x200 Color"
850 IF CV=5 THEN CV$="320x200 BW"