Skip to content

Commit

Permalink
updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 2, 2001
1 parent d325f98 commit 5278e8b
Show file tree
Hide file tree
Showing 23 changed files with 634 additions and 110 deletions.
54 changes: 54 additions & 0 deletions CHANGELOG
@@ -1,3 +1,57 @@
2000-12-17 Ryan C. Gordon <icculus@lokigames.com>
* More CPU burnage: put a delay() call in the loop that prompts for
local login (yes, no, fast). This is starting to annoy me.
* Implemented sysop1() in common.pas ... since we can't check the value
of scroll lock, it now checks the existance of a file (GFILES/sysop.in).
An external program/script can set this, since we aren't in a single
tasked DOS anymore, and it shouldn't be repeated disk accesses, since
Linux should just keep the directory entry cached.
* Put initial work in place for myio.pas's savescreen() and friends. This
is probably FreePascal (and Unix?) specific code, though.
* Started fucking with socket interface. Gave up. :)

2000-12-13 Ryan C. Gordon <icculus@lokigames.com>
* Put delay(10) call in the wait for modem initialization response, to
reduce CPU burn.
* Put delay() call in getkey() (common.pas) to stop CPU chowing.
* Added check to verify that the terminal is exactly 80 chars wide and
at least 25 chars high. (mainline of bbs.pas)

2000-11-30 Ryan C. Gordon <icculus@lokigames.com>
* Put delay() call in the telegard logo animation loop on the wfc menu.
Now the logo updates a little less than three times a second, and doesn't
starve the CPU.
* Changed Makefile temporarily to only build bbs and init.

2000-11-27 Ryan C. Gordon <icculus@lokigames.com>
* More Y2K crud. This is a slow, slow process.
* mail0.pas's initbrd() was looking for capital filenames. Fixed.

2000-11-26 Ryan C. Gordon <icculus@lokigames.com>
* Changed dosansi() in common.pas to just call write() instead of a
DOS int21h service. This allows the menus that are stored in .ANS
files to show up on the local side, albeit incorrectly at this point.
* Went on a Y2K rampage. Looked for places that used two-digit years, and
started making them use 4 digits. This allowed me to remove some prior
hacks, and make the system more robust in general. It will probably
introduce a few bugs where the system is less obviously expecting a two
digit year. We'll see. Some of the more obvious places where a two-digit
year might pass through now have checks that halt() if there's a problem.
* Changed all the INT21h-based versions of date() and time(). Have I
mentioned yet that I'm astounded by the amount of cut-and-pasting in
this codebase? I don't understand why they bothered to have a "common"
unit if so much common code was just duplicated all over the place.
* Added rcgpanic() to common.pas. Made some of the programs reference this
unit if they weren't already. The checks for two-digit year strings call
rcgpanic in case of trouble...this gives me a unified place to set a
break point and backtrace in gdb...
* init.pas filled in the init user record's birthday with a hardcoded
'00/00/00'. logon2.pas checks for this to see if it's a new record.
Fixed in both places. Changed cuser.pas's cstuff::doage() to accept and
understand 4-digit years.
* sysop3.pas showuserinfo::shi1() had an output that spilled past the 80
char line limit once it was printing 4-digit years. Fixed.

2000-11-24 Ryan C. Gordon <icculus@lokigames.com>
* Aha! I think I stumbled upon the keypressed() problem. Looks like a
piece of the overlay code was still in there and causing problems.
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Expand Up @@ -31,11 +31,11 @@ endif
ifeq ($(strip $(debug)),true)
BUILDDIR := $(cpu)/Debug
PPC386FLAGS += -g # include debug symbols.
#PPC386FLAGS += -gc # generate checks for pointers.
#PPC386FLAGS += -Ct # generate stack-checking code.
#PPC386FLAGS += -Cr # generate range-checking code.
#PPC386FLAGS += -Co # generate overflow-checking code.
#PPC386FLAGS += -Ci # generate I/O-checking code.
PPC386FLAGS += -gc # generate checks for pointers.
PPC386FLAGS += -Ct # generate stack-checking code.
PPC386FLAGS += -Cr # generate range-checking code.
PPC386FLAGS += -Co # generate overflow-checking code.
PPC386FLAGS += -Ci # generate I/O-checking code.
else
BUILDDIR := $(cpu)/Release
PPC386FLAGS += -Xs # strip the binary.
Expand Down Expand Up @@ -70,10 +70,10 @@ PPC386FLAGS += -Sg
#PPC386FLAGS += -Sm

