Browse Source

+ PilotMain implemented

florian 27 years ago
parent
commit
4bfe7caea3
1 changed files with 44 additions and 11 deletions
  1. 44 11
      rtl/palmos/syspalm.pp

+ 44 - 11
rtl/palmos/syspalm.pp

@@ -28,34 +28,67 @@ Unit SysPalm;
        Byte     = 0..255;
        Byte     = 0..255;
        Word     = 0..65535;
        Word     = 0..65535;
 
 
+       { !!!!
        DWord    = Cardinal;
        DWord    = Cardinal;
        LongWord = Cardinal;
        LongWord = Cardinal;
+       }
+
+       { The Cardinal data type isn't currently implemented for the m68k }
+       DWord    = LongInt;
+       LongWord = LongInt;
 
 
        { Zero - terminated strings }
        { Zero - terminated strings }
-       PChar  = ^Char;
-       PPChar = ^PChar;
+       PChar    = ^Char;
+       PPChar   = ^PChar;
 
 
        { procedure type }
        { procedure type }
        TProcedure = Procedure;
        TProcedure = Procedure;
 
 
-       const
-          { max. values for longint and int }
-          MaxLongint = High(LongInt);
-          MaxInt = High(Integer);
+    const
+       { max. values for longint and int }
+       MaxLongint = High(LongInt);
+       MaxInt = High(Integer);
+
+       { Must be determined at startup for both }
+       Test68000 : byte = 0;
+       Test68881 : byte = 0;
+
+    { Palm specific data types }
+    type
+       Ptr    = ^Char;
 
 
-          { Must be determined at startup for both }
-          Test68000 : byte = 0; 
-          Test68881 : byte = 0;
+    var
+       ExitCode : DWord;
+       { this variables are passed to PilotMain }
+       cmd : Word;
+       cmdPBP : Ptr;
+       launchFlags : Word;
 
 
   implementation
   implementation
 
 
+    { mimic the C start code }
+    function _PilotMain(_cmd : Word;_cmdPBP : Ptr;_launchFlags : Word) : DWord;cdecl;export;
+
+      begin
+         cmd:=_cmd;
+         cmdPBP:=_cmdPBP;
+         launchFlags:=_launchFlags;
+         asm
+            bsr PASCALMAIN
+         end;
+         _PilotMain:=ExitCode;
+      end;
+
 begin
 begin
-   // here should be some startup code inserted
+   ExitCode:=0;
 end.
 end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-08-05 17:19:07  florian
+  Revision 1.2  1998-08-22 10:23:59  florian
+    + PilotMain implemented
+
+  Revision 1.1  1998/08/05 17:19:07  florian
     + first few things for PalmOS support
     + first few things for PalmOS support
 
 
 }
 }