diff --git "a/C:\\lazarus\\fpc\\3.2.2\\source\\packages\\rtl-console\\src\\win\\crt.pp" "b/Crt2.pas"
index dbf9d15..bb6ccfe 100644
--- "a/C:\\lazarus\\fpc\\3.2.2\\source\\packages\\rtl-console\\src\\win\\crt.pp"
+++ "b/Crt2.pas"
@@ -1,290 +1,258 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 1999-2000 by the Free Pascal development team.
+{$MODE DELPHI}
+unit Crt2;
+{ Crt unit  Free Pascal 2.2.2  {\łȂȂ̂ }
+{ Free Pascal 3.2.2punităTuZbg쐬BB             }
+{ S̎ʎqT|[głĂ͂ȂB                              }
+{ ł邾ANSIGXP[vV[PXɒuB                      }
+{ Windows ^[~ipiANSIGXP[vV[PXgjB          }
+{ 2025/9/7 쐬                                                       }
+{ 2025/9/8 ɖ֌WȏC                                         }
 
-    Borland Pascal 7 Compatible CRT Unit - win32 implementation
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
+interface
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+Const
+{ CRT modes } //gpȂ
+  BW40          = 0;            { 40x25 B/W on Color Adapter }
+  CO40          = 1;            { 40x25 Color on Color Adapter }
+  BW80          = 2;            { 80x25 B/W on Color Adapter }
+  CO80          = 3;            { 80x25 Color on Color Adapter }
+  Mono          = 7;            { 80x25 on Monochrome Adapter }
+  Font8x8       = 256;          { Add-in for ROM font }
+
+{ Mode constants for 3.0 compatibility } //gpȂ
+  C40           = CO40;
+  C80           = CO80;
+
+{ Foreground and background color constants }
+  Black         = 0;
+  Blue          = 1;
+  Green         = 2;
+  Cyan          = 3;
+  Red           = 4;
+  Magenta       = 5;
+  Brown         = 6;
+  LightGray     = 7;
+
+{ Foreground color constants }
+  DarkGray      = 8;
+  LightBlue     = 9;
+  LightGreen    = 10;
+  LightCyan     = 11;
+  LightRed      = 12;
+  LightMagenta  = 13;
+  Yellow        = 14;
+  White         = 15;
+
+{ Add-in for blinking } //Crtjbgł삵Ȃ
+  Blink         = 128;
 
- **********************************************************************}
-unit crt;
+var
 
-interface
+{ Interface variables }
+  CheckBreak: Boolean;    { Enable Ctrl-Break } //ReferenceɎgpĂȂƏĂ
+  CheckEOF: Boolean;      { Enable Ctrl-Z } //ReferenceɎgpĂȂƏĂ
+  DirectVideo: Boolean;   { Enable direct video addressing } //ReferenceDOSpƏĂ
+  CheckSnow: Boolean;     { Enable snow filtering } //ReferenceɎgpĂȂƏĂ
+  LastMode: Word = 3;         { Current text mode } //ReferenceDOSpƏĂ
+  TextAttr: Byte = $07;         { Current text attribute } //gpȂ
+  WindMin: Word  = $0;          { Window upper left coordinates } //gpȂ
+  WindMax: Word  = $184f;          { Window lower right coordinates } //gpȂ
+  { FPC Specific for large screen support } //gpȂ
+  WindMinX : DWord;
+  WindMaxX : DWord;
+  WindMinY : DWord;
+  WindMaxY : DWord;
+
+type
+  { all crt unit coordinates are 1-based }
+  tcrtcoord = 1..255;
+
+{ Interface procedures }
+procedure AssignCrt(var F: Text); //Ή
+function KeyPressed: Boolean;
+function ReadKey: Char;
+procedure TextMode (Mode: word); //ReferenceDOSpƏĂ
+{ Window parameters not changed to tcrtcoord, because the window() procedure
+  does nothing if (x1 > x2) or (y1 > y2), and some people may set x2 or y2
+  to 0 if they don't want it to do anything (JM)
+}
+procedure Window(X1,Y1,X2,Y2: Byte); //Ή
+procedure GotoXY(X,Y: tcrtcoord);
+function WhereX: tcrtcoord;
+function WhereY: tcrtcoord;
+procedure ClrScr;
+procedure ClrEol;
+procedure InsLine;
+procedure DelLine;
+procedure TextColor(Color: Byte);
+procedure TextBackground(Color: Byte);
+procedure LowVideo; //̉
+procedure HighVideo; //őpł
+procedure NormVideo;
+procedure Delay(MS: Word);
+procedure Sound(Hz: Word); //ΉiCrtjbgł삵Ȃj
+procedure NoSound; //ΉiCrtjbgł삵Ȃj
 
-{$i crth.inc}
+{Extra Functions}
+procedure cursoron;
+procedure cursoroff;
+procedure cursorbig; //ΉiCrtjbgł삵Ȃj
 
-procedure SetSafeCPSwitching(Switching:Boolean);
-procedure SetUseACP(ACP:Boolean);
-procedure Window32(X1,Y1,X2,Y2: DWord);
+procedure SetSafeCPSwitching(Switching:Boolean); //sgp
+procedure SetUseACP(ACP:Boolean); //sgp
+procedure Window32(X1,Y1,X2,Y2: DWord); //Ή
 procedure GotoXY32(X,Y: DWord);
 function WhereX32: DWord;
 function WhereY32: DWord;
 
 implementation
 
-{$DEFINE FPC_CRT_CTRLC_TREATED_AS_KEY}
-(* Treatment of Ctrl-C as a regular key ensured during initialization (SetupConsoleInput). *)
-
-uses
-  windows;
-
-var
-    SaveCursorSize: Longint;
-    Win32Platform : Longint; // pulling in sysutils changes exception behaviour
-
-    UseACP        : Boolean; (* True means using active process codepage for
-                                console output, False means use the original
-                                setting (usually OEM codepage). *)
-    SafeCPSwitching : Boolean; (* True in combination with UseACP means that
-                                  the console codepage will be set on every
-                                  output, False means that the console codepage
-                                  will only be set on Initialization and
-                                  Finalization *)
-    OriginalConsoleOutputCP : Word;
- 
-
-{****************************************************************************
-                           Low level Routines
-****************************************************************************}
-
-function GetScreenHeight : DWord;
-var
-  ConsoleInfo: TConsoleScreenBufferinfo;
-begin
-  if (not GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), ConsoleInfo)) then begin
-{$ifdef SYSTEMDEBUG}
-    Writeln(stderr,'GetScreenHeight failed GetLastError returns ',GetLastError);
-    Halt(1);
-{$endif SYSTEMDEBUG}
-    // ts: this is really silly assumption; imho better: issue a halt
-    GetScreenHeight:=25;
-  end else
-    GetScreenHeight := ConsoleInfo.dwSize.Y;
-end; { func. GetScreenHeight }
-
-function GetScreenWidth : DWord;
-var
-  ConsoleInfo: TConsoleScreenBufferInfo;
-begin
-  if (not GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), ConsoleInfo)) then begin
-{$ifdef SYSTEMDEBUG}
-    Writeln(stderr,'GetScreenWidth failed GetLastError returns ',GetLastError);
-    Halt(1);
-{$endif SYSTEMDEBUG}
-    // ts: this is really silly assumption; imho better: issue a halt
-    GetScreenWidth:=80;
-  end else
-    GetScreenWidth := ConsoleInfo.dwSize.X;
-end; { func. GetScreenWidth }
-
-
-procedure GetScreenCursor(var x : DWord; var y : DWord);
-var
-  ConsoleInfo : TConsoleScreenBufferInfo;
-begin
-  FillChar(ConsoleInfo, SizeOf(ConsoleInfo), 0);
-  GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), ConsoleInfo);
-  X := ConsoleInfo.dwCursorPosition.X + 1;
-  Y := ConsoleInfo.dwCursorPosition.Y + 1;
-end;
-
-procedure SetScreenCursor(x,y : DWord);
-var
-  CurInfo: TCoord;
-begin
-  FillChar(Curinfo, SizeOf(Curinfo), 0);
-  CurInfo.X := X - 1;
-  CurInfo.Y := Y - 1;
-  SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), CurInfo);
-end;
-
-{****************************************************************************
-                             Public Crt Functions
-****************************************************************************}
+uses Windows, SysUtils;
 
 procedure SetSafeCPSwitching(Switching:Boolean);
 begin
