rtl/atari: check for application/acc at startup

This commit is contained in:
Thorsten Otto 2022-02-03 07:11:22 +01:00 committed by Charlie Balogh
parent b4d8f2d1b6
commit a237aaa1f5
2 changed files with 16 additions and 2 deletions

View File

@ -33,9 +33,22 @@ procedure PascalMain; external name 'PASCALMAIN';
{ this function must be the first in this unit which contains code }
{$OPTIMIZATION OFF}
procedure _FPC_proc_start(pd: PPD); cdecl; public name '_start';
procedure _FPC_proc_start; cdecl; public name '_start';
var pd: PPD;
begin
procdesc:=pd;
asm
move.l a0,d0
beq @Lapp
moveq #0,d1
bra @Lacc
@Lapp:
move.l 8(a6),a0
moveq #1,d1
@Lacc:
move.b d1,AppFlag
move.l a0,procdesc
end;
pd:=procdesc;
tpasize:=align(sizeof(pd^) + pd^.p_tlen + pd^.p_dlen + pd^.p_blen + stklen, sizeof(pointer));
if gemdos_mshrink(0, pd, tpasize) < 0 then

View File

@ -63,6 +63,7 @@ var
argc: LongInt;
argv: PPChar;
envp: PPChar;
AppFlag: Boolean; { Application or Accessory }
{$if defined(FPUSOFT)}