Browse Source

* Char -> AnsiChar

Michael VAN CANNEYT 2 years ago
parent
commit
7559c75201
2 changed files with 20 additions and 20 deletions
  1. 6 6
      rtl/zxspectrum/sysfile.inc
  2. 14 14
      rtl/zxspectrum/system.pp

+ 6 - 6
rtl/zxspectrum/sysfile.inc

@@ -23,12 +23,12 @@ begin
 end;
 
 
-procedure do_erase(p : pchar; pchangeable: boolean);inline;
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);inline;
 begin
 end;
 
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);inline;
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);inline;
 begin
 end;
 
@@ -38,7 +38,7 @@ begin
   do_write:=len;
   while len>0 do
   begin
-    PrintChar(PChar(addr)^);
+    PrintChar(PAnsiChar(addr)^);
     Inc(addr);
     Dec(len);
   end;
@@ -47,14 +47,14 @@ end;
 
 function do_read(h:thandle;addr:pointer;len : longint) : longint;
 var
-  ch: Char;
+  ch: AnsiChar;
 begin
   do_read:=0;
   while len>0 do
   begin
     ch:=ReadKey;
     PrintChar(ch);
-    PChar(addr)^:=ch;
+    PAnsiChar(addr)^:=ch;
     Inc(addr);
     Inc(do_read);
     Dec(len);
@@ -90,7 +90,7 @@ procedure do_truncate (handle:thandle;pos:longint);inline;
 begin
 end;
 
-procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);inline;
+procedure do_open(var f;p:PAnsiChar;flags:longint; pchangeable: boolean);inline;
 {
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.

+ 14 - 14
rtl/zxspectrum/system.pp

@@ -10,7 +10,7 @@ interface
 
 {$define HAS_MEMORYMANAGER}
 
-{ Use Ansi Char for files }
+{ Use AnsiChar for files }
 {$define FPC_ANSI_TEXTFILEREC}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_STDERR_IS_ALIAS_FOR_STDOUT}
@@ -39,7 +39,7 @@ var
   OpenChannel(1) opens the lower screen
   OpenChannel(3) opens the ZX Printer }
 procedure OpenChannel(Chan: Byte);
-procedure PrintChar(Ch: Char);
+procedure PrintChar(Ch: AnsiChar);
 procedure PrintLn;
 procedure PrintShortString(const s: ShortString);
 procedure PrintHexDigit(const d: byte);
@@ -48,7 +48,7 @@ procedure PrintHexWord(const w: word);
 procedure Ink(colour: Byte);
 procedure Paper(colour: Byte);
 procedure GotoXY(X, Y: Byte);
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 function KeyPressed: Boolean;
 
 implementation
@@ -60,8 +60,8 @@ const
   DriveSeparator = ':';
   ExtensionSeparator = '.';
   PathSeparator = ';';
-  AllowDirectorySeparators : set of char = ['\','/'];
-  AllowDriveSeparators : set of char = [':'];
+  AllowDirectorySeparators : set of AnsiChar = ['\','/'];
+  AllowDriveSeparators : set of AnsiChar = [':'];
   { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
   maxExitCode = 255;
   MaxPathLen = 256;
@@ -133,9 +133,9 @@ end;
 
 var
   save_iy: Word; public name 'FPC_SAVE_IY';
-  LastKey: Char absolute 23560;
+  LastKey: AnsiChar absolute 23560;
 
-function ReadKey: Char;
+function ReadKey: AnsiChar;
 begin
   repeat
     ReadKey:=LastKey;
@@ -158,7 +158,7 @@ asm
   ld (save_iy),iy
 end;
 
-procedure PrintChar(Ch: Char);assembler;
+procedure PrintChar(Ch: AnsiChar);assembler;
 asm
   ld iy,(save_iy)
   ld a, (Ch)
@@ -177,9 +177,9 @@ procedure PrintHexDigit(const d: byte);
 begin
   { the code generator is still to broken to compile this, so we do it in a stupid way }
 {  if (d >= 0) or (d <= 9) then
-    PrintChar(Char(d + Ord('0')))
+    PrintChar(AnsiChar(d + Ord('0')))
   else if (d >= 10) and (d <= 15) then
-    PrintChar(Char(d + (Ord('A') - 10)));}
+    PrintChar(AnsiChar(d + (Ord('A') - 10)));}
   if d=0 then
     PrintChar('0')
   else if d=1 then
@@ -231,20 +231,20 @@ end;
 procedure Ink(colour: Byte);
 begin
   PrintChar(#16);
-  PrintChar(Char(colour));
+  PrintChar(AnsiChar(colour));
 end;
 
 procedure Paper(colour: Byte);
 begin
   PrintChar(#17);
-  PrintChar(Char(colour));
+  PrintChar(AnsiChar(colour));
 end;
 
 procedure GotoXY(X, Y: Byte);
 begin
   PrintChar(#22);
-  PrintChar(Char(Y-1));
-  PrintChar(Char(X-1));
+  PrintChar(AnsiChar(Y-1));
+  PrintChar(AnsiChar(X-1));
 end;
 
 procedure PrintShortString(const s: ShortString);