Code cleanup

This commit is contained in:
mysticbbs 2012-02-21 17:43:02 -05:00
parent 086f20cf28
commit 9929810887
1 changed files with 59 additions and 56 deletions

View File

@ -256,64 +256,67 @@ Var
Temp2 : Byte; Temp2 : Byte;
Begin Begin
Case Ch of Case Ch of
'0'..'9', ';', '?' : Code := Code + Ch; '0'..
'H', 'f' : MoveCursor; '9',
'A' : MoveUP; ';',
'B' : MoveDOWN; '?' : Code := Code + Ch;
'C' : MoveRIGHT; 'H',
'D' : MoveLEFT; 'f' : MoveCursor;
'J' : Begin 'A' : MoveUP;
{ClearScreenData;} 'B' : MoveDOWN;
ResetControlCode; 'C' : MoveRIGHT;
End; 'D' : MoveLEFT;
'K' : Begin 'J' : ResetControlCode;
Temp1 := CurX; 'K' : Begin
For Temp2 := CurX To 80 Do Temp1 := CurX;
AddChar(' ');
MoveXY (Temp1, CurY);
ResetControlCode;
End;
'h' : ResetControlCode;
'm' : Begin
While Length(Code) > 0 Do Begin
Case ParseNumber(Code) of
0 : Attr := 7;
1 : Attr := Attr OR $08;
5 : Attr := Attr OR $80;
7 : Begin
Attr := Attr AND $F7;
Attr := ((Attr AND $70) SHR 4) + ((Attr AND $7) SHL 4) + Attr AND $80;
End;
30: Attr := (Attr AND $F8) + 0;
31: Attr := (Attr AND $F8) + 4;
32: Attr := (Attr AND $F8) + 2;
33: Attr := (Attr AND $F8) + 6;
34: Attr := (Attr AND $F8) + 1;
35: Attr := (Attr AND $F8) + 5;
36: Attr := (Attr AND $F8) + 3;
37: Attr := (Attr AND $F8) + 7;
40: SetBack (0);
41: SetBack (4);
42: SetBack (2);
43: SetBack (6);
44: SetBack (1);
45: SetBack (5);
46: SetBack (3);
47: SetBack (7);
End;
End;
ResetControlCode; For Temp2 := CurX To 80 Do
End; AddChar(' ');
's' : Begin
SavedX := CurX; MoveXY (Temp1, CurY);
SavedY := CurY; ResetControlCode;
ResetControlCode; End;
End; 'h' : ResetControlCode;
'u' : Begin 'm' : Begin
MoveXY (SavedX, SavedY); While Length(Code) > 0 Do Begin
ResetControlCode; Case ParseNumber(Code) of
0 : Attr := 7;
1 : Attr := Attr OR $08;
5 : Attr := Attr OR $80;
7 : Begin
Attr := Attr AND $F7;
Attr := ((Attr AND $70) SHR 4) + ((Attr AND $7) SHL 4) + Attr AND $80;
End; End;
30: Attr := (Attr AND $F8) + 0;
31: Attr := (Attr AND $F8) + 4;
32: Attr := (Attr AND $F8) + 2;
33: Attr := (Attr AND $F8) + 6;
34: Attr := (Attr AND $F8) + 1;
35: Attr := (Attr AND $F8) + 5;
36: Attr := (Attr AND $F8) + 3;
37: Attr := (Attr AND $F8) + 7;
40: SetBack (0);
41: SetBack (4);
42: SetBack (2);
43: SetBack (6);
44: SetBack (1);
45: SetBack (5);
46: SetBack (3);
47: SetBack (7);
End;
End;
ResetControlCode;
End;
's' : Begin
SavedX := CurX;
SavedY := CurY;
ResetControlCode;
End;
'u' : Begin
MoveXY (SavedX, SavedY);
ResetControlCode;
End;
Else Else
ResetControlCode; ResetControlCode;
End; End;