-    SafeCPSwitching:=Switching;
-    if SafeCPSwitching then
-      SetConsoleOutputCP(OriginalConsoleOutputCP)  // Set Console back to Original since it will now be switched
-                                                   // every read and write
-    else
-      if UseACP then
-        SetConsoleOutputCP(GetACP);   // Set Console only once here if SafeCPSwitching is False and
-                                      // if UseACP is true
+  //sgp
 end;
 
 procedure SetUseACP(ACP:Boolean);
 begin
-    UseACP:=ACP;
-    if not(SafeCPSwitching) then
-     begin
-      if UseACP then
-        SetConsoleOutputCP(GetACP)   // Set console CP only once here if SafeCPSwitching is False and
-                                     // if UseACP is True
-      else
-        SetConsoleOutputCP(OriginalConsoleOutputCP)    // Set console back to original if UseACP is False
-     end;
+  //sgp
 end;
 
 procedure TextMode (Mode: word);
 begin
+  //ReferenceDOSpƏĂ
 end;
 
-Procedure TextColor(Color: Byte);
-{ Switch foregroundcolor }
-Begin
-  TextAttr:=(Color and $8f) or (TextAttr and $70);
-End;
+procedure TextColor(Color: Byte);
+begin
+  case Color of
+    Black:        Write(^[, '[30m');
+    Blue:         Write(^[, '[34m');
+    Green:        Write(^[, '[32m');
+    Cyan:         Write(^[, '[36m');
+    Red:          Write(^[, '[31m');
+    Magenta:      Write(^[, '[35m');
+    Brown:        Write(^[, '[38;5;94m');
+    LightGray:    Write(^[, '[1;37m');
+    DarkGray:     Write(^[, '[90m');
+    LightBlue:    Write(^[, '[94m');
+    LightGreen:   Write(^[, '[92m');
+    LightCyan:    Write(^[, '[96m');
+    LightRed:     Write(^[, '[91m');
+    LightMagenta: Write(^[, '[95m');
+    Yellow:       Write(^[, '[93m');
+    White:        Write(^[, '[97m')
+  end;
+end;
 
-Procedure TextBackground(Color: Byte);
-{ Switch backgroundcolor }
-Begin
-  TextAttr:=((Color shl 4) and ($f0 and not Blink)) or (TextAttr and ($0f OR Blink) );
-End;
+procedure TextBackground(Color: Byte);
+begin
+  case Color of
+    Black:        Write(^[, '[40m');
+    Blue:         Write(^[, '[44m');
+    Green:        Write(^[, '[42m');
+    Cyan:         Write(^[, '[46m');
+    Red:          Write(^[, '[41m');
+    Magenta:      Write(^[, '[45m');
+    Brown:        Write(^[, '[48;5;94m');
+    LightGray:    Write(^[, '[47m');
+    DarkGray:     Write(^[, '[100m');
+    LightBlue:    Write(^[, '[104m');
+    LightGreen:   Write(^[, '[102m');
+    LightCyan:    Write(^[, '[106m');
+    LightRed:     Write(^[, '[101m');
+    LightMagenta: Write(^[, '[105m');
+    Yellow:       Write(^[, '[103m');
+    White:        Write(^[, '[107m')
+  end;
+end;
 
 Procedure HighVideo;
 { Set highlighted output. }
 Begin
-  TextColor(TextAttr Or $08);
+  Write(^[, '[1m') //őpł
 End;
 
 Procedure LowVideo;
 { Set normal output }
 Begin
-  TextColor(TextAttr And $77);
+  Write(^[, '[22m') //̉
 End;
 
 Procedure NormVideo;
 { Set normal back and foregroundcolors. }
 Begin
-  TextColor(7);
-  TextBackGround(0);
+  Write(^[, '[0m')
 End;
 
 Procedure GotoXY(X: tcrtcoord; Y: tcrtcoord);
-
 begin
   GotoXY32(X,Y);
 end;
 
 Procedure GotoXY32(X: DWord; Y: DWord);
-
-{ Go to coordinates X,Y in the current window. }
 Begin
-  If (X > 0) and (X <= (WindMaxX - WindMinX + 1)) and
-    (Y > 0) and (Y <= (WindMaxY - WindMinY + 1)) Then Begin
-    Inc(X, WindMinX - 1);
-    Inc(Y, WindMinY - 1);
-    SetScreenCursor(x,y);
-  End;
+  Write(^[, '[', IntToStr(Y), ';', IntToStr(X), 'H')
 End;
 
 Procedure Window(X1, Y1, X2, Y2: Byte);
-
 begin
   Window32(X1,Y1,X2,Y2);
 end;
 
 Procedure Window32(X1, Y1, X2, Y2: DWord);
-{
-  Set screen window to the specified coordinates.
-}
 Begin
-  if (X1 > X2) or (X2 > GetScreenWidth) or
-    (Y1 > Y2) or (Y2 > GetScreenHeight) then
-    exit;
-  WindMinY := Y1;
-  WindMaxY := Y2;
-  WindMinX := X1;
-  WindMaxX := X2;
-  WindMin:=((Y1-1) Shl 8)+(X1-1);
-  WindMax:=((Y2-1) Shl 8)+(X2-1);
-  GotoXY(1, 1);
+  //Ή
 End;
 
 procedure ClrScr;
-var
-  DestCoor: TCoord;
-  numChars, x : DWord;
 begin
-  DestCoor.X := WindMinX - 1;
-  DestCoor.Y := WindMinY - 1;
-  numChars := (WindMaxX - WindMinX + 1);
-
-  repeat
-    FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), TextAttr,
-      numChars, DestCoor, x);
-    FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), #32,
-      numChars, DestCoor, x);
-    inc(DestCoor.Y);
-  until DWord(DestCoor.Y)=WindMaxY;
-
-  GotoXY(1, 1);
-end; { proc. ClrScr }
-
+  Write(^[, '[2J');
+  GotoXY(1, 1)
+end;
 
 procedure ClrEol;
-{
-  Clear from current position to end of line.
-}
-var
-  Temp: DWord;
-  CharInfo: Char;
-  Coord: TCoord;
-  X,Y: DWord;
 begin
-  GetScreenCursor(x, y);
-
-  CharInfo := #32;
-  Coord.X := X - 1;
-  Coord.Y := Y - 1;
-
-  FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), CharInfo, WindMaxX - X + 1,
-    Coord, @Temp);
-  FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), TextAttr, WindMaxX - X + 1,
-    Coord, @Temp);
+  Write(^[, '[K')
 end;
 
-Function WhereX: tcrtcoord;
-
-
+function WhereX: tcrtcoord;
 begin
   WhereX:=WhereX32 mod 256;
 end;
 
-Function WhereX32: DWord;
-{
-  Return current X-position of cursor.
-}
+function WhereX32: DWord; //Google Gemini쐬R[h
 var
-  x,y : DWord;
-Begin
-  GetScreenCursor(x, y);
-  WhereX32:= x - WindMinX +1;
-End;
-
-Function WhereY: tcrtcoord;
+  hConsoleOutput: THandle;
+  csbi: CONSOLE_SCREEN_BUFFER_INFO;
+begin
+  // Wo͂̃nh擾
+  hConsoleOutput := GetStdHandle(STD_OUTPUT_HANDLE);
+  // ʃobt@̏擾
+  GetConsoleScreenBufferInfo(hConsoleOutput, csbi);
+  // \̂J[\ʒuXW𒊏o
+  Result := csbi.dwCursorPosition.X + 1 // Windows API0x[XȂ̂1𑫂
+end;
 
+function WhereY: tcrtcoord;
 begin
   WhereY:=WhereY32 mod 256;
 end;
 
-Function WhereY32: DWord;
-{
-  Return current Y-position of cursor.
-}
+function WhereY32: DWord; //Google Gemini쐬R[h
 var
-  x, y : DWord;
-Begin
-  GetScreenCursor(x, y);
-  WhereY32:= y - WindMinY + 1;
-End;
+  hConsoleOutput: THandle;
+  csbi: CONSOLE_SCREEN_BUFFER_INFO;
+begin
+  // Wo͂̃nh擾
+  hConsoleOutput := GetStdHandle(STD_OUTPUT_HANDLE);
+  // ʃobt@̏擾
+  GetConsoleScreenBufferInfo(hConsoleOutput, csbi);
+  // \̂J[\ʒuYW𒊏o
+  Result := csbi.dwCursorPosition.Y + 1 // Windows API0x[XȂ̂1𑫂
+end;
+
 
 
 {*************************************************************************
@@ -509,579 +477,51 @@ begin
   end;
 end;
 
-{$ifndef win64}
-//----Windows 9x Sound Helper ---
-{$ASMMODE INTEL}
-function InPort(PortAddr:word): byte; assembler; stdcall;
-asm
-  mov dx,PortAddr
-  in al,dx
-end;
 
-procedure OutPort(PortAddr: word; Databyte: byte); assembler; stdcall;
-asm
-  mov al,Databyte
-  mov dx,PortAddr
-  out dx,al
-end;
-{$endif win64}
-
-//----Windows 2000/XP Sound Helper ---
-const IOCTL_BEEP_SET={CTL_CODE(FILE_DEVICE_BEEP, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)}1 shl 16;
-type TBeepSetParams=record
-  Frequency:longint;
-  Duration:longint;
-end;
-type TDefineDosDeviceFunction=function (dwFlags:DWORD; lpDeviceName:LPCSTR; lpTargetPath:LPCSTR):WINBOOL; stdcall;
-var defineDosDevice: TDefineDosDeviceFunction = nil;  //not supported on 9x
-    beeperDevice: THandle = INVALID_HANDLE_VALUE;
-{*************************************************************************
-                                   Sound
-*************************************************************************}
-
-var opt: TBeepSetParams;
-    result:longword;
-
-{*************************************************************************
-                                   Delay
-*************************************************************************}
 
 procedure Delay(MS: Word);
 begin
   Sleep(ms);
 end; { proc. Delay }
 
-
-procedure sound(hz : word);
+procedure Sound(Hz: Word);
 begin
-  if Win32Platform = VER_PLATFORM_WIN32_NT then begin
-    if beeperDevice = INVALID_HANDLE_VALUE then begin
-      if defineDosDevice = nil then begin
-        defineDosDevice:=TDefineDosDeviceFunction(GetProcAddress(GetModuleHandle('kernel32.dll'),'DefineDosDeviceA'));
-        if defineDosDevice=nil then begin
-          windows.Beep(hz,1000); //fallback
-          exit;
-        end;
-        DefineDosDevice(DDD_RAW_TARGET_PATH,'DosBeep','\Device\Beep');
-      end;
-      beeperDevice:=CreateFile('\\.\DosBeep',0,0,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
-      if beeperDevice = INVALID_HANDLE_VALUE then begin
-        windows.Beep(hz,1000); //fallback
-        exit;
-      end;
-    end;
-    opt.Frequency:=hz;
-    opt.Duration:=-1; //very long
-    DeviceIoControl(beeperDevice,IOCTL_BEEP_SET,@opt,sizeof(opt),nil,0,@result,nil);
-  end else begin
-{$ifndef win64}
-    OutPort($43,182);
-    OutPort($61,InPort($61) or 3);
-    OutPort($42,lo(1193180 div hz));
-    OutPort($42, hi(1193180 div hz));
-{$endif win64}
-  end;
+  //ΉiCrtjbgł삵Ȃj
 end;
 
-
-procedure nosound;
-var opt: TBeepSetParams;
-    result:longword;
+procedure NoSound;
 begin
-  if Win32Platform = VER_PLATFORM_WIN32_NT then begin
-    if beeperDevice = INVALID_HANDLE_VALUE then exit;
-    opt.Frequency:=0; //stop
-    opt.Duration:=0;
-    DeviceIoControl(beeperDevice,IOCTL_BEEP_SET,@opt,sizeof(opt),nil,0,@result,nil);
-  end else begin
-{$ifndef win64}
-    OutPort($43,182);
-    OutPort($61,InPort($61) and 3);
-{$endif win64}
-  end;
+  //ΉiCrtjbgł삵Ȃj
 end;
 
-
-{****************************************************************************
-                          HighLevel Crt Functions
-****************************************************************************}
-procedure removeline(y : DWord);
-var
-  ClipRect: TSmallRect;
-  SrcRect: TSmallRect;
-  DestCoor: TCoord;
-  CharInfo: TCharInfo;
+procedure DelLine;
 begin
-  CharInfo.UnicodeChar := #32;
-  CharInfo.Attributes := TextAttr;
-
-  Y := (WindMinY - 1) + (Y - 1) + 1;
-
-  SrcRect.Top := Y;
-  SrcRect.Left := WindMinX - 1;
-  SrcRect.Right := WindMaxX - 1;
-  SrcRect.Bottom := WindMaxY - 1;
-
-  DestCoor.X := WindMinX - 1;
-  DestCoor.Y := Y - 1;
-
-  ClipRect := SrcRect;
-  cliprect.top := destcoor.y;
-
-  ScrollConsoleScreenBuffer(GetStdHandle(STD_OUTPUT_HANDLE), SrcRect, ClipRect,
-    DestCoor, CharInfo);
-end; { proc. RemoveLine }
-
-
-procedure delline;
-begin
-  removeline(wherey);
-end; { proc. DelLine }
-
+  Write(^[, '[1M')
+end;
 
-procedure insline;
-var
-  ClipRect: TSmallRect;
-  SrcRect: TSmallRect;
-  DestCoor: TCoord;
-  CharInfo: TCharInfo;
-  X,Y: DWord;
+procedure InsLine;
 begin
-  GetScreenCursor(X, Y);
-
-  CharInfo.UnicodeChar := #32;
-  CharInfo.Attributes := TextAttr;
-
-  SrcRect.Top := Y - 1;
-  SrcRect.Left := WindMinX - 1;
-  SrcRect.Right := WindMaxX - 1;
-  SrcRect.Bottom := WindMaxY - 1 + 1;
-
-  DestCoor.X := WindMinX - 1;
-  DestCoor.Y := Y;
-  ClipRect := SrcRect;
-  ClipRect.Bottom := WindMaxY - 1;
-
-  ScrollConsoleScreenBuffer(GetStdHandle(STD_OUTPUT_HANDLE), SrcRect, ClipRect,
-    DestCoor, CharInfo);
-end; { proc. InsLine }
-
-
-{****************************************************************************
-                             Extra Crt Functions
-****************************************************************************}
+  Write(^[, '[1L')
+end;
 
 procedure cursoron;
-var CursorInfo: TConsoleCursorInfo;
 begin
-  GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
-  CursorInfo.dwSize := SaveCursorSize;
-  CursorInfo.bVisible := true;
-  SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
+  Write(^[, '[?25h')
 end;
 
-
 procedure cursoroff;
-var CursorInfo: TConsoleCursorInfo;
 begin
-  GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
-  CursorInfo.bVisible := false;
-  SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
+  Write(^[, '[?25l')
 end;
 
-
 procedure cursorbig;
-var CursorInfo: TConsoleCursorInfo;
-begin
-  GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
-  CursorInfo.dwSize := 93;
-  CursorInfo.bVisible := true;
-  SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
-end;
-
-
-{*****************************************************************************
-                          Read and Write routines
-*****************************************************************************}
-
-var
-  CurrX, CurrY : DWord;
-
-procedure WriteChar(c : char);
-var
-    WritePos: Coord;                       { Upper-left cell to write from }
-    numWritten : DWord;
-    WinAttr : word;
-begin
-  Case C of
-    #10 : begin
-      Inc(CurrY);
-    end;
-    #13 : begin
-      CurrX := WindMinX;
-    end; { if }
-    #08 : begin
-      if CurrX > WindMinX then Dec(CurrX);
-    end; { ^H }
-    #07 : begin
-      //MessagBeep(0);
-    end; { ^G }
-    else begin
-      WritePos.X := currX - 1;
-      WritePos.Y := currY - 1;
-
-      WriteConsoleOutputCharacter(GetStdhandle(STD_OUTPUT_HANDLE),
-        @c, 1, writePos, numWritten);
-
-      WinAttr:=TextAttr;
-      WriteConsoleOutputAttribute(GetStdhandle(STD_OUTPUT_HANDLE),
-        @WinAttr, 1, writePos, numWritten);
-
-      Inc(CurrX);
-    end; { else }
-  end; { case }
-  if CurrX > WindMaxX then begin
-    CurrX := WindMinX;
-    Inc(CurrY);
-  end; { if }
-  While CurrY > WindMaxY do begin
-    RemoveLine(1);
-    Dec(CurrY);
-  end; { while }
-end;
-
-
-procedure WriteStr(const s: string);
-var
-  WritePos: Coord; { Upper-left cell to write from }
-  numWritten : DWord;
-  WinAttr : word;
-  i: integer;
 begin
-  WritePos.X:=currX-2;
-  WritePos.Y:=currY-1;
-
-  WinAttr:=TextAttr;
-  for i:=1 to Length(s) do
-    begin
-      Inc(WritePos.X);
-      WriteConsoleOutputCharacter(GetStdhandle(STD_OUTPUT_HANDLE), @s[i], 1, writePos, numWritten);
-      WriteConsoleOutputAttribute(GetStdhandle(STD_OUTPUT_HANDLE),@WinAttr, 1, writePos, numWritten);
-      Inc(CurrX);
-      if CurrX>WindMaxX then
-        begin
-          CurrX:=WindMinX;
-          Inc(CurrY);
-          While CurrY>WindMaxY do
-            begin
-              RemoveLine(1);
-              Dec(CurrY);
-            end;
-          WritePos.X:=currX-2;
-          WritePos.Y:=currY-1;
-        end;
-    end;
+  //ΉiCrtjbgł삵Ȃj
 end;
 
-
-Procedure CrtWrite(var f : textrec);
-var
-  i : longint;
-  s : string;
-  OldConsoleOutputCP : Word;
-begin
-  if SafeCPSwitching and UseACP then    //Switch codepage on every Write.
-    begin
-      OldConsoleOutputCP:=GetConsoleOutputCP;
-      SetConsoleOutputCP(GetACP);
-    end;
-
-  GetScreenCursor(CurrX, CurrY);
-  s:='';
-  for i:=0 to f.bufpos-1 do
-    if f.buffer[i] in [#7,#8,#10,#13] then // special chars directly.
-      begin
-        if s<>'' then
-          begin
-            WriteStr(s);
- 	    s:='';
-          end;
-        WriteChar(f.buffer[i]);
-      end
-    else
-      begin
-        if length(s)=255 then
-          begin
-            WriteStr(s);
-            s:='';
-          end;
-        s:=s+f.buffer[i];
-      end;
-  if s<>'' then
-    WriteStr(s);
-  SetScreenCursor(CurrX, CurrY);
-
-  if SafeCPSwitching and UseACP then     //restore codepage on every write if set previously
-    SetConsoleOutputCP(OldConsoleOutputCP);
-
-  f.bufpos:=0;
-end;
-
-Procedure CrtRead(Var F: TextRec);
-
-  procedure BackSpace;
-  begin
-    if (f.bufpos>0) and (f.bufpos=f.bufend) then begin
-      WriteChar(#8);
-      WriteChar(' ');
-      WriteChar(#8);
-      dec(f.bufpos);
-      dec(f.bufend);
-    end;
-  end;
-
-var
-  ch : Char;
-  OldConsoleOutputCP : Word;
-begin
-  if SafeCPSwitching and UseACP then    //Switch codepage on every Read
-    begin
-      OldConsoleOutputCP:=GetConsoleOutputCP;
-      SetConsoleOutputCP(GetACP);
-    end;
-
-  GetScreenCursor(CurrX,CurrY);
-  f.bufpos:=0;
-  f.bufend:=0;
-  repeat
-    if f.bufpos>f.bufend then
-      f.bufend:=f.bufpos;
-      SetScreenCursor(CurrX,CurrY);
-      ch:=readkey;
-      case ch of
-        #0 : case readkey of
-          #71 : while f.bufpos>0 do begin
-            dec(f.bufpos);
-            WriteChar(#8);
-          end;
-          #75 : if f.bufpos>0 then begin
-            dec(f.bufpos);
-            WriteChar(#8);
-          end;
-          #77 : if f.bufpos<f.bufend then begin
-            WriteChar(f.bufptr^[f.bufpos]);
-            inc(f.bufpos);
-          end;
-          #79 : while f.bufpos<f.bufend do begin
-            WriteChar(f.bufptr^[f.bufpos]);
-            inc(f.bufpos);
-          end;
-          #28: begin                    // numpad enter
-                WriteChar(#13);
-                WriteChar(#10);
-                f.bufptr^[f.bufend]:=#13;
-                f.bufptr^[f.bufend+1]:=#10;
-                inc(f.bufend,2);
-                break;
-               end;
-          #53: begin
-                 ch:='/';
-                 if f.bufpos<f.bufsize-2 then begin
-                    f.buffer[f.bufpos]:=ch;
-                    inc(f.bufpos);
-                    WriteChar(ch);
-                 end;
-               end;
-        end;
-        ^S,
-      #8 : BackSpace;
-      ^Y,
-      #27 : begin
-        while f.bufpos<f.bufend do begin
-         WriteChar(f.bufptr^[f.bufpos]);
-         inc(f.bufpos);
-        end;
-        while f.bufend>0 do
-          BackSpace;
-      end;
-      #13 : begin
-        WriteChar(#13);
-        WriteChar(#10);
-        f.bufptr^[f.bufend]:=#13;
-        f.bufptr^[f.bufend+1]:=#10;
-        inc(f.bufend,2);
-        break;
-      end;
-      #26 : if CheckEOF then begin
-        f.bufptr^[f.bufend]:=#26;
-        inc(f.bufend);
-        break;
-      end;
-      else begin
-        if f.bufpos<f.bufsize-2 then begin
-          f.bufptr^[f.bufpos]:=ch;
-          inc(f.bufpos);
-          WriteChar(ch);
-        end;
-      end;
-      end;
-  until false;
-
-  if SafeCPSwitching and UseACP then    //Restore codepage on every Read if set previously
-    SetConsoleOutputCP(OldConsoleOutputCP);
-	
-  f.bufpos:=0;
-  SetScreenCursor(CurrX, CurrY);
-End;
-
-
-Procedure CrtReturn(Var F:TextRec);
-Begin
-end;
-
-
-Procedure CrtClose(Var F: TextRec);
-Begin
-  F.Mode:=fmClosed;
-End;
-
-
-Procedure CrtOpen(Var F: TextRec);
-Begin
-  If F.Mode=fmOutput Then begin
-    TextRec(F).InOutFunc:=@CrtWrite;
-    TextRec(F).FlushFunc:=@CrtWrite;
-  end Else begin
-    F.Mode:=fmInput;
-    TextRec(F).InOutFunc:=@CrtRead;
-    TextRec(F).FlushFunc:=@CrtReturn;
-  end;
-  TextRec(F).CloseFunc:=@CrtClose;
-End;
-
-
 procedure AssignCrt(var F: Text);
 begin
-  Assign(F,'');
-  TextRec(F).OpenFunc:=@CrtOpen;
-end;
-
-var
-  CursorInfo  : TConsoleCursorInfo;
-  ConsoleInfo : TConsoleScreenBufferinfo;
-
-procedure LoadVersionInfo;
-Var
-   versioninfo : TOSVERSIONINFO;
-begin
-  versioninfo.dwOSVersionInfoSize:=sizeof(versioninfo);
-  GetVersionEx(versioninfo);
-  Win32Platform:=versionInfo.dwPlatformId;
-end;
-
-procedure SetupConsoleInput(ihnd: THANDLE);
-var
-  Mode : DWORD;
-begin
-  GetConsoleMode(ihnd, Mode);
-  Mode:=Mode and not ENABLE_PROCESSED_INPUT;
-  SetConsoleMode(ihnd, Mode);
-end;
-
-var
-  PrevCtrlBreakHandler: TCtrlBreakHandler;
-
-
-function CrtCtrlBreakHandler (CtrlBreak: boolean): boolean;
-begin
-(* Earlier registered handlers (e.g. FreeVision) have priority. *)
-  if Assigned (PrevCtrlBreakHandler) then
-    if PrevCtrlBreakHandler (CtrlBreak) then
-      begin
-        CrtCtrlBreakHandler := true;
-        Exit;
-      end;
-(* If Ctrl-Break was pressed, either ignore it or allow default processing. *)
-  if CtrlBreak then
-    CrtCtrlBreakHandler := not (CheckBreak)
-  else (* Ctrl-C pressed *)
-{$IFDEF FPC_CRT_CTRLC_TREATED_AS_KEY}
- (* If Ctrl-C is really treated as a key, the following branch should never *)
- (* be executed, but let's stay on the safe side and ensure predictability. *)
-   CrtCtrlBreakHandler := false;
-{$ELSE FPC_CRT_CTRLC_TREATED_AS_KEY}
-    begin
-      if not (SpecialKey) and (ScanCode = 0) then
-        ScanCode := 3;
-      CrtCtrlBreakHandler := true;
-    end;
-{$ENDIF FPC_CRT_CTRLC_TREATED_AS_KEY}
+  //Ή
 end;
 
-// ts
-
-
-Initialization
-  LoadVersionInfo;
-
-
-  { Initialize the output handles }
-  LastMode := 3;
-
-  SetActiveWindow(0);
-
-  OriginalConsoleOutputCP:=GetConsoleOutputCP;  //Always save the original console codepage so it can be restored on exit.
-  UseACP:=True;  // Default to use GetACP CodePage to remain compatible with previous CRT version.
-  SafeCPSwitching:=True;  // Default to switch codepage on every read and write to remain compatible with previous CRT version.
-
-  //SetSafeCPSwitching(False); // With these defaults the code page does not need to be changed here. If SafeCPSwitching defaulted
-                               // to False and UseACP to True then SetSafeCPSwitching(False) needs to be run here.
-
-  {--------------------- Get the cursor size and such -----------------------}
-  FillChar(CursorInfo, SizeOf(CursorInfo), 00);
-  GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), CursorInfo);
-  SaveCursorSize := CursorInfo.dwSize;
-
-  {------------------ Get the current cursor position and attr --------------}
-  FillChar(ConsoleInfo, SizeOf(ConsoleInfo), 0);
-  GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), ConsoleInfo);
-
-  TextAttr := ConsoleInfo.wAttributes;
-
-  { Not required, the dos crt does also not touch the mouse }
-  {TurnMouseOff;}
-
-  WindMinX := (ConsoleInfo.srWindow.Left) + 1;
-  WindMinY := (ConsoleInfo.srWindow.Top) + 1;
-  WindMaxX := (ConsoleInfo.srWindow.Right) + 1;
-  WindMaxY := (ConsoleInfo.srWindow.Bottom) + 1;
-  WindMax:=((WindMaxY-1) Shl 8)+(WindMaxX-1);
-
-  DoingNumChars := false;
-  DoingNumCode := 0;
-
-  { Redirect the standard output }
-  AssignCrt(Output);
-  Rewrite(Output);
-  TextRec(Output).Handle:= GetStdHandle(STD_OUTPUT_HANDLE);
-
-  AssignCrt(Input);
-  Reset(Input);
-  TextRec(Input).Handle:= GetStdHandle(STD_INPUT_HANDLE);
-
-  SetupConsoleInput(TextRec(Input).Handle);
-
-  PrevCtrlBreakHandler := SysSetCtrlBreakHandler (@CrtCtrlBreakHandler);
-  if PrevCtrlBreakHandler = TCtrlBreakHandler (pointer (-1)) then
-   PrevCtrlBreakHandler := nil;
-  CheckBreak := true;
-
-finalization
-  if beeperDevice <> INVALID_HANDLE_VALUE then begin
-    nosound;
-    CloseHandle(beeperDevice);
-    DefineDosDevice(DDD_REMOVE_DEFINITION,'DosBeep','\Device\Beep');
-  end;
-  SetConsoleOutputCP(OriginalConsoleOutputCP);  //Always put the console back the way it was on start;
-                                                //useful if the program is executed from command line.
-end. { unit Crt }
+end.
