From 3b3561fc55fe11da569117ef91fbc0c1f167a638 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 14 Nov 2024 10:13:21 -0500 Subject: Added an MS-DOS logo to output. Removed error trapping in favor of better eof checking. Added pause after output. --- gwfetch.bas | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/gwfetch.bas b/gwfetch.bas index 2a8e665..dc06adc 100644 --- a/gwfetch.bas +++ b/gwfetch.bas @@ -13,8 +13,14 @@ 270 REM CPU Detection 280 GOSUB 12000:GOSUB 12300 +500 REM Just produce an MSDOS logo for now +510 DIM LOGO$(25) +520 GOSUB 20000 + 1000 REM Output time 1001 CLS +1002 GOSUB 30100 +1003 GOSUB 3000 1010 R = 2:C=41 1020 IF LEN(COMPNAME$) = 0 THEN GOTO 1100 1030 LOCATE R,C:PRINT COMPNAME$; @@ -28,8 +34,16 @@ 1115 R = R + 1 1120 LOCATE R,C:PRINT "Memory: ";MEMFREE$;" / ";MEMTOTAL$; +1998 LOCATE ROWS, 41:PRINT "Press any key..."; +1999 WHILE LEN(INKEY$) = 0:WEND 2000 END +3000 REM Logo output +3010 FOR I = 1 TO ROWS +3020 LOCATE I, 1:PRINT LOGO$(I); +3030 NEXT I +3040 RETURN + 5000 REM Run and pipe command 5010 REM TMPFILE$ contains the file for capture 5020 REM CMD$ contains the command to run @@ -41,10 +55,9 @@ 10011 REM output: INTERP$ is the interpeter 10012 REM VERSION$ is the version 10020 OPEN TMPFILE$ FOR INPUT AS #2 -10025 ON ERROR GOTO 10040 -10030 INPUT#2, VERLINE$ -10035 IF LEN(G$) = 0 THEN GOTO 10030 ELSE GOTO 10050 -10040 RESUME 10060 +10030 IF EOF(2) THEN GOTO 10060 +10040 INPUT#2, VERLINE$ +10050 IF LEN(G$) = 0 THEN GOTO 10030 ELSE GOTO 10060 10060 CLOSE#2 10070 REM VERLINE$ now contains the first non-blank version 10080 REM output. Technically it is just the command @@ -60,18 +73,19 @@ 10180 NEXT IDX 10190 IF INTERP$ = "MS-DOS" OR INTERP$="PC-DOS" THEN INTERP$ = INTERP$ + " Command" 10200 RETURN + 11000 REM 'chkdsk' output parser 11010 REM TMPFILE$ contains the file to open 11011 REM output: MEMTOTAL$ is the total memory in bytes 11012 REM MEMFREE$ is the available memory in bytes 11020 MEMTOTAL$ = "":MEMFREE$ = "" -11025 ON ERROR GOTO 11100 11030 OPEN TMPFILE$ FOR INPUT AS #2 11040 INPUT#2, MEMLINE$ 11050 IDX = INSTR(MEMLINE$, "bytes total memory") 11060 IF IDX > 0 THEN MEMTOTAL$ = LEFT$(MEMLINE$, IDX-1):GOTO 11090 11070 IDX = INSTR(MEMLINE$, "bytes free") 11080 IF IDX > 0 THEN MEMFREE$ = LEFT$(MEMLINE$, IDX-1) +11085 IF EOF(2) THEN GOTO 11110 11090 IF LEN(MEMTOTAL$) = 0 OR LEN(MEMFREE$) = 0 THEN GOTO 11040 ELSE GOTO 11110 11100 RESUME 11110 11110 CLOSE#2 @@ -202,10 +216,49 @@ 12380 CPU$ = MFG$+" "+CPUNAME$(CPUID%) 12390 RETURN +20000 REM MS-DOS Logo +20010 LOGO$(1) = " " +20011 LOGO$(2) = " &&&&&& &&&&&& &&&&&&&&" +20012 LOGO$(3) = " &&&&&&. &&&&&&& &&&&&&&&&&&&" +20013 LOGO$(4) = " &&&&&&& &&&&&&&.&&&& &&&&" +20014 LOGO$(5) = " &&&&&&& &&&&&&&&&&&+" +20015 LOGO$(6) = " &&&&&&&; &&&&&&&& &&&&&&&&" +20016 LOGO$(7) = " &&&&&&&& &&& &&&& &&&&&&&&&&" +20017 LOGO$(8) = " &&&& &&&&&&& &&&& &&&&&&& +20018 LOGO$(9) = " &&&& &&&&&&& &&&&&&&& &&&& +20019 LOGO$(10) = " &&&& ;&&&&& &&&& &&&&+ &&&&& +20020 LOGO$(11) = " &&&& &&&&& &&&& &&&&&&&&&&&$" +20021 LOGO$(12) = " &&&&. &&&& &&&& &&&&&&" +20022 LOGO$(13) = " $$$$$$$$$$ $$$$$$$ :::::::." +20023 LOGO$(14) = " $$$$$$$$.$$$$$$$$.::::::::::::" +20024 LOGO$(15) = " $$$$ $$$$$X :::: &$$ .::::" +20025 LOGO$(16) = " $$$$ $$$$$ $$ .::: $$$$& ...." +20026 LOGO$(17) = " $$$$ $$$$;$$$$ ::::&$$$$" +20027 LOGO$(18) = " $$$$ $$$$ $$$$ ::;$$$$ ::." +20028 LOGO$(19) = " $$$$ . $$$$ $$$$ &$$$$ ::::" +20029 LOGO$(20) = " $$$$ $$$&$$$$$:::: $$$$& .::::" +20030 LOGO$(21) = " $$$$.. $$$$$$::::: $$$ ..::::" +20031 LOGO$(22) = " $$$$$$$$$$$$$$$$&::::::::::::::" +20032 LOGO$(23) = " $$$$$$$$$$$$$$$$$$..::::::::.." +20033 LOGO$(24) = " " +20034 LOGO$(25) = " " +20035 RETURN + 30000 REM String Trim Function 30010 REM input/output: TOTRIM$ +30015 IF LEN(TOTRIM$) = 0 THEN RETURN +30016 IF INSTR(TOTRIM$, " ") = 0 THEN RETURN 30020 FOR IDX = 1 TO LEN(TOTRIM$):IF MID$(TOTRIM$, IDX, 1) <> " " THEN GOTO 30030:NEXT IDX 30030 FOR RDX = LEN(TOTRIM$) TO IDX STEP -1:IF MID$(TOTRIM$, RDX, 1) <> " " THEN GOTO 30050:NEXT RDX 30040 TOTRIM$ = MID$(TOTRIM$, IDX, RDX - IDX) 30050 RETURN +30100 REM Row check +30110 REM output: ROWS - number of screen rows +30120 ON ERROR GOTO 30150 +30130 LOCATE 25,1 +30140 ROWS=25:GOTO 30170 +30150 RESUME 30160 +30160 ROWS=24 +30170 ON ERROR GOTO 0 +30180 RETURN -- cgit v1.2.3