Alpha 19 sync

This commit is contained in:
mysticbbs 2012-09-20 13:54:12 -04:00
parent 4ba62f0a5e
commit de3aeaf8f9
5 changed files with 27 additions and 21 deletions

View File

@ -292,25 +292,17 @@ End;
Function DayOfWeek (Date: LongInt) : Byte; Function DayOfWeek (Date: LongInt) : Byte;
Var Var
Offset : Byte; DT : DateTime;
DT : DateTime; Res : LongInt;
Begin Begin
UnpackTime (Date, DT); UnpackTime (Date, DT);
If DT.Month > 2 Then Offset := 0 Else Offset := 1; If DT.Month < 3 Then
Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) + Trunc ((DT.Year - 1) / 4) - Trunc(0.75 * Trunc((DT.Year - 1) / 100) + 1)
Else
Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) - Trunc (0.4 * DT.Month + 2.3) + Trunc (DT.Year / 4) - Trunc (0.75 * Trunc (DT.Year / 100) + 1);
Result := (((3 * (DT.Year) - (7 * ((DT.Year) + ((DT.Month) + 9) DIV 12)) Result := Res MOD 7;
DIV 4 + (23 * (DT.Month)) DIV 9 + (DT.Day) + 2 + (((DT.Year) -
Offset) DIV 100 + 1) * 3 DIV 4 - 16) MOD 7));
(*
IF m < 3 THEN
F := 365 * y + d + 31 * (m - 1) + trunc ((y - 1) / 4) -
trunc (0.75 * trunc ((y - 1) / 100) + 1)
ELSE
f := 365 * y + d + 31 * (m - 1) - trunc (0.4 * m + 2.3) +
trunc (y / 4) - trunc (0.75 * trunc (y / 100) + 1);
tot := f MOD 7;
*)
End; End;
Function DaysAgo (Date: LongInt) : LongInt; Function DaysAgo (Date: LongInt) : LongInt;

View File

@ -154,7 +154,7 @@ Begin
FInBufEnd := 0; FInBufEnd := 0;
FOutBufPos := 0; FOutBufPos := 0;
FTelnetState := 0; FTelnetState := 0;
FTelnetEcho := False; FTelnetEcho := True;
FTelnetClient := False; FTelnetClient := False;
FTelnetServer := False; FTelnetServer := False;
FDisconnect := True; FDisconnect := True;
@ -395,7 +395,7 @@ Begin
End; End;
If Buf[Count] = Telnet_Echo Then If Buf[Count] = Telnet_Echo Then
FTelnetEcho := True; FTelnetEcho := False;
End; End;
End; End;
End; End;

View File

@ -5,8 +5,8 @@ Unit m_Pipe;
Interface Interface
{$IFDEF UNIX} {$IFDEF UNIX}
Uses m_Pipe_Unix; Uses m_Pipe_Disk;
Type TPipe = Class(TPipeUnix); Type TPipe = Class(TPipeDisk);
{$ENDIF} {$ENDIF}
{$IFDEF WINDOWS} {$IFDEF WINDOWS}

View File

@ -352,7 +352,9 @@ Begin
Result := Str[1]; Result := Str[1];
If Pos(' ', Str) > 0 Then If Pos(' ', Str) > 0 Then
Result := Result + Str[Succ(Pos(' ', Str))]; Result := Result + Str[Succ(Pos(' ', Str))]
Else
Result := Result + Str[2];
End; End;
Function strWrap (Var Str1, Str2: String; WrapPos: Byte) : Byte; Function strWrap (Var Str1, Str2: String; WrapPos: Byte) : Byte;

View File

@ -91,10 +91,15 @@ Var
Y : Byte; Y : Byte;
Begin Begin
Y := ParseNumber; Y := ParseNumber;
If Y = 0 Then Y := 1; If Y = 0 Then Y := 1;
X := ParseNumber; X := ParseNumber;
If X = 0 Then X := 1; If X = 0 Then X := 1;
Screen.CursorXY (X, Y); Screen.CursorXY (X, Y);
ResetState; ResetState;
End; End;
@ -201,10 +206,12 @@ Begin
'm' : Begin 'm' : Begin
If Length(Options) = 0 Then Begin If Length(Options) = 0 Then Begin
Screen.TextAttr := 7; Screen.TextAttr := 7;
ResetState; ResetState;
End Else End Else
While Length(Options) > 0 Do Begin While Length(Options) > 0 Do Begin
Temp := ParseNumber; Temp := ParseNumber;
Case Temp of Case Temp of
0 : Screen.TextAttr := 7; 0 : Screen.TextAttr := 7;
1 : Screen.TextAttr := Screen.TextAttr OR $08; 1 : Screen.TextAttr := Screen.TextAttr OR $08;
@ -219,20 +226,24 @@ Begin
47: Screen.TextAttr := (Screen.TextAttr AND $F + ColorTable[Temp]); 47: Screen.TextAttr := (Screen.TextAttr AND $F + ColorTable[Temp]);
End; End;
End; End;
ResetState; ResetState;
End; End;
'n' : Begin 'n' : Begin
If Client <> NIL Then If Client <> NIL Then
Client.WriteStr(#27 + '[' + strI2S(Screen.CursorY) + ';' + strI2S(Screen.CursorX) + 'R'); Client.WriteStr(#27 + '[' + strI2S(Screen.CursorY) + ';' + strI2S(Screen.CursorX) + 'R');
ResetState; ResetState;
End; End;
's' : Begin 's' : Begin
SavedX := Screen.CursorX; SavedX := Screen.CursorX;
SavedY := Screen.CursorY; SavedY := Screen.CursorY;
ResetState; ResetState;
End; End;
'u' : Begin 'u' : Begin
Screen.CursorXY (SavedX, SavedY); Screen.CursorXY (SavedX, SavedY);
ResetState; ResetState;
End; End;
Else Else
@ -254,6 +265,7 @@ Begin
#12 : Screen.ClearScreen; #12 : Screen.ClearScreen;
Else Else
Screen.WriteChar(Ch); Screen.WriteChar(Ch);
State := 0; State := 0;
WasValid := True; WasValid := True;
End; End;