Skip to content

Commit

Permalink
sinclairql: make sure smsfuncs.inc is in sync with the one in packages
Browse files Browse the repository at this point in the history
git-svn-id: trunk@49394 -
  • Loading branch information
chainq committed May 22, 2021
1 parent 70011c2 commit 94693e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions rtl/sinclairql/smsfuncs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
**********************************************************************}

function sms_info(sys_vars: ppchar; ver_ascii: plongint): Tjobid; external name '_mt_inf';
function iob_fbyt(chan: Tchanid; timeout: Ttimeout): longint; external name '_io_fbyte';
function iof_mkdr(chan: Tchanid): longint; external name '_iof_mkdr';
24 changes: 15 additions & 9 deletions rtl/sinclairql/system.pp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function DefaultQLOpenCon(var console: QLConHandle): boolean;
r: TQLRect;
begin
DefaultQLOpenCon:=false;
with console do
with console do
begin
inputHandle:=io_open('con_',Q_OPEN);
if inputHandle <= 0 then
Expand All @@ -308,8 +308,8 @@ function DefaultQLOpenCon(var console: QLConHandle): boolean;
r.q_x:=0;
r.q_y:=0;

sd_wdef(inputHandle,-1,2,1,@r);
sd_clear(inputHandle,-1);
sd_wdef(outputHandle,-1,2,1,@r);
sd_clear(outputHandle,-1);
end;
DefaultQLOpenCon:=true;
end;
Expand All @@ -333,6 +333,7 @@ procedure DefaultQLCloseCon(var console: QLConHandle);
jobStackDataPtr: pointer; external name '__stackpointer_on_entry';
program_name: shortstring; external name '__fpc_program_name';
QLCon: QLConHandle;
QLConOpen: boolean;

{ QL/QDOS specific startup }
procedure SysInitQDOS;
Expand All @@ -345,9 +346,11 @@ procedure SysInitQDOS;
SetQLJobName(program_name);

if assigned(@QLOpenCon) then
QLOpenCon(QLCon)
QLConOpen:=QLOpenCon(QLCon)
else
DefaultQLOpenCon(QLCon);
QLConOpen:=DefaultQLOpenCon(QLCon);
if not QLConOpen then
halt(1);

with QLCon do
begin
Expand All @@ -370,10 +373,13 @@ procedure system_exit;
if assigned(argv) then
FreeMem(argv);

if assigned(@QLCloseCon) then
QLCloseCon(QLCon)
else
DefaultQLCloseCon(QLCon);
if QLConOpen then
begin
if assigned(@QLCloseCon) then
QLCloseCon(QLCon)
else
DefaultQLCloseCon(QLCon);
end;

stdInputHandle:=UnusedHandle;
stdOutputHandle:=UnusedHandle;
Expand Down

0 comments on commit 94693e5

Please sign in to comment.