# Assembly statements are Intel-like (instead of AT&T-like).
#PPC386FLAGS += -Rintel
PPC386FLAGS += -Rintel

# Output target Linux. !!! FIXME: Want win32 compiles?
#PPC386FLAGS += -TLINUX
PPC386FLAGS += -TLINUX

# Pipe output to assembler, rather than to temp file. This is a little faster.
#PPC386FLAGS += -P
Expand Down Expand Up @@ -107,7 +107,8 @@ SPDATEEXE=$(BUILDDIR)/spdate
$(BUILDDIR)/%.o : %.pas
$(PPC386) $(PPC386FLAGS) $<

all: $(BUILDDIR) $(MAINEXE) $(MINITERMEXE) $(INITEXE) $(TPAGEEXE) $(IFLEXE) \
all: $(BUILDDIR) $(MAINEXE) $(INITEXE) #\
$(MINITERMEXE) $(TPAGEEXE) $(IFLEXE) \
$(FINDITEXE) $(OBLITEXE) $(MTESTEXE) $(BBEXE) $(CBBSEXE) \
$(MABSEXE) $(COCONFIGEXE) $(SPDATEEXE) $(T2TEXE)

Expand Down
13 changes: 11 additions & 2 deletions TODO
@@ -1,6 +1,15 @@
- grep -i "DOS" *
- rm sources ; cvs remove sources ; cvs commit -m "not needed" sources
- cvs add TODO ; cvs commit -m "initial add." TODO
- Look for calls to bslash() and isul().
- Looks for DOSisms in ifl.pas.
- Look at rec25.pas, and check for filename storage of only 8 bytes in the
various records. Make it a full 255-character string at least.
- Looks like we've got some record clash. Hunt it out.
- Mail crashes. Record problems?
- ANSI code issues with write()
- Savescreen(), etc.
- wfc broken in xterm.
- More y2k shit
- modem/telnet support.

// end of TODO ...

20 changes: 16 additions & 4 deletions bb.pas
Expand Up @@ -5,7 +5,7 @@

uses
crt,dos,
myio;
myio, common;

{$I func.pas}

Expand Down Expand Up @@ -52,6 +52,8 @@ function substall(src,old,_new:string):string;
end;

function sdat(dt:datetime):string;
{rcg11272000 my add.}
var yearstr:string;

function tch(i:integer):string;
var s:string;
Expand All @@ -63,15 +65,25 @@ function sdat(dt:datetime):string;
end;

begin
with dt do
sdat:=tch(month)+'/'+tch(day)+'/'+tch(year-1900)+' '+tch(hour)+':'+tch(min)+':'+tch(sec);
with dt do begin
{rcg11272000 y2k stuff.}
{sdat:=tch(month)+'/'+tch(day)+'/'+tch(year-1900)+' '+tch(hour)+':'+tch(min)+':'+tch(sec);}
str(year,yearstr);
sdat:=tch(month)+'/'+tch(day)+'/'+yearstr+' '+tch(hour)+':'+tch(min)+':'+tch(sec);
end;
end;

procedure unsdat(s:string; var dt:datetime);
var x:integer;
begin

{rcg11272000 my add...}
if (length(s) < 10) then rcgpanic('WHOA! TWO DIGIT YEAR IN DATE!');

with dt do begin
val(copy(s,7,2),year,x); inc(year,1900);
{rcg11272000 Y2K-proofing.}
{val(copy(s,7,2),year,x); inc(year,1900);}
val(copy(s,7,4),year,x);
val(copy(s,1,2),month,x);
val(copy(s,4,2),day,x);
val(copy(s,10,2),hour,x);
Expand Down
19 changes: 19 additions & 0 deletions bbs.pas
Expand Up @@ -212,6 +212,25 @@
close(systatf);
end;


{rcg12132000 added checks. Friggin' Xterms... :) }
if (ScreenWidth <> 80) then
begin
writeln;
writeln('Your terminal needs to be exactly 80 characters wide to run the BBS.');
writeln(' If this is a window, please resize it.');
halt(254);
end;

if ((ScreenHeight < 25) or (ScreenHeight > 50)) then
begin
writeln;
writeln('Your terminal must be between 25 and 50 characters high to run the BBS.');
writeln(' If this is a window, please resize it.');
halt(254);
end;


{rcg11172000 No overlay on Linux.}
{
ovrinit('bbs.OVR');
Expand Down
53 changes: 47 additions & 6 deletions cbbs.pas
@@ -1,4 +1,4 @@
uses dos;
uses dos, common;

var f:text;

Expand Down Expand Up @@ -28,6 +28,9 @@ function value(s:string):integer;
if s='' then value:=0;
end;

{rcg11272000 dunno if this is even used, but it won't fly under Linux.}
{ below is a working implementation.}
{
function time:string;
var r:registers;
h,m,s:string[4];
Expand All @@ -36,7 +39,20 @@ function time:string;
str(r.cx shr 8,h); str(r.cx mod 256,m); str(r.dx shr 8,s);
time:=tch(h)+':'+tch(m)+':'+tch(s);
end;
}

function time:string;
var h,m,s:string[3];
hh,mm,ss,ss100:word;
begin
gettime(hh,mm,ss,ss100);
str(hh,h); str(mm,m); str(ss,s);
time:=tch(h)+':'+tch(m)+':'+tch(s);
end;

{rcg11272000 dunno if this is even used, but it won't fly under Linux.}
{ below is a working implementation, Y2K fixes included.}
{
function date:string;
var r:registers;
m,d,y:string[4];
Expand All @@ -45,6 +61,26 @@ function date:string;
str(r.dx shr 8,m);
date:=tch(m)+'/'+tch(d)+'/'+tch(y);
end;
}

function date:string;
var
{rcg11272000 unused variable.}
{r:registers;}

{rcg11272000 Y2K-proofing.}
{y,m,d:string[3];}
m,d:string[3];
y:string[5];
yy,mm,dd,dow:word;

begin
getdate(yy,mm,dd,dow);
{rcg11272000 Y2K-proofing.}
{str(yy-1900,y); str(mm,m); str(dd,d);}
str(yy,y); str(mm,m); str(dd,d);
date:=tch(m)+'/'+tch(d)+'/'+y;
end;

function leapyear(yr:integer):boolean;
begin
Expand Down Expand Up @@ -75,11 +111,14 @@ function daynum(dt:string):integer;
d:=value(copy(dt,4,2));

{rcg11182000 hahahaha...a Y2K bug. :) }
y:=value(copy(dt,7,2))+1900;
{rcg11272000 Let's make sure the values coming in here are four }
{digits in the first place, which should save us some hacks elsewhere...}
{y:=value(copy(dt,7,2))+1900;}

{rcg11182000 added this conditional. }
if (y < 1977) then { Ugh...this is so bad. }
y := y + 100;
{rcg11272000 my adds...}
if (length(dt) < 10) then rcgpanic('WHOA! TWO DIGIT YEAR IN DATE!');
y:=value(copy(dt,7,4));
{rcg11272000 end my adds...}

for c:=1985 to y-1 do
if leapyear(c) then t:=t+366 else t:=t+365;
Expand All @@ -102,7 +141,9 @@ function dat:string;
2:x:='Thu';
end;
y:=mon[value(copy(date,1,2))];
x:=x+' '+y+' '+copy(date,4,2)+', '+cstr(1900+value(copy(date,7,2)));
{rcg11272000 Y2K-proofing.}
{x:=x+' '+y+' '+copy(date,4,2)+', '+cstr(1900+value(copy(date,7,2)));}
x:=x+' '+y+' '+copy(date,4,2)+', '+cstr(value(copy(date,7,4)));
y:=time; i:=value(copy(y,1,2));
if i>11 then ap:='pm' else ap:='am';
if i>12 then i:=i-12;
Expand Down

0 comments on commit 5278e8b

Please sign in to comment.