gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

c5d278cbca758001c9070bedf3c6e6f72e51733a - Matthew Ernisse - 1596999202

found led.pas, new post.

view tree

view raw

diff --git a/files/LED.PAS b/files/LED.PAS
new file mode 100755
index 0000000..e5edc9b
--- /dev/null
+++ b/files/LED.PAS
@@ -0,0 +1,195 @@
+Program CgiLights;
+Uses CRT,strnttt5;
+
+Const Address : word = $378;
+    	mver : string = '1';
+        minver : string ='0b3c';
+
+type statrec = record
+	Led1Toggled:boolean;
+	Led2Toggled:boolean;
+        Led3Toggled:boolean;
+	End;
+
+var inchar:char;
+    Status:statrec;
+    CommandProcessed: boolean;
+    tf:text;
+    counts:string;count:longint;
+
+
+Procedure IncrementCounter;
+Var
+f:text;
+Begin
+Assign(f,'count.txt');
+
+Reset(f);
+readln(f,counts);
+close(f);
+count:=str_to_int(counts);
+inc(count);
+rewrite(f);
+writeln(f,count);
+close(f);
+end;
+
+
+Procedure SetLed1(Status:boolean);
+Begin
+Case Port[Address] of
+	$00 : If Status then Port[Address]:=$01;
+        $02 : If Status then Port[Address]:=$03;
+        $04 : If Status then Port[Address]:=$05;
+        $06 : If Status then Port[Address]:=$07;
+        $01 : If Not Status Then Port[Address]:=$00;
+        $03 : If Not Status Then Port[Address]:=$02;
+        $07 : If Not Status Then Port[Address]:=$06;
+End; {case}
+End; {proc}
+
+
+Procedure SetLed2(Status:boolean);
+Begin
+Case Port[Address] of
+	$00 : If Status then Port[Address]:=$02;
+        $01 : If Status then Port[Address]:=$03;
+        $04 : If Status then Port[Address]:=$06;
+        $05 : If Status then Port[Address]:=$07;
+        $02 : If Not Status Then Port[Address]:=$00;
+        $03 : If Not Status Then Port[Address]:=$01;
+        $06 : If Not Status Then Port[Address]:=$04;
+        $07 : If Not Status Then Port[Address]:=$05;
+End; {case}
+End; {proc}
+
+
+Procedure SetLed3(Status:boolean);
+Begin
+Case Port[Address] of
+	$00 : If Status then Port[Address]:=$04;
+        $01 : If Status then Port[Address]:=$05;
+        $02 : If Status then Port[Address]:=$06;
+        $03 : If Status then Port[Address]:=$07;
+        $04 : If Not Status Then Port[Address]:=$00;
+        $05 : If Not Status Then Port[Address]:=$01;
+        $06 : If Not Status Then Port[Address]:=$02;
+        $07 : If Not Status Then Port[Address]:=$03;
+End; {case}
+End; {proc}
+
+Function GetLed1:boolean;
+Begin
+        GetLed1:=False;
+        if Port[Address]=$01 then GetLed1:=true;
+        if Port[Address]=$03 then GetLed1:=true;
+	if Port[Address]=$05 then GetLed1:=true;
+        if Port[Address]=$07 then GetLed1:=true;
+End; {proc}
+
+Function GetLed2:boolean;
+Begin
+        GetLed2:=False;
+        if Port[Address]=$02 then GetLed2:=true;
+        if Port[Address]=$03 then GetLed2:=true;
+	if Port[Address]=$06 then GetLed2:=true;
+        if Port[Address]=$07 then GetLed2:=true;
+End; {proc}
+
+Function GetLed3:boolean;
+Begin
+        GetLed3:=False;
+        if Port[Address]=$04 then GetLed3:=true;
+        if Port[Address]=$05 then GetLed3:=true;
+	if Port[Address]=$06 then GetLed3:=true;
+        if Port[Address]=$07 then GetLed3:=true;
+End; {proc}
+
+Procedure WriteWWWInterface;
+var
+f:text;
+Begin
+        Assign(f,'led.txt');
+        Rewrite(f);
+	Writeln(f,'Content-Type: text/html');
+        Writeln(f,'');
+        Writeln(f,'<HTML><HEAD><TITLE>The Amazing Led Thing</TITLE></HEAD><BODY><CENTER>');
+        Writeln(f,'<IMG SRC="/led/header.jpg" alt="[Matt''s LED Script]"><BR>');
+        Writeln(f,'<A HREF="/cgi-bin/led/led.bat?info">Information</A><BR>');
+        If CommandProcessed Then
+        	Begin
+			Writeln(f,'<TABLE BORDER=1><TD>');
+                        Writeln(f,'<B><CENTER>- - - - -Status Window- - - - -</B><BR>');
+                        If Status.Led1Toggled Then Writeln(f,'Toggled LED 1!');
+                        If Status.Led2Toggled Then Writeln(f,'Toggled LED 2!');
+			If Status.Led3Toggled Then Writeln(f,'Toggled LED 3!');
+                        Writeln(f,'</TD></TABLE><BR><HR>');
+                End;
+        Writeln(f,'Light Emitting Diode (LED) Status:<BR>');
+	If GetLed1 Then Writeln(f,'LED 1: On') Else Writeln(f,'LED 1: Off');
+        Writeln(f,'<BR>');
+        If GetLed2 Then Writeln(f,'LED 2: On') Else Writeln(f,'LED 2: Off');
+        Writeln(f,'<BR>');
+        If GetLed3 Then Writeln(f,'LED 3: On') Else Writeln(f,'LED 3: Off');
+        Writeln(f,'<BR>');
+        Writeln(f,'Control Center:<HR Width="50%">');
+        Writeln(f,'<A HREF="/cgi-bin/led/led.bat?toggle1">Toggle LED 1</A> ');
+        Writeln(f,'<A HREF="/cgi-bin/led/led.bat?toggle2">Toggle LED 2</A> ');
+        Writeln(f,'<A HREF="/cgi-bin/led/led.bat?toggle3">Toggle LED 3</A><BR>');
+        Writeln(f,'There have been '+counts+'hits.<BR><HR><I></CENTER>lights'+mver+'.'+minver+'');
+        Writeln(f,'<CENTER>This Project Is (c) 1998 <a href="mailto:selfdestruct@innocent.com">Matthew Ernisse</a>');
+	Writeln(f,' All Rights Reserved.<BR>');
+        Writeln(f,'Hosted By <a href="http://www.infinitycomputers.dyn.ml.org/">Infinity Computers Of Rochester, Ny.</A><BR>');
+        Writeln(f,'</CENTER></BODY>');
+	Close(f);
+End;
+
+Begin
+{Port[Address]:=$00;
+$00 = 1=0,2=0,3=0
+$01 = 1=1,2=0,3=0
+$02 = 1=0,2=1,3=0
+$03 = 1=1,2=1,3=0
+$04 = 1=0,2=0,3=1
+$05 = 1=1,2=0,3=1
+$06 = 1=0,2=1,3=1
+$07 = 1=1,2=1,3=1}
+        IncrementCounter;
+	Status.Led1Toggled:=false;
+        Status.Led2Toggled:=false;
+        Status.Led3Toggled:=false;
+        CommandProcessed:=false;
+	If ParamStr(1)='info' then
+        Begin
+        	assign(tf,'led.txt');
+                rewrite(tf);
+        	Writeln(tf,'Content-Type: text/html');
+                Writeln(tf,'');
+                Writeln(tf,'<HTML><HEAD><TITLE>The Led Thingy!  Info</TITLE><BODY>');
+                Writeln(tf,'This Is a Script to play with the 2 led''s plugged into my');
+                Writeln(tf,'parallel port.  Play with it.');
+        	Close(tf);
+        	Halt(0);
+        End;
+        If ParamStr(1)='toggle1' then
+        	Begin
+                        CommandProcessed:=true;
+                        Status.Led1Toggled:=true;
+                        SetLed1(Not GetLed1);
+                End;
+
+        If ParamStr(1)='toggle2' then
+        	Begin
+                        CommandProcessed:=true;
+                        Status.Led2Toggled:=true;
+                        SetLed2(Not GetLed2);
+                End;
+        If ParamStr(1)='toggle3' then
+        	Begin
+                        CommandProcessed:=true;
+                        Status.Led3Toggled:=true;
+                        SetLed3(Not GetLed3);
+                End;
+
+	WriteWWWInterface;
+End.
\ No newline at end of file
diff --git a/users/mernisse/articles/08.gmi b/users/mernisse/articles/08.gmi
new file mode 100644
index 0000000..19189ed
--- /dev/null
+++ b/users/mernisse/articles/08.gmi
@@ -0,0 +1,30 @@
+---
+Title: A little bit of digital archeology
+Date: 08/09/2020 14:53
+
+I was cleaning up one of my home directories today and ran across something
+that reminded me look into archiving some of my old software.  I have a bunch
+of stuff dating back as far as the late 1990s that never made it into any
+kind of version control and some that made it into CVS or Bazaar but never
+got pulled forward to my current git platform.  In digging around trying to
+find some of the original artifacts I came across the original source code
+for the LED gadget CGI that I talked about in the [VFD post].
+
+=> /~mernisse/01.gmi	VFD post
+
+I want to get all of this stuff eventually put somewhere for posterity, there
+is a few things that were distributed publicly on BBSes back in the day in
+here, and putting the source code out there seems like a good thing to do.
+Until I figure out how do that though, here is a copy of LED.PAS.
+
+```
+archive01@14:32:36 PASTMP >ls -la LED.PAS
+-rwxr----- 1 mernisse app_archivist 6389 May 31  1998 LED.PAS
+```
+
+=> /files/LED.PAS
+=> https://web.archive.org/web/20011019181324/http://www.omnicron.ab.ca/httpd/	OmniHTTPd (wayback)
+
+It's funny, there is a couple thousand lines of Turbo Pascal in here but I
+honestly can't remember a whole lot about the language.  Enjoy the blast from
+the past, it certainly dug up a little bit of nostalga for me.