summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 22:18:23 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 22:18:23 +0000
commit42bbb119ad3c54203bf50f73e0e03cc7aefe0a5e (patch)
tree21b70b8a6ee64f1f6687c232d50b9db5cce30c90
parentf7c0a2d9b8013df1e61555a87bf762db0dc01532 (diff)
downloadfpc-42bbb119ad3c54203bf50f73e0e03cc7aefe0a5e.tar.gz
+ implemented console output in the ZX Spectrum RTL. Writeln('Hello, world!'); now works!!! :)
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/z80@45129 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--rtl/zxspectrum/sysfile.inc8
-rw-r--r--rtl/zxspectrum/system.pp6
2 files changed, 10 insertions, 4 deletions
diff --git a/rtl/zxspectrum/sysfile.inc b/rtl/zxspectrum/sysfile.inc
index 484bf00e4e..a4621ae79f 100644
--- a/rtl/zxspectrum/sysfile.inc
+++ b/rtl/zxspectrum/sysfile.inc
@@ -35,6 +35,13 @@ end;
function do_write(h:thandle;addr:pointer;len : longint) : longint;
begin
+ do_write:=len;
+ while len>0 do
+ begin
+ PrintChar(PChar(addr)^);
+ Inc(addr);
+ Dec(len);
+ end;
end;
@@ -83,4 +90,5 @@ end;
function do_isdevice(handle:THandle):boolean;
begin
+ do_isdevice:=true;
end;
diff --git a/rtl/zxspectrum/system.pp b/rtl/zxspectrum/system.pp
index 5279d44df6..ef4fb8e46b 100644
--- a/rtl/zxspectrum/system.pp
+++ b/rtl/zxspectrum/system.pp
@@ -53,7 +53,7 @@ function KeyPressed: Boolean;
implementation
const
- LineEnding = #13#10;
+ LineEnding = #13;
{ LFNSupport is a variable here, defined below!!! }
DirectorySeparator = '\';
DriveSeparator = ':';
@@ -76,7 +76,7 @@ const
CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
sLineBreak = LineEnding;
- DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
+ DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCR;
var
__heapsize: Word;external name '__heapsize';
@@ -267,7 +267,6 @@ end;
procedure SysInitStdIO;
begin
-(* TODO: doesn't work yet...
OpenStdIO(Input,fmInput,StdInputHandle);
OpenStdIO(Output,fmOutput,StdOutputHandle);
OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
@@ -275,7 +274,6 @@ begin
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
OpenStdIO(StdErr,fmOutput,StdErrorHandle);
{$endif FPC_STDOUT_TRUE_ALIAS}
-*)
end;
begin