浏览代码

--- Merging r30967 into '.':
U packages/amunits/src/otherlibs/ahi.pas
--- Recording mergeinfo for merge of r30967 into '.':
U .
--- Merging r30974 into '.':
U packages/amunits/src/otherlibs/ptreplay.pas
--- Recording mergeinfo for merge of r30974 into '.':
G .
--- Merging r30976 into '.':
U packages/amunits/src/otherlibs/cybergraphics.pas
--- Recording mergeinfo for merge of r30976 into '.':
G .
--- Merging r30977 into '.':
U packages/amunits/src/otherlibs/picasso96api.pas
--- Recording mergeinfo for merge of r30977 into '.':
G .
--- Merging r30978 into '.':
U packages/amunits/src/utilunits/amsgbox.pas
--- Recording mergeinfo for merge of r30978 into '.':
G .
--- Merging r30979 into '.':
U packages/amunits/src/coreunits/layers.pas
--- Recording mergeinfo for merge of r30979 into '.':
G .
--- Merging r30980 into '.':
U packages/amunits/src/coreunits/amigados.pas
--- Recording mergeinfo for merge of r30980 into '.':
G .
--- Merging r30981 into '.':
U packages/amunits/src/coreunits/exec.pas
--- Recording mergeinfo for merge of r30981 into '.':
G .
--- Merging r30983 into '.':
U packages/amunits/src/coreunits/amigalib.pas
--- Recording mergeinfo for merge of r30983 into '.':
G .
--- Merging r30984 into '.':
U packages/amunits/src/coreunits/intuition.pas
--- Recording mergeinfo for merge of r30984 into '.':
G .
--- Merging r30985 into '.':
U packages/amunits/src/coreunits/rexx.pas
--- Recording mergeinfo for merge of r30985 into '.':
G .
--- Merging r30986 into '.':
U packages/amunits/src/coreunits/utility.pas
--- Recording mergeinfo for merge of r30986 into '.':
G .
--- Merging r30988 into '.':
G packages/amunits/src/coreunits/utility.pas
--- Recording mergeinfo for merge of r30988 into '.':
G .
--- Merging r30989 into '.':
U packages/morphunits/src/iffparse.pas
--- Recording mergeinfo for merge of r30989 into '.':
G .

# revisions: 30967,30974,30976,30977,30978,30979,30980,30981,30983,30984,30985,30986,30988,30989

git-svn-id: branches/fixes_3_0@31095 -

marco 10 年之前
父节点
当前提交
0a6772ced0

+ 72 - 127
packages/amunits/src/coreunits/amigados.pas

@@ -1702,7 +1702,7 @@ FUNCTION SameLock(lock1 : LONGINT location 'd1'; lock2 : LONGINT location 'd2')
 FUNCTION SelectInput(fh : LONGINT location 'd1') : LONGINT; syscall _DOSBase 294;
 FUNCTION SelectOutput(fh : LONGINT location 'd1') : LONGINT; syscall _DOSBase 300;
 PROCEDURE SendPkt(dp : pDosPacket location 'd1'; port : pMsgPort location 'd2'; replyport : pMsgPort location 'd3'); syscall _DOSBase 246;
-FUNCTION SetArgStr(const string_ : pCHAR location 'd1') : LongBool; syscall _DOSBase 540;
+FUNCTION SetArgStr(const string_ : pCHAR location 'd1') : PChar; syscall _DOSBase 540;
 FUNCTION SetComment(const name : pCHAR location 'd1';const comment : pCHAR location 'd2') : LongBool; syscall _DOSBase 180;
 FUNCTION SetConsoleTask(const task : pMsgPort location 'd1') : pMsgPort; syscall _DOSBase 516;
 FUNCTION SetCurrentDirName(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 558;
@@ -1743,9 +1743,7 @@ FUNCTION MKBADDR(adr: Pointer): BPTR;
 { overlay function and procedures}
 
 FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
-FUNCTION AddPart(dirname : string;const filename : pCHAR; size : ULONG) : BOOLEAN;
 FUNCTION AddPart(dirname : pCHAR;const filename : string; size : ULONG) : BOOLEAN;
-FUNCTION AddPart(dirname : string;const filename : string; size : ULONG) : BOOLEAN;
 FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
 FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
 FUNCTION AssignLate(const name : pChar;const path : string) : BOOLEAN;
@@ -1755,7 +1753,6 @@ FUNCTION AssignPath(const name : string; const path : pCHAR) : BOOLEAN;
 FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
 FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
 FUNCTION CreateDir(const name : string) : LONGINT;
-FUNCTION CreateProc(const name : string; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
 FUNCTION DOSDeleteFile(const name : string) : BOOLEAN;
 FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
 FUNCTION DeviceProc(const name : string) : pMsgPort;
@@ -1785,26 +1782,20 @@ FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
 FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
 FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
 FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
-FUNCTION MatchPattern(const pat : string; str : pCHAR) : BOOLEAN;
 FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
-FUNCTION MatchPattern(const pat : string; str : string) : BOOLEAN;
-FUNCTION MatchPatternNoCase(const pat : string; str : pCHAR) : BOOLEAN;
 FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
-FUNCTION MatchPatternNoCase(const pat : string; str : string) : BOOLEAN;
 FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
 FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
 FUNCTION PathPart(const path : string) : pCHAR;
 FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
 FUNCTION PutStr(const str : string) : BOOLEAN;
 FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
-FUNCTION ReadItem(const name : string; maxchars : LONGINT; cSource : pCSource) : LONGINT;
 FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
 FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
 FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
 FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
 FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
 FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
-FUNCTION SetArgStr(const string_ : string) : BOOLEAN;
 FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
 FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
 FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
@@ -1822,401 +1813,355 @@ FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
 
 IMPLEMENTATION
 
-uses pastoc;
 
-FUNCTION BADDR(bval : BPTR): POINTER;
+FUNCTION BADDR(bval : BPTR): POINTER; inline;
 BEGIN
     BADDR := POINTER( bval shl 2);
 END;
 
-FUNCTION MKBADDR(adr : POINTER): BPTR;
+FUNCTION MKBADDR(adr : POINTER): BPTR; inline;
 BEGIN
     MKBADDR := BPTR( LONGINT(adr) shr 2);
 END;
 
 FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
 begin
-     AddBuffers := AddBuffers(pas2c(name), number);
+     AddBuffers := AddBuffers(PChar(RawByteString(name)), number);
 end;
 
-FUNCTION AddPart(dirname : string;const filename : pCHAR; size : ULONG) : BOOLEAN;
+FUNCTION AddPart(dirname : pCHAR; const filename : string; size : ULONG) : BOOLEAN;
 begin
-     AddPart := AddPart(pas2c(dirname),filename,size);
-end;
-
-FUNCTION AddPart(dirname : pCHAR;const filename : string; size : ULONG) : BOOLEAN;
-begin
-     AddPart := AddPart(dirname,pas2c(filename),size);
-end;
-
-FUNCTION AddPart(dirname : string;const filename : string; size : ULONG) : BOOLEAN;
-begin
-     AddPart := AddPart(pas2c(dirname),pas2c(filename),size);
+     AddPart := AddPart(dirname,PChar(RawByteString(filename)),size);
 end;
 
 FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
 begin
-     AssignAdd := AssignAdd(pas2c(name),lock);
+     AssignAdd := AssignAdd(PChar(RawByteString(name)),lock);
 end;
 
 FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
 begin
-     AssignLate := AssignLate(pas2c(name),path);
+     AssignLate := AssignLate(PChar(RawByteString(name)),path);
 end;
 
 FUNCTION AssignLate(const name : pChar;const  path : string) : BOOLEAN;
 begin
-     AssignLate := AssignLate(name,pas2c(path));
+     AssignLate := AssignLate(name,PChar(RawByteString(path)));
 end;
 
 FUNCTION AssignLate(const name : string;const path : string) : BOOLEAN;
 begin
-     AssignLate := AssignLate(pas2c(name),pas2c(path));
+     AssignLate := AssignLate(PChar(RawByteString(name)),PChar(RawByteString(path)));
 end;
 
 FUNCTION AssignLock(const name : string; lock : LONGINT) : BOOLEAN;
 begin
-     AssignLock := AssignLock(pas2c(name),lock);
+     AssignLock := AssignLock(PChar(RawByteString(name)),lock);
 end;
 
 FUNCTION AssignPath(const name : string;const path : pCHAR) : BOOLEAN;
 begin
-     AssignPath := AssignPath(pas2c(name),path);
+     AssignPath := AssignPath(PChar(RawByteString(name)),path);
 end;
 
 FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
 begin
-     AssignPath := AssignPath(name,pas2c(path));
+     AssignPath := AssignPath(name,PChar(RawByteString(path)));
 end;
 
 FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
 begin
-     AssignPath := AssignPath(pas2c(name),pas2c(path));
+     AssignPath := AssignPath(PChar(RawByteString(name)),PChar(RawByteString(path)));
 end;
 
 FUNCTION CreateDir(const name : string) : LONGINT;
 begin
-     CreateDir := CreateDir(pas2c(name));
-end;
-
-FUNCTION CreateProc(const name : string; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
-begin
-     CreateProc := CreateProc(pas2c(name),pri,segList,stackSize);
+     CreateDir := CreateDir(PChar(RawByteString(name)));
 end;
 
 FUNCTION DOSDeleteFile(const name : string) : BOOLEAN;
 begin
-     DOSDeleteFile := DOSDeleteFile(pas2c(name));
+     DOSDeleteFile := DOSDeleteFile(PChar(RawByteString(name)));
 end;
 
 FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
 begin
-     DeleteVar := DeleteVar(pas2c(name),flags);
+     DeleteVar := DeleteVar(PChar(RawByteString(name)),flags);
 end;
 
 FUNCTION DeviceProc(const name : string) : pMsgPort;
 begin
-     Deviceproc := DeviceProc(pas2c(name));
+     Deviceproc := DeviceProc(PChar(RawByteString(name)));
 end;
 
 FUNCTION DOSOpen(const name : string; accessMode : LONGINT) : LONGINT;
 begin
-     DOSOpen := DOSOpen(pas2c(name),accessMode);
+     DOSOpen := DOSOpen(PChar(RawByteString(name)),accessMode);
 end;
 
 FUNCTION DOSRename(const oldName : string;const newName : pCHAR) : Boolean;
 begin
-     DOSRename := DOSRename(pas2c(oldName),newName);
+     DOSRename := DOSRename(PChar(RawByteString(oldName)),newName);
 end;
 
 FUNCTION DOSRename(const oldName : pCHAR;const newName : string) : Boolean;
 begin
-     DOSRename := DOSRename(oldName,pas2c(newName));
+     DOSRename := DOSRename(oldName,PChar(RawByteString(newName)));
 end;
 
 FUNCTION DOSRename(const oldName : string;const newName : string) : Boolean;
 begin
-     DOSRename := DOSRename(pas2c(oldName),pas2c(newName));
+     DOSRename := DOSRename(PChar(RawByteString(oldName)),PChar(RawByteString(newName)));
 end;
 
 FUNCTION Execute(const string_ : string; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
 begin
-     Execute := Execute(pas2c(string_),file_ ,file2);
+     Execute := Execute(PChar(RawByteString(string_)),file_ ,file2);
 end;
 
 FUNCTION Fault(code : LONGINT; header : string; buffer : pCHAR; len : LONGINT) : BOOLEAN;
 begin
-    Fault := Fault(code,pas2c(header),buffer,len);
+    Fault := Fault(code,PChar(RawByteString(header)),buffer,len);
 end;
 
 FUNCTION FilePart(const path : string) : pCHAR;
 begin
-    FilePart := FilePart(pas2c(path));
+    FilePart := FilePart(PChar(RawByteString(path)));
 end;
 
 FUNCTION FindArg(const keyword : string;const arg_template : pCHAR) : LONGINT;
 begin
-    FindArg := FindArg(pas2c(keyword),arg_template);
+    FindArg := FindArg(PChar(RawByteString(keyword)),arg_template);
 end;
 
 FUNCTION FindArg(const keyword : pCHAR;const arg_template : string) : LONGINT;
 begin
-    FindArg := FindArg(keyword,pas2c(arg_template));
+    FindArg := FindArg(keyword,PChar(RawByteString(arg_template)));
 end;
 
 FUNCTION FindArg(const keyword : string;const arg_template : string) : LONGINT;
 begin
-    FindArg := FindArg(pas2c(keyword),pas2c(arg_template));
+    FindArg := FindArg(PChar(RawByteString(keyword)),PChar(RawByteString(arg_template)));
 end;
 
 FUNCTION FindDosEntry(const dlist : pDosList;const name : string; flags : ULONG) : pDosList;
 begin
-    FindDosEntry := FindDosEntry(dlist,pas2c(name),flags);
+    FindDosEntry := FindDosEntry(dlist,PChar(RawByteString(name)),flags);
 end;
 
 FUNCTION FindSegment(const name : string;const seg : pSegment; system : LONGINT) : pSegment;
 begin
-    FindSegment := FindSegment(pas2c(name),seg,system);
+    FindSegment := FindSegment(PChar(RawByteString(name)),seg,system);
 end;
 
 FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
 begin
-    FindVar := FindVar(pas2c(name),type_);
+    FindVar := FindVar(PChar(RawByteString(name)),type_);
 end;
 
 FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
 begin
-    Format := Format(pas2c(filesystem),volumename,dostype);
+    Format := Format(PChar(RawByteString(filesystem)),volumename,dostype);
 end;
 
 FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
 begin
-    Format := Format(filesystem,pas2c(volumename),dostype);
+    Format := Format(filesystem,PChar(RawByteString(volumename)),dostype);
 end;
 
 FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
 begin
-    Format := Format(pas2c(filesystem),pas2c(volumename),dostype);
+    Format := Format(PChar(RawByteString(filesystem)),PChar(RawByteString(volumename)),dostype);
 end;
 
 FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
 begin
-    FPuts := FPuts(fh,pas2c(str));
+    FPuts := FPuts(fh,PChar(RawByteString(str)));
 end;
 
 FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
 begin
-    GetDeviceProc := GetDeviceProc(pas2c(name),dp);
+    GetDeviceProc := GetDeviceProc(PChar(RawByteString(name)),dp);
 end;
 
 FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
 begin
-    GetVar := GetVar(pas2c(name),buffer,size,flags);
+    GetVar := GetVar(PChar(RawByteString(name)),buffer,size,flags);
 end;
 
 FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
 begin
-    Inhibit := Inhibit(pas2c(name),onoff);
+    Inhibit := Inhibit(PChar(RawByteString(name)),onoff);
 end;
 
 FUNCTION IsFileSystem(const name : string) : BOOLEAN;
 begin
-    IsFileSystem := IsFileSystem(pas2c(name));
+    IsFileSystem := IsFileSystem(PChar(RawByteString(name)));
 end;
 
 FUNCTION LoadSeg(const name : string) : LONGINT;
 begin
-    LoadSeg := LoadSeg(pas2c(name));
+    LoadSeg := LoadSeg(PChar(RawByteString(name)));
 end;
 
 FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
 begin
-    Lock := Lock(pas2c(name),type_);
+    Lock := Lock(PChar(RawByteString(name)),type_);
 end;
 
 FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
 begin
-    MakeDosEntry := MakeDosEntry(pas2c(name),type_);
+    MakeDosEntry := MakeDosEntry(PChar(RawByteString(name)),type_);
 end;
 
 FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
 begin
-    MakeLink := MakeLink(pas2c(name),dest,soft);
+    MakeLink := MakeLink(PChar(RawByteString(name)),dest,soft);
 end;
 
 FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
 begin
-    MatchFirst := MatchFirst(pas2c(pat),anchor);
-end;
-
-FUNCTION MatchPattern(const pat : string; str : pCHAR) : BOOLEAN;
-begin
-    MatchPattern := MatchPattern(pas2c(pat),str);
+    MatchFirst := MatchFirst(PChar(RawByteString(pat)),anchor);
 end;
 
 FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
 begin
-    MatchPattern := MatchPattern(pat,pas2c(str));
-end;
-
-FUNCTION MatchPattern(const pat : string; str : string) : BOOLEAN;
-begin
-    MatchPattern := MatchPattern(pas2c(pat),pas2c(str));
-end;
-
-FUNCTION MatchPatternNoCase(const pat : string; str : pCHAR) : BOOLEAN;
-begin
-    MatchPatternNoCase := MatchPatternNoCase(pas2c(pat),str);
+    MatchPattern := MatchPattern(pat,PChar(RawByteString(str)));
 end;
 
 FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
 begin
-    MatchPatternNoCase := MatchPatternNoCase(pat,pas2c(str));
-end;
-
-FUNCTION MatchPatternNoCase(const pat : string; str : string) : BOOLEAN;
-begin
-    MatchPatternNoCase := MatchPatternNoCase(pas2c(pat),pas2c(str));
+    MatchPatternNoCase := MatchPatternNoCase(pat,PChar(RawByteString(str)));
 end;
 
 FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
 begin
-    NewLoadSeg := NewLoadSeg(pas2c(file_),tags);
+    NewLoadSeg := NewLoadSeg(PChar(RawByteString(file_)),tags);
 end;
 
 FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
 begin
-    NewLoadSegTagList := NewLoadSegTagList(pas2c(file_),tags);
+    NewLoadSegTagList := NewLoadSegTagList(PChar(RawByteString(file_)),tags);
 end;
 
 FUNCTION PathPart(const path : string) : pCHAR;
 begin
-    PathPart := PathPart(pas2c(path));
+    PathPart := PathPart(PChar(RawByteString(path)));
 end;
 
 FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
 begin
-    PrintFault := PrintFault(code,pas2c(header));
+    PrintFault := PrintFault(code,PChar(RawByteString(header)));
 end;
 
 FUNCTION PutStr(const str : string) : BOOLEAN;
 begin
-    PutStr := PutStr(pas2c(str));
+    PutStr := PutStr(PChar(RawByteString(str)));
 end;
 
 FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
 begin
-    ReadArgs := ReadArgs(pas2c(arg_template),arra,args);
-end;
-
-FUNCTION ReadItem(const name : string; maxchars : LONGINT; cSource : pCSource) : LONGINT;
-begin
-    ReadItem := ReadItem(pas2c(name),maxchars,cSource);
+    ReadArgs := ReadArgs(PChar(RawByteString(arg_template)),arra,args);
 end;
 
 FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
 begin
-    ReadLink := ReadLink(port,lock,pas2c(path),buffer,size);
+    ReadLink := ReadLink(port,lock,PChar(RawByteString(path)),buffer,size);
 end;
 
 FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
 begin
-    Relabel := Relabel(pas2c(drive),newname);
+    Relabel := Relabel(PChar(RawByteString(drive)),newname);
 end;
 
 FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
 begin
-    Relabel := Relabel(drive,pas2c(newname));
+    Relabel := Relabel(drive,PChar(RawByteString(newname)));
 end;
 
 FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
 begin
-    Relabel := Relabel(pas2c(drive),pas2c(newname));
+    Relabel := Relabel(PChar(RawByteString(drive)),PChar(RawByteString(newname)));
 end;
 
 FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
 begin
-    RemAssignList := RemAssignList(pas2c(name),lock);
+    RemAssignList := RemAssignList(PChar(RawByteString(name)),lock);
 end;
 
 FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
 begin
-    RunCommand := RunCommand(seg,stack,pas2c(paramptr),paramlen);
-end;
-
-FUNCTION SetArgStr(const string_ : string) : BOOLEAN;
-begin
-    SetArgStr := SetArgStr(pas2c(string_));
+    RunCommand := RunCommand(seg,stack,PChar(RawByteString(paramptr)),paramlen);
 end;
 
 FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
 begin
-    SetComment := SetComment(pas2c(name),comment);
+    SetComment := SetComment(PChar(RawByteString(name)),comment);
 end;
 
 FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
 begin
-    SetComment := SetComment(name,pas2c(comment));
+    SetComment := SetComment(name,PChar(RawByteString(comment)));
 end;
 
 FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
 begin
-    SetComment := SetComment(pas2c(name),pas2c(comment));
+    SetComment := SetComment(PChar(RawByteString(name)),PChar(RawByteString(comment)));
 end;
 
 FUNCTION SetCurrentDirName(const name : string) : BOOLEAN;
 begin
-     SetCurrentDirName := SetCurrentDirName(pas2c(name));
+     SetCurrentDirName := SetCurrentDirName(PChar(RawByteString(name)));
 end;
 
 FUNCTION SetFileDate(const name : string; date : pDateStamp) : BOOLEAN;
 begin
-     SetFileDate := SetFileDate(pas2c(name),date);
+     SetFileDate := SetFileDate(PChar(RawByteString(name)),date);
 end;
 
 FUNCTION SetOwner(const name : string; owner_info : LONGINT) : BOOLEAN;
 begin
-     SetOwner := SetOwner(pas2c(name),owner_info);
+     SetOwner := SetOwner(PChar(RawByteString(name)),owner_info);
 end;
 
 FUNCTION SetProgramName(const name : string) : BOOLEAN;
 begin
-     SetProgramName := SetProgramName(pas2c(name));
+     SetProgramName := SetProgramName(PChar(RawByteString(name)));
 end;
 
 FUNCTION SetPrompt(const name : string) : BOOLEAN;
 begin
-     SetPrompt := SetPrompt(pas2c(name));
+     SetPrompt := SetPrompt(PChar(RawByteString(name)));
 end;
 
 FUNCTION SetProtection(const name : string; protect : LONGINT) : BOOLEAN;
 begin
-     SetProtection := SetProtection(pas2c(name),protect);
+     SetProtection := SetProtection(PChar(RawByteString(name)),protect);
 end;
 
 FUNCTION SetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
 begin
-     SetVar := SetVar(pas2c(name),buffer,size,flags);
+     SetVar := SetVar(PChar(RawByteString(name)),buffer,size,flags);
 end;
 
 FUNCTION SplitName(const name : string; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
 begin
-     SplitName := SplitName(pas2c(name), seperator,buf,oldpos,size);
+     SplitName := SplitName(PChar(RawByteString(name)),seperator,buf,oldpos,size);
 end;
 
 FUNCTION StrToLong(const string_ : string; VAR value : LONGINT) : LONGINT;
 begin
-     StrToLong := StrToLong(pas2c(string_),value);
+     StrToLong := StrToLong(PChar(RawByteString(string_)),value);
 end;
 
 FUNCTION SystemTagList(const command : string;const tags : pTagItem) : LONGINT;
 begin
-     SystemTagList := SystemTagList(pas2c(command),tags);
+     SystemTagList := SystemTagList(PChar(RawByteString(command)),tags);
 end;
 
 FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
 begin
-     DOSSystem := DOSSystem(pas2c(command),tags);
+     DOSSystem := DOSSystem(PChar(RawByteString(command)),tags);
 end;
 
 

+ 25 - 26
packages/amunits/src/coreunits/amigalib.pas

@@ -159,13 +159,11 @@ function SetSuperAttrsA(cl : pIClass; obj: pObject_; msg : APTR): ulong;
 
 }
 
-procedure printf(Fmtstr : pchar; Args : array of const);
-procedure printf(Fmtstr : string; Args : array of const);
+procedure printf(Fmtstr : pchar; const Args : array of const);
+procedure printf(Fmtstr : string; const Args : array of const);
 
 IMPLEMENTATION
 
-uses pastoc;
-
 {*  Exec support functions from amiga.lib  *}
 
 procedure BeginIO (ioRequest: pIORequest);
@@ -393,35 +391,36 @@ begin
     SetSuperAttrsA := DoSuperMethodA(cl, obj, @arr);
 end;
 
-var
-  argarray : array [0..20] of longint;
 
-function gettheconst(args : array of const): pointer;
+procedure printf(Fmtstr : pchar; const Args : array of const);
 var
-   i : longint;
-
+  i,j : longint;
+  argarray : array of longint;
+  strarray : array of RawByteString;
 begin
-
-    for i := 0 to High(args) do begin
-        case args[i].vtype of
-            vtinteger : argarray[i] := longint(args[i].vinteger);
-            vtpchar   : argarray[i] := longint(args[i].vpchar);
-            vtchar    : argarray[i] := longint(args[i].vchar);
-            vtpointer : argarray[i] := longint(args[i].vpointer);
-            vtstring  : argarray[i] := longint(pas2c(args[i].vstring^));
-        end;
+  SetLength(argarray, length(args));
+  SetLength(strarray, length(args));
+  j:=0;
+  for i := low(args) to High(args) do 
+    begin
+      case args[i].vtype of
+        vtinteger : argarray[i] := longint(args[i].vinteger);
+        vtpchar   : argarray[i] := longint(args[i].vpchar);
+        vtchar    : argarray[i] := longint(args[i].vchar);
+        vtpointer : argarray[i] := longint(args[i].vpointer);
+        vtstring  : begin
+            strarray[j]:=RawByteString(args[i].vstring^);
+            argarray[i]:=longint(PChar(strarray[j]));
+            inc(j);
+          end;
+      end;
     end;
-    gettheconst := @argarray;
-end;
-
-procedure printf(Fmtstr : pchar; Args : array of const);
-begin
-    VPrintf(Fmtstr,gettheconst(Args));
+  VPrintf(Fmtstr,@argarray[0]);
 end;
 
-procedure printf(Fmtstr : string; Args : array of const);
+procedure printf(Fmtstr : string; const Args : array of const);
 begin
-    VPrintf(pas2c(Fmtstr) ,gettheconst(Args));
+  printf(PChar(RawByteString(Fmtstr)), Args);
 end;
 
 

+ 22 - 25
packages/amunits/src/coreunits/exec.pas

@@ -1307,7 +1307,6 @@ FUNCTION AVL_FindNextNodeByKey(CONST root : pAVLNode location 'a0'; key : POINTE
 FUNCTION AVL_FindFirstNode(CONST root : pAVLNode location 'a0') : pAVLNode; syscall _ExecBase 900;
 FUNCTION AVL_FindLastNode(CONST root : pAVLNode location 'a0') : pAVLNode; syscall _ExecBase 906;
 
-PROCEDURE AddMemList(size : ULONG; attributes : ULONG; pri : LONGINT; base : POINTER; const name : String);
 FUNCTION FindName(list : pList; const name : String) : pNode;
 FUNCTION FindPort(const name : String) : pMsgPort;
 FUNCTION FindResident(const name : String) : pResident;
@@ -1325,73 +1324,71 @@ function IsMsgPortEmpty( mp : pMsgPort): boolean;
 
 IMPLEMENTATION
 
-uses pastoc;
-
-function BitMask(no :shortint): longint;
+function BitMask(no :shortint): longint; inline;
 begin
    BitMask := 1 shl no;
 end;
 
-function IsListEmpty( list : pList): boolean;
+function IsListEmpty( list : pList): boolean; inline;
 begin
      IsListEmpty := list^.lh_TailPred = pnode(list);
 end;
 
-function IsMsgPortEmpty( mp : pMsgPort): boolean;
+function IsMsgPortEmpty( mp : pMsgPort): boolean; inline;
 begin
      with mp^ do
          IsMsgPortEmpty := mp_MsgList.lh_TailPred = pNode(@mp_MsgList);
 end;
 
-PROCEDURE AddMemList(size : ULONG; attributes : ULONG; pri : LONGINT; base : POINTER; const name : String);
-BEGIN
-    AddMemList(size,attributes,pri,base,pas2c(name));
-END;
 FUNCTION FindName(list : pList; const name : String) : pNode;
 BEGIN
-    FindName := FindName(list,pas2c(name));
+    FindName := FindName(list,PChar(RawByteString(name)));
 END;
+
 FUNCTION FindPort(const name : String) : pMsgPort;
 BEGIN
-    FindPort := FindPort(pas2c(name));
+    FindPort := FindPort(PChar(RawByteString(name)));
 END;
+
 FUNCTION FindResident(const name : String) : pResident;
 BEGIN
-    FindResident := FindResident(pas2c(name));
+    FindResident := FindResident(PChar(RawByteString(name)));
 END;
+
 FUNCTION FindSemaphore(const sigSem : String) : pSignalSemaphore;
 BEGIN
-    FindSemaphore := FindSemaphore(pas2c(sigSem));
+    FindSemaphore := FindSemaphore(PChar(RawByteString(sigSem)));
 END;
+
 FUNCTION FindTask(const name : String) : pTask;
 BEGIN
-    FindTask := FindTask(pas2c(name));
+    FindTask := FindTask(PChar(RawByteString(name)));
 END;
+
 FUNCTION OldOpenLibrary(const libName : String) : pLibrary;
 BEGIN
-    OldOpenLibrary := OldOpenLibrary(pas2c(libName));
+    OldOpenLibrary := OldOpenLibrary(PChar(RawByteString(libName)));
 END;
+
 FUNCTION OpenDevice(const devName : String; unite : ULONG; ioRequest : pIORequest;
 flags : ULONG) : shortint;
 BEGIN
-    OpenDevice := OpenDevice(pas2c(devName),unite,ioRequest,flags);
+    OpenDevice := OpenDevice(PChar(RawByteString(devName)),unite,ioRequest,flags);
 END;
+
 FUNCTION OpenLibrary(const libName : String; version : ULONG) : pLibrary;
 BEGIN
-    OpenLibrary := OpenLibrary(pas2c(libName),version);
+    OpenLibrary := OpenLibrary(PChar(RawByteString(libName)),version);
 END;
+
 FUNCTION OpenResource(const resName : String) : POINTER;
 BEGIN
-    OpenResource := OpenResource(pas2c(resName));
+    OpenResource := OpenResource(PChar(RawByteString(resName)));
 END;
+
 function RawDoFmt(const formatString : String;const dataStream : POINTER; putChProc : tPROCEDURE; putChData : POINTER): pointer;
 BEGIN
-    RawDoFmt := RawDoFmt(pas2c(formatString),dataStream,putChProc,putChData);
+    RawDoFmt := RawDoFmt(PChar(RawByteString(formatString)),dataStream,putChProc,putChData);
 END;
 
 END. (* UNIT EXEC *)
-
-
-
-
-

+ 29 - 49
packages/amunits/src/coreunits/intuition.pas

@@ -4211,42 +4211,37 @@ FUNCTION MakeClass(const classID : pCHAR;const superClassID : string;const super
 FUNCTION MakeClass(const classID : string;const superClassID : string;const superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
 FUNCTION NewObjectA(classPtr : pIClass;const classID : string;const tagList : pTagItem) : POINTER;
 PROCEDURE SetDefaultPubScreen(const name : string);
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : string;const screenTitle : pCHAR);
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : pCHAR;const screenTitle : string);
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : string;const screenTitle : string);
 FUNCTION TimedDisplayAlert(alertNumber : ULONG;const string_ : string; height : ULONG; time : ULONG) : BOOLEAN;
 PROCEDURE UnlockPubScreen(const name : string; screen : pScreen);
 
 IMPLEMENTATION
 
-uses pastoc;
-
-function INST_DATA (cl: pIClass; o: p_Object): Pointer;
+function INST_DATA (cl: pIClass; o: p_Object): Pointer; inline;
 begin
     INST_DATA := Pointer(Longint(o) + cl^.cl_InstOffset);
 end;
 
-function SIZEOF_INSTANCE (cl: pIClass): Longint;
+function SIZEOF_INSTANCE (cl: pIClass): Longint; inline;
 begin
     SIZEOF_INSTANCE := cl^.cl_InstOffset + cl^.cl_InstSize + sizeof(t_Object);
 end;
 
-function BASEOBJECT (o: p_Object): Pointer;
+function BASEOBJECT (o: p_Object): Pointer; inline;
 begin
     BASEOBJECT := Pointer(Longint(o) + sizeof(t_Object));
 end;
 
-function _OBJ(o: p_Object): p_Object;
+function _OBJ(o: p_Object): p_Object; inline;
 begin
      _OBJ := p_Object(o);
 END;
 
-function __OBJECT (o: Pointer): p_Object;
+function __OBJECT (o: Pointer): p_Object; inline;
 begin
     __OBJECT := p_Object(Longint(o) - sizeof(t_Object))
 end;
 
-function OCLASS (o: Pointer): pIClass;
+function OCLASS (o: Pointer): pIClass; inline;
 var
     obj: p_Object;
 begin
@@ -4254,22 +4249,22 @@ begin
     OCLASS := obj^.o_Class;
 end;
 
-function SHIFTITEM (n: smallint): word;
+function SHIFTITEM (n: smallint): word; inline;
 begin
     SHIFTITEM := (n and $3f) shl 5
 end;
 
-function SHIFTMENU (n: smallint): word;
+function SHIFTMENU (n: smallint): word; inline;
 begin
     SHIFTMENU := n and $1f
 end;
 
-function SHIFTSUB (n: smallint): word;
+function SHIFTSUB (n: smallint): word; inline;
 begin
     SHIFTSUB := (n and $1f) shl 11
 end;
 
-function FULLMENUNUM (menu, item, sub: smallint): word;
+function FULLMENUNUM (menu, item, sub: smallint): word; inline;
 begin
     FULLMENUNUM := ((sub and $1f) shl 11) or
                     ((item and $3f) shl 5) or
@@ -4283,104 +4278,89 @@ end;
   A/BPen values of the image class objects as well. This can't work
   in pascal, of course! }
 
-function IM_BGPEN (im: pImage): byte;
+function IM_BGPEN (im: pImage): byte; inline;
 begin
     IM_BGPEN := im^.PlaneOnOff;
 end;
 
-function IM_BOX (im: pImage): pIBox;
+function IM_BOX (im: pImage): pIBox; inline;
 begin
     IM_BOX := pIBox(@im^.LeftEdge);
 END;
 
-function IM_FGPEN (im: pImage): byte;
+function IM_FGPEN (im: pImage): byte; inline;
 begin
     IM_FGPEN := im^.PlanePick;
 end;
 
-function GADGET_BOX (g: pGadget): pIBox;
+function GADGET_BOX (g: pGadget): pIBox; inline;
 begin
     GADGET_BOX := pIBox(@g^.LeftEdge);
 end;
 
-function CUSTOM_HOOK (gadget: pGadget): pHook;
+function CUSTOM_HOOK (gadget: pGadget): pHook; inline;
 begin
     CUSTOM_HOOK := pHook(gadget^.MutualExclude);
 end;
 
-function ITEMNUM( n : Word): Word;
+function ITEMNUM( n : Word): Word; inline;
 begin
     ITEMNUM := (n shr 5) and $3F
 end;
 
-function MENUNUM( n : Word): Word;
+function MENUNUM( n : Word): Word; inline;
 begin
     MENUNUM := n and $1f
 end;
 
-function SUBNUM( n : Word): Word;
+function SUBNUM( n : Word): Word; inline;
 begin
     SUBNUM := (n shr 11) and $1f
 end;
 
-FUNCTION DisplayAlert(alertNumber : ULONG;const string_ : string; height : ULONG) : BOOLEAN;
+FUNCTION DisplayAlert(alertNumber : ULONG;const string_ : string; height : ULONG) : BOOLEAN; inline;
 begin
-      DisplayAlert := DisplayAlert(alertNumber,pas2c(string_),height);
+      DisplayAlert := DisplayAlert(alertNumber,PChar(RawByteString(string_)),height);
 end;
 
-FUNCTION LockPubScreen(const name : string) : pScreen;
+FUNCTION LockPubScreen(const name : string) : pScreen; inline;
 begin
-      LockPubScreen := LockPubScreen(pas2c(name));
+      LockPubScreen := LockPubScreen(PChar(RawByteString(name)));
 end;
 
 FUNCTION MakeClass(const classID : string;const superClassID : pCHAR;const superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
 begin
-      MakeClass := MakeClass(pas2c(classID),superClassID,superClassPtr,instanceSize,flags);
+      MakeClass := MakeClass(PChar(RawByteString(classID)),superClassID,superClassPtr,instanceSize,flags);
 end;
 
 FUNCTION MakeClass(const classID : pCHAR;const superClassID : string;const superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
 begin
-      MakeClass := MakeClass(classID,pas2c(superClassID),superClassPtr,instanceSize,flags);
+      MakeClass := MakeClass(classID,PChar(RawByteString(superClassID)),superClassPtr,instanceSize,flags);
 end;
 
 FUNCTION MakeClass(const classID : string;const superClassID : string;const superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
 begin
-      MakeClass := MakeClass(pas2c(classID),pas2c(superClassID),superClassPtr,instanceSize,flags);
+      MakeClass := MakeClass(PChar(RawByteString(classID)),PChar(RawByteString(superClassID)),superClassPtr,instanceSize,flags);
 end;
 
 FUNCTION NewObjectA(classPtr : pIClass;const classID : string;const tagList : pTagItem) : POINTER;
 begin
-      NewObjectA := NewObjectA(classPtr,pas2c(classID),taglist);
+      NewObjectA := NewObjectA(classPtr,PChar(RawByteString(classID)),taglist);
 end;
 
 PROCEDURE SetDefaultPubScreen(const name : string);
 begin
-      SetDefaultPubScreen(pas2c(name));
-end;
-
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : string;const screenTitle : pCHAR);
-begin
-      SetWindowTitles(window,pas2c(windowTitle),screenTitle);
-end;
-
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : pCHAR;const screenTitle : string);
-begin
-      SetWindowTitles(window,windowTitle,pas2c(screenTitle));
-end;
-
-PROCEDURE SetWindowTitles(window : pWindow;const windowTitle : string;const screenTitle : string);
-begin
-      SetWindowTitles(window,pas2c(windowTitle),pas2c(screenTitle));
+      SetDefaultPubScreen(PChar(RawByteString(name)));
 end;
 
 FUNCTION TimedDisplayAlert(alertNumber : ULONG;const string_ : string; height : ULONG; time : ULONG) : BOOLEAN;
 begin
-      TimedDisplayAlert := TimedDisplayAlert(alertNumber,pas2c(string_),height,time);
+      TimedDisplayAlert := TimedDisplayAlert(alertNumber,PChar(RawByteString(string_)),height,time);
 end;
 
 PROCEDURE UnlockPubScreen(const name : string; screen : pScreen);
 begin
-      UnlockPubScreen(pas2c(name),screen);
+      UnlockPubScreen(PChar(RawByteString(name)),screen);
 end;
 
 

+ 32 - 464
packages/amunits/src/coreunits/layers.pas

@@ -32,10 +32,6 @@
     [email protected]
 }
 {$PACKRECORDS 2}
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
-   {$smartlink on}
-{$endif use_amiga_smartlink}
 
 UNIT layers;
 
@@ -90,38 +86,38 @@ const
 
 VAR LayersBase : pLibrary;
 
-FUNCTION BeginUpdate(l : pLayer) : LONGINT;
-FUNCTION BehindLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-FUNCTION CreateBehindHookLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; hook : pHook; bm2 : pBitMap) : pLayer;
-FUNCTION CreateBehindLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; bm2 : pBitMap) : pLayer;
-FUNCTION CreateUpfrontHookLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; hook : pHook; bm2 : pBitMap) : pLayer;
-FUNCTION CreateUpfrontLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; bm2 : pBitMap) : pLayer;
-FUNCTION DeleteLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-PROCEDURE DisposeLayerInfo(li : pLayer_Info);
-PROCEDURE DoHookClipRects(hook : pHook; rport : pRastPort;const rect : pRectangle);
-PROCEDURE EndUpdate(layer : pLayer; flag : ULONG);
-FUNCTION FattenLayerInfo(li : pLayer_Info) : LONGINT;
-PROCEDURE InitLayers(li : pLayer_Info);
-FUNCTION InstallClipRegion(layer : pLayer;const region : pRegion) : pRegion;
-FUNCTION InstallLayerHook(layer : pLayer; hook : pHook) : pHook;
-FUNCTION InstallLayerInfoHook(li : pLayer_Info;const hook : pHook) : pHook;
-PROCEDURE LockLayer(dummy : LONGINT; layer : pLayer);
-PROCEDURE LockLayerInfo(li : pLayer_Info);
-PROCEDURE LockLayers(li : pLayer_Info);
-FUNCTION MoveLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT) : LONGINT;
-FUNCTION MoveLayerInFrontOf(layer_to_move : pLayer; other_layer : pLayer) : LONGINT;
-FUNCTION MoveSizeLayer(layer : pLayer; dx : LONGINT; dy : LONGINT; dw : LONGINT; dh : LONGINT) : LONGINT;
-FUNCTION NewLayerInfo : pLayer_Info;
-PROCEDURE ScrollLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT);
-FUNCTION SizeLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT) : LONGINT;
-PROCEDURE SortLayerCR(layer : pLayer; dx : LONGINT; dy : LONGINT);
-PROCEDURE SwapBitsRastPortClipRect(rp : pRastPort; cr : pClipRect);
-PROCEDURE ThinLayerInfo(li : pLayer_Info);
-PROCEDURE UnlockLayer(layer : pLayer);
-PROCEDURE UnlockLayerInfo(li : pLayer_Info);
-PROCEDURE UnlockLayers(li : pLayer_Info);
-FUNCTION UpfrontLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-FUNCTION WhichLayer(li : pLayer_Info; x : LONGINT; y : LONGINT) : pLayer;
+FUNCTION BeginUpdate(l : pLayer location 'a0') : LONGINT; syscall LayersBase 078;
+FUNCTION BehindLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1') : LONGINT; syscall LayersBase 054;
+FUNCTION CreateBehindHookLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LONGINT location 'd0'; y0 : LONGINT location 'd1'; x1 : LONGINT location 'd2'; y1 : LONGINT location 'd3'; flags : LONGINT location 'd4'; hook : pHook location 'a3'; bm2 : pBitMap location 'a2') : pLayer; syscall LayersBase 192;
+FUNCTION CreateBehindLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LONGINT location 'd0'; y0 : LONGINT location 'd1'; x1 : LONGINT location 'd2'; y1 : LONGINT location 'd3'; flags : LONGINT location 'd4'; bm2 : pBitMap location 'a2') : pLayer; syscall LayersBase 042;
+FUNCTION CreateUpfrontHookLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LONGINT location 'd0'; y0 : LONGINT location 'd1'; x1 : LONGINT location 'd2'; y1 : LONGINT location 'd3'; flags : LONGINT location 'd4'; hook : pHook location 'a3'; bm2 : pBitMap location 'a2') : pLayer; syscall LayersBase 186;
+FUNCTION CreateUpfrontLayer(li : pLayer_Info location 'a0'; bm : pBitMap location 'a1'; x0 : LONGINT location 'd0'; y0 : LONGINT location 'd1'; x1 : LONGINT location 'd2'; y1 : LONGINT location 'd3'; flags : LONGINT location 'd4'; bm2 : pBitMap location 'a2') : pLayer; syscall LayersBase 036;
+FUNCTION DeleteLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1') : LONGINT; syscall LayersBase 090;
+PROCEDURE DisposeLayerInfo(li : pLayer_Info location 'a0'); syscall LayersBase 150;
+PROCEDURE DoHookClipRects(hook : pHook location 'a0'; rport : pRastPort location 'a1'; const rect : pRectangle location 'a2'); syscall LayersBase 216;
+PROCEDURE EndUpdate(layer : pLayer location 'a0'; flag : ULONG location 'd0'); syscall LayersBase 084;
+FUNCTION FattenLayerInfo(li : pLayer_Info location 'a0') : LONGINT; syscall LayersBase 156;
+PROCEDURE InitLayers(li : pLayer_Info location 'a0'); syscall LayersBase 030;
+FUNCTION InstallClipRegion(layer : pLayer location 'a0';const region : pRegion location 'a1') : pRegion; syscall LayersBase 174;
+FUNCTION InstallLayerHook(layer : pLayer location 'a0'; hook : pHook location 'a1') : pHook; syscall LayersBase 198;
+FUNCTION InstallLayerInfoHook(li : pLayer_Info location 'a0'; const hook : pHook location 'a1') : pHook; syscall LayersBase 204;
+PROCEDURE LockLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1'); syscall LayersBase 096;
+PROCEDURE LockLayerInfo(li : pLayer_Info location 'a0'); syscall LayersBase 120;
+PROCEDURE LockLayers(li : pLayer_Info location 'a0'); syscall LayersBase 108;
+FUNCTION MoveLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1'; dx : LONGINT location 'd0'; dy : LONGINT location 'd1') : LONGINT; syscall LayersBase 060;
+FUNCTION MoveLayerInFrontOf(layer_to_move : pLayer location 'a0'; other_layer : pLayer location 'a1') : LONGINT; syscall LayersBase 168;
+FUNCTION MoveSizeLayer(layer : pLayer location 'a0'; dx : LONGINT location 'd0'; dy : LONGINT location 'd1'; dw : LONGINT location 'd2'; dh : LONGINT location 'd3') : LONGINT; syscall LayersBase 180;
+FUNCTION NewLayerInfo : pLayer_Info; syscall LayersBase 144;
+PROCEDURE ScrollLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1'; dx : LONGINT location 'd0'; dy : LONGINT location 'd1'); syscall LayersBase 072;
+FUNCTION SizeLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1'; dx : LONGINT location 'd0'; dy : LONGINT location 'd1') : LONGINT; syscall LayersBase 066;
+PROCEDURE SortLayerCR(layer : pLayer location 'a0'; dx : LONGINT location 'd0'; dy : LONGINT location 'd1'); syscall LayersBase 210;
+PROCEDURE SwapBitsRastPortClipRect(rp : pRastPort location 'a0'; cr : pClipRect location 'a1'); syscall LayersBase 126;
+PROCEDURE ThinLayerInfo(li : pLayer_Info location 'a0'); syscall LayersBase 162;
+PROCEDURE UnlockLayer(layer : pLayer location 'a0'); syscall LayersBase 102;
+PROCEDURE UnlockLayerInfo(li : pLayer_Info location 'a0'); syscall LayersBase 138;
+PROCEDURE UnlockLayers(li : pLayer_Info location 'a0'); syscall LayersBase 114;
+FUNCTION UpfrontLayer(dummy : LONGINT location 'a0'; layer : pLayer location 'a1') : LONGINT; syscall LayersBase 048;
+FUNCTION WhichLayer(li : pLayer_Info location 'a0'; x : LONGINT location 'd0'; y : LONGINT location 'd1') : pLayer; syscall LayersBase 132;
 
 {Here we read how to compile this unit}
 {You can remove this include and use a define instead}
@@ -141,434 +137,6 @@ uses
 amsgbox;
 {$endif dont_use_openlib}
 
-FUNCTION BeginUpdate(l : pLayer) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L l,A0
-    MOVEA.L LayersBase,A6
-    JSR -078(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION BehindLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVEA.L LayersBase,A6
-    JSR -054(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION CreateBehindHookLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; hook : pHook; bm2 : pBitMap) : pLayer;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L bm,A1
-    MOVE.L  x0,D0
-    MOVE.L  y0,D1
-    MOVE.L  x1,D2
-    MOVE.L  y1,D3
-    MOVE.L  flags,D4
-    MOVEA.L hook,A3
-    MOVEA.L bm2,A2
-    MOVEA.L LayersBase,A6
-    JSR -192(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION CreateBehindLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; bm2 : pBitMap) : pLayer;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L bm,A1
-    MOVE.L  x0,D0
-    MOVE.L  y0,D1
-    MOVE.L  x1,D2
-    MOVE.L  y1,D3
-    MOVE.L  flags,D4
-    MOVEA.L bm2,A2
-    MOVEA.L LayersBase,A6
-    JSR -042(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION CreateUpfrontHookLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; hook : pHook; bm2 : pBitMap) : pLayer;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L bm,A1
-    MOVE.L  x0,D0
-    MOVE.L  y0,D1
-    MOVE.L  x1,D2
-    MOVE.L  y1,D3
-    MOVE.L  flags,D4
-    MOVEA.L hook,A3
-    MOVEA.L bm2,A2
-    MOVEA.L LayersBase,A6
-    JSR -186(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION CreateUpfrontLayer(li : pLayer_Info; bm : pBitMap; x0 : LONGINT; y0 : LONGINT; x1 : LONGINT; y1 : LONGINT; flags : LONGINT; bm2 : pBitMap) : pLayer;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L bm,A1
-    MOVE.L  x0,D0
-    MOVE.L  y0,D1
-    MOVE.L  x1,D2
-    MOVE.L  y1,D3
-    MOVE.L  flags,D4
-    MOVEA.L bm2,A2
-    MOVEA.L LayersBase,A6
-    JSR -036(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION DeleteLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVEA.L LayersBase,A6
-    JSR -090(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE DisposeLayerInfo(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -150(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE DoHookClipRects(hook : pHook; rport : pRastPort;const rect : pRectangle);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L hook,A0
-    MOVEA.L rport,A1
-    MOVEA.L rect,A2
-    MOVEA.L LayersBase,A6
-    JSR -216(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE EndUpdate(layer : pLayer; flag : ULONG);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVE.L  flag,D0
-    MOVEA.L LayersBase,A6
-    JSR -084(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION FattenLayerInfo(li : pLayer_Info) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -156(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE InitLayers(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -030(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION InstallClipRegion(layer : pLayer;const region : pRegion) : pRegion;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVEA.L region,A1
-    MOVEA.L LayersBase,A6
-    JSR -174(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION InstallLayerHook(layer : pLayer; hook : pHook) : pHook;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVEA.L hook,A1
-    MOVEA.L LayersBase,A6
-    JSR -198(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION InstallLayerInfoHook(li : pLayer_Info;const hook : pHook) : pHook;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L hook,A1
-    MOVEA.L LayersBase,A6
-    JSR -204(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE LockLayer(dummy : LONGINT; layer : pLayer);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVEA.L LayersBase,A6
-    JSR -096(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE LockLayerInfo(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -120(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE LockLayers(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -108(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION MoveLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVE.L  dx,D0
-    MOVE.L  dy,D1
-    MOVEA.L LayersBase,A6
-    JSR -060(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION MoveLayerInFrontOf(layer_to_move : pLayer; other_layer : pLayer) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer_to_move,A0
-    MOVEA.L other_layer,A1
-    MOVEA.L LayersBase,A6
-    JSR -168(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION MoveSizeLayer(layer : pLayer; dx : LONGINT; dy : LONGINT; dw : LONGINT; dh : LONGINT) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVE.L  dx,D0
-    MOVE.L  dy,D1
-    MOVE.L  dw,D2
-    MOVE.L  dh,D3
-    MOVEA.L LayersBase,A6
-    JSR -180(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION NewLayerInfo : pLayer_Info;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L LayersBase,A6
-    JSR -144(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE ScrollLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVE.L  dx,D0
-    MOVE.L  dy,D1
-    MOVEA.L LayersBase,A6
-    JSR -072(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION SizeLayer(dummy : LONGINT; layer : pLayer; dx : LONGINT; dy : LONGINT) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVE.L  dx,D0
-    MOVE.L  dy,D1
-    MOVEA.L LayersBase,A6
-    JSR -066(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE SortLayerCR(layer : pLayer; dx : LONGINT; dy : LONGINT);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVE.L  dx,D0
-    MOVE.L  dy,D1
-    MOVEA.L LayersBase,A6
-    JSR -210(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE SwapBitsRastPortClipRect(rp : pRastPort; cr : pClipRect);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L rp,A0
-    MOVEA.L cr,A1
-    MOVEA.L LayersBase,A6
-    JSR -126(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE ThinLayerInfo(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -162(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE UnlockLayer(layer : pLayer);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L layer,A0
-    MOVEA.L LayersBase,A6
-    JSR -102(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE UnlockLayerInfo(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -138(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE UnlockLayers(li : pLayer_Info);
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVEA.L LayersBase,A6
-    JSR -114(A6)
-    MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION UpfrontLayer(dummy : LONGINT; layer : pLayer) : LONGINT;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L dummy,A0
-    MOVEA.L layer,A1
-    MOVEA.L LayersBase,A6
-    JSR -048(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION WhichLayer(li : pLayer_Info; x : LONGINT; y : LONGINT) : pLayer;
-BEGIN
-  ASM
-    MOVE.L  A6,-(A7)
-    MOVEA.L li,A0
-    MOVE.L  x,D0
-    MOVE.L  y,D1
-    MOVEA.L LayersBase,A6
-    JSR -132(A6)
-    MOVEA.L (A7)+,A6
-    MOVE.L  D0,@RESULT
-  END;
-END;
-
 const
     { Change VERSION and LIBVERSION to proper values }
 

+ 3 - 34
packages/amunits/src/coreunits/rexx.pas

@@ -495,11 +495,6 @@ PROCEDURE LockRexxBase(resource : ULONG location 'd0'); syscall RexxSysBase 450;
 PROCEDURE UnlockRexxBase(resource : ULONG location 'd0'); syscall RexxSysBase 456;
 
 FUNCTION CreateArgstring(const argstring : string; length : ULONG) : pCHAR;
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : string; host : pCHAR) : pRexxMsg;
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : pCHAR; host : string) : pRexxMsg;
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : string; host : string) : pRexxMsg;
-PROCEDURE DeleteArgstring(argstring : string);
-FUNCTION LengthArgstring(const argstring : string) : ULONG;
 
 {Here we read how to compile this unit}
 {You can remove this include and use a define instead}
@@ -514,40 +509,14 @@ var
 
 IMPLEMENTATION
 
-uses
 {$ifndef dont_use_openlib}
-amsgbox,
+uses
+  amsgbox;
 {$endif dont_use_openlib}
-pastoc;
 
 FUNCTION CreateArgstring(const argstring : string; length : ULONG) : pCHAR;
 begin
-       CreateArgstring := CreateArgstring(pas2c(argstring),length);
-end;
-
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : string; host : pCHAR) : pRexxMsg;
-begin
-       CreateRexxMsg := CreateRexxMsg(port,pas2c(extension),host);
-end;
-
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : pCHAR; host : string) : pRexxMsg;
-begin
-       CreateRexxMsg := CreateRexxMsg(port,extension,pas2c(host));
-end;
-
-FUNCTION CreateRexxMsg(const port : pMsgPort;const extension : string; host : string) : pRexxMsg;
-begin
-       CreateRexxMsg := CreateRexxMsg(port,pas2c(extension),pas2c(host));
-end;
-
-PROCEDURE DeleteArgstring(argstring : string);
-begin
-       DeleteArgstring(pas2c(argstring));
-end;
-
-FUNCTION LengthArgstring(const argstring : string) : ULONG;
-begin
-       LengthArgstring := LengthArgstring(pas2c(argstring));
+       CreateArgstring := CreateArgstring(PChar(RawByteString(argstring)),length);
 end;
 
 const

+ 9 - 11
packages/amunits/src/coreunits/utility.pas

@@ -308,7 +308,7 @@ CONST
  TAG_SKIP          = 3; { skip this AND the next ti_Data items         }
 
 { differentiates user tags from control tags }
- TAG_USER          = $80000000;    { differentiates user tags from system tags}
+ TAG_USER          = LongInt($80000000);    { differentiates user tags from system tags}
 
 {* If the TAG_USER bit is set in a tag number, it tells utility.library that
  * the tag is not a control tag (like TAG_DONE, TAG_IGNORE, TAG_MORE) and is
@@ -387,47 +387,45 @@ FUNCTION Strnicmp(CONST string1 : string; CONST string2 : string; length : LONGI
 
 IMPLEMENTATION
 
-uses pastoc;
-
 
 function AllocNamedObjectA(const name : string;const TagList : pTagItem) : pNamedObject;
 begin
-       AllocNamedObjectA := AllocNamedObjectA(pas2c(name),TagList);
+       AllocNamedObjectA := AllocNamedObjectA(PChar(RawByteString(name)),TagList);
 end;
 
 FUNCTION FindNamedObject(nameSpace : pNamedObject; CONST name : string; lastObject : pNamedObject) : pNamedObject;
 begin
-       FindNamedObject := FindNamedObject(nameSpace,pas2c(name),lastObject);
+       FindNamedObject := FindNamedObject(nameSpace,PChar(RawByteString(name)),lastObject);
 end;
 
 FUNCTION Stricmp(CONST string1 : string; CONST string2 : pCHAR) : LONGINT;
 begin
-       Stricmp := Stricmp(pas2c(string1),string2);
+       Stricmp := Stricmp(PChar(RawbyteString(string1)),string2);
 end;
 
 FUNCTION Stricmp(CONST string1 : pCHAR; CONST string2 : string) : LONGINT;
 begin
-       Stricmp := Stricmp(string1,pas2c(string2));
+       Stricmp := Stricmp(string1,PChar(RawbyteString(string2)));
 end;
 
 FUNCTION Stricmp(CONST string1 : string; CONST string2 : string) : LONGINT;
 begin
-       Stricmp := Stricmp(pas2c(string1),pas2c(string2));
+       Stricmp := Stricmp(PChar(RawbyteString(string1)),PChar(RawbyteString(string2)));
 end;
 
 FUNCTION Strnicmp(CONST string1 : string; CONST string2 : pCHAR; length : LONGINT) : LONGINT;
 begin
-       Strnicmp := Strnicmp(pas2c(string1),string2,length);
+       Strnicmp := Strnicmp(PChar(RawbyteString(string1)),string2,length);
 end;
 
 FUNCTION Strnicmp(CONST string1 : pCHAR; CONST string2 : string; length : LONGINT) : LONGINT;
 begin
-       Strnicmp := Strnicmp(string1,pas2c(string2),length);
+       Strnicmp := Strnicmp(string1,PChar(RawbyteString(string2)),length);
 end;
 
 FUNCTION Strnicmp(CONST string1 : string; CONST string2 : string; length : LONGINT) : LONGINT;
 begin
-       Strnicmp := Strnicmp(pas2c(string1),pas2c(string2),length);
+       Strnicmp := Strnicmp(PChar(RawbyteString(string1)),PChar(RawbyteString(string2)),length);
 end;
 
 

+ 21 - 296
packages/amunits/src/otherlibs/ahi.pas

@@ -30,10 +30,6 @@
 {$PACKRECORDS 2}
 
 {$mode objfpc}
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
-   {$smartlink on}
-{$endif use_amiga_smartlink}
 
 UNIT AHI;
 
@@ -503,28 +499,28 @@ VAR AHIBase : pLibrary;
      AHIDB_NOMODESCAN = 0;
 
 
+FUNCTION AHI_AddAudioMode(a0arg : pTagItem location 'a0') : longword; syscall AHIBase 150;
+FUNCTION AHI_AllocAudioA(tagList : pTagItem location 'a1') : pAHIAudioCtrl; syscall AHIBase 42;
+FUNCTION AHI_AllocAudioRequestA(tagList : pTagItem location 'a0') : pAHIAudioModeRequester; syscall AHIBase 120;
+FUNCTION AHI_AudioRequestA(Requester : pAHIAudioModeRequester location 'a0'; tagList : pTagItem location 'a1') : wordbool; syscall AHIBase 126;
+FUNCTION AHI_BestAudioIDA(tagList : pTagItem location 'a1') : longword; syscall AHIBase 114;
+FUNCTION AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1') : longword; syscall AHIBase 60;
+PROCEDURE AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl location 'a2'); syscall AHIBase 48;
+PROCEDURE AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester location 'a0'); syscall AHIBase 132;
+FUNCTION AHI_GetAudioAttrsA(ID : longword location 'd0'; Audioctrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1') : wordbool; syscall AHIBase 108;
+PROCEDURE AHI_KillAudio; syscall AHIBase 54;
+FUNCTION AHI_LoadModeFile(a0arg : pCHAR location 'a0') : longword; syscall AHIBase 162;
+FUNCTION AHI_LoadSound(Sound : WORD location 'd0'; _Type : longword location 'd1'; Info : POINTER location 'a0'; AudioCtrl : pAHIAudioCtrl location 'a2') : longword; syscall AHIBase 90;
+FUNCTION AHI_NextAudioID(Last_ID : longword location 'd0') : longword; syscall AHIBase 102;
+PROCEDURE AHI_PlayA(Audioctrl : pAHIAudioCtrl location 'a2'; tagList : pTagItem location 'a1'); syscall AHIBase 138;
+FUNCTION AHI_RemoveAudioMode(d0arg : longword location 'd0') : longword; syscall AHIBase 156;
+FUNCTION AHI_SampleFrameSize(SampleType : longword location 'd0') : longword; syscall AHIBase 144;
+FUNCTION AHI_SetEffect(Effect : POINTER location 'a0'; AudioCtrl : pAHIAudioCtrl location 'a2') : longword; syscall AHIBase 084;
+PROCEDURE AHI_SetFreq(Channel : WORD location 'd0'; Freq : longword location 'd1'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : longword location 'd2'); syscall AHIBase 72;
+PROCEDURE AHI_SetSound(Channel : WORD location 'd0'; Sound : WORD location 'd1'; Offset : longword location 'd2'; len : LONGINT location 'd3'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : longword location 'd4'); syscall AHIBase 78;
+PROCEDURE AHI_SetVol(Channel : WORD location 'd0'; Volume : LONGINT location 'd1'; Pan : LONGINT location 'd2'; AudioCtrl : pAHIAudioCtrl location 'a2'; Flags : longword location 'd3'); syscall AHIBase 66;
+PROCEDURE AHI_UnloadSound(Sound : WORD location 'd0'; Audioctrl : pAHIAudioCtrl location 'a2'); syscall AHIBase 96;
 
-FUNCTION AHI_AddAudioMode(a0arg : pTagItem) : longword;
-FUNCTION AHI_AllocAudioA(tagList : pTagItem) : pAHIAudioCtrl;
-FUNCTION AHI_AllocAudioRequestA(tagList : pTagItem) : pAHIAudioModeRequester;
-FUNCTION AHI_AudioRequestA(Requester : pAHIAudioModeRequester; tagList : pTagItem) : BOOLEAN;
-FUNCTION AHI_BestAudioIDA(tagList : pTagItem) : longword;
-FUNCTION AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl; tagList : pTagItem) : longword;
-PROCEDURE AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl);
-PROCEDURE AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester);
-FUNCTION AHI_GetAudioAttrsA(ID : longword; Audioctrl : pAHIAudioCtrl; tagList : pTagItem) : BOOLEAN;
-PROCEDURE AHI_KillAudio;
-FUNCTION AHI_LoadModeFile(a0arg : pCHAR) : longword;
-FUNCTION AHI_LoadSound(Sound : WORD; _Type : longword; Info : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
-FUNCTION AHI_NextAudioID(Last_ID : longword) : longword;
-PROCEDURE AHI_PlayA(Audioctrl : pAHIAudioCtrl; tagList : pTagItem);
-FUNCTION AHI_RemoveAudioMode(d0arg : longword) : longword;
-FUNCTION AHI_SampleFrameSize(SampleType : longword) : longword;
-FUNCTION AHI_SetEffect(Effect : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
-PROCEDURE AHI_SetFreq(Channel : WORD; Freq : longword; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-PROCEDURE AHI_SetSound(Channel : WORD; Sound : WORD; Offset : longword; len : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-PROCEDURE AHI_SetVol(Channel : WORD; Volume : LONGINT; Pan : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-PROCEDURE AHI_UnloadSound(Sound : WORD; Audioctrl : pAHIAudioCtrl);
 {
  Functions and procedures with array of const go here
 }
@@ -553,277 +549,6 @@ amsgbox,
 {$endif dont_use_openlib}
 tagsarray;
 
-FUNCTION AHI_AddAudioMode(a0arg : pTagItem) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a0arg,A0
-        MOVEA.L AHIBase,A6
-        JSR     -150(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_AllocAudioA(tagList : pTagItem) : pAHIAudioCtrl;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -042(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_AllocAudioRequestA(tagList : pTagItem) : pAHIAudioModeRequester;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L tagList,A0
-        MOVEA.L AHIBase,A6
-        JSR     -120(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_AudioRequestA(Requester : pAHIAudioModeRequester; tagList : pTagItem) : BOOLEAN;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Requester,A0
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -126(A6)
-        MOVEA.L (A7)+,A6
-        TST.W   D0
-        BEQ.B   @end
-        MOVEQ   #1,D0
-  @end: MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_BestAudioIDA(tagList : pTagItem) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -114(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_ControlAudioA(AudioCtrl : pAHIAudioCtrl; tagList : pTagItem) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L AudioCtrl,A2
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -060(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE AHI_FreeAudio(AudioCtrl : pAHIAudioCtrl);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L AudioCtrl,A2
-        MOVEA.L AHIBase,A6
-        JSR     -048(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE AHI_FreeAudioRequest(Requester : pAHIAudioModeRequester);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Requester,A0
-        MOVEA.L AHIBase,A6
-        JSR     -132(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION AHI_GetAudioAttrsA(ID : longword; Audioctrl : pAHIAudioCtrl; tagList : pTagItem) : BOOLEAN;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  ID,D0
-        MOVEA.L Audioctrl,A2
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -108(A6)
-        MOVEA.L (A7)+,A6
-        TST.W   D0
-        BEQ.B   @end
-        MOVEQ   #1,D0
-  @end: MOVE.B  D0,@RESULT
-  END;
-END;
-
-PROCEDURE AHI_KillAudio;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L AHIBase,A6
-        JSR     -054(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION AHI_LoadModeFile(a0arg : pCHAR) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a0arg,A0
-        MOVEA.L AHIBase,A6
-        JSR     -162(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_LoadSound(Sound : WORD; _Type : longword; Info : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Sound,D0
-        MOVE.L  _Type,D1
-        MOVEA.L Info,A0
-        MOVEA.L AudioCtrl,A2
-        MOVEA.L AHIBase,A6
-        JSR     -090(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_NextAudioID(Last_ID : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Last_ID,D0
-        MOVEA.L AHIBase,A6
-        JSR     -102(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE AHI_PlayA(Audioctrl : pAHIAudioCtrl; tagList : pTagItem);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Audioctrl,A2
-        MOVEA.L tagList,A1
-        MOVEA.L AHIBase,A6
-        JSR     -138(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION AHI_RemoveAudioMode(d0arg : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  d0arg,D0
-        MOVEA.L AHIBase,A6
-        JSR     -156(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_SampleFrameSize(SampleType : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  SampleType,D0
-        MOVEA.L AHIBase,A6
-        JSR     -144(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION AHI_SetEffect(Effect : POINTER; AudioCtrl : pAHIAudioCtrl) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Effect,A0
-        MOVEA.L AudioCtrl,A2
-        MOVEA.L AHIBase,A6
-        JSR     -084(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE AHI_SetFreq(Channel : WORD; Freq : longword; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Channel,D0
-        MOVE.L  Freq,D1
-        MOVEA.L AudioCtrl,A2
-        MOVE.L  Flags,D2
-        MOVEA.L AHIBase,A6
-        JSR     -072(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE AHI_SetSound(Channel : WORD; Sound : WORD; Offset : longword; len : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Channel,D0
-        MOVE.L  Sound,D1
-        MOVE.L  Offset,D2
-        MOVE.L  len,D3
-        MOVEA.L AudioCtrl,A2
-        MOVE.L  Flags,D4
-        MOVEA.L AHIBase,A6
-        JSR     -078(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE AHI_SetVol(Channel : WORD; Volume : LONGINT; Pan : LONGINT; AudioCtrl : pAHIAudioCtrl; Flags : longword);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Channel,D0
-        MOVE.L  Volume,D1
-        MOVE.L  Pan,D2
-        MOVEA.L AudioCtrl,A2
-        MOVE.L  Flags,D3
-        MOVEA.L AHIBase,A6
-        JSR     -066(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE AHI_UnloadSound(Sound : WORD; Audioctrl : pAHIAudioCtrl);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Sound,D0
-        MOVEA.L Audioctrl,A2
-        MOVEA.L AHIBase,A6
-        JSR     -096(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
 {
  Functions and procedures with array of const go here
 }

+ 22 - 359
packages/amunits/src/otherlibs/cybergraphics.pas

@@ -29,10 +29,6 @@
 }
 
 {$mode objfpc}
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
-   {$smartlink on}
-{$endif use_amiga_smartlink}
 
 UNIT CYBERGRAPHICS;
 
@@ -224,28 +220,28 @@ const
      BMB_SPECIALFMT = 7;
      BMF_SPECIALFMT = 1 shl BMB_SPECIALFMT;
 
-FUNCTION AllocCModeListTagList(ModeListTags : pTagItem) : pList;
-FUNCTION BestCModeIDTagList(BestModeIDTags : pTagItem) : longword;
-FUNCTION CModeRequestTagList(ModeRequest : POINTER; ModeRequestTags : pTagItem) : longword;
-PROCEDURE CVideoCtrlTagList(ViewPort : pViewPort; TagList : pTagItem);
-PROCEDURE DoCDrawMethodTagList(Hook : pHook; a1arg : pRastPort; TagList : pTagItem);
-FUNCTION ExtractColor(a0arg : pRastPort; BitMap : pBitMap; Colour : longword; SrcX : longword; SrcY : longword; Width : longword; Height : longword) : longword;
-FUNCTION FillPixelArray(a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; ARGB : longword) : longword;
-PROCEDURE FreeCModeList(ModeList : pList);
-FUNCTION GetCyberIDAttr(CyberIDAttr : longword; CyberDisplayModeID : longword) : longword;
-FUNCTION GetCyberMapAttr(CyberGfxBitmap : pBitMap; CyberAttrTag : longword) : longword;
-FUNCTION InvertPixelArray(a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD) : longword;
-FUNCTION IsCyberModeID(displayID : longword) : BOOLEAN;
-FUNCTION LockBitMapTagList(BitMap : POINTER; TagList : pTagItem) : POINTER;
-FUNCTION MovePixelArray(SrcX : WORD; SrcY : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD) : longword;
-FUNCTION ReadPixelArray(destRect : POINTER; destX : WORD; destY : WORD; destMod : WORD; a1arg : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD; DestFormat : byte) : longword;
-FUNCTION ReadRGBPixel(a1arg : pRastPort; x : WORD; y : WORD) : longword;
-FUNCTION ScalePixelArray(srcRect : POINTER; SrcW : WORD; SrcH : WORD; SrcMod : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; DestW : WORD; DestH : WORD; SrcFormat : byte) : LONGINT;
-PROCEDURE UnLockBitMap(Handle : POINTER);
-PROCEDURE UnLockBitMapTagList(Handle : POINTER; TagList : pTagItem);
-FUNCTION WriteLUTPixelArray(srcRect : POINTER; SrcX : WORD; SrcY : WORD; SrcMod : WORD; a1arg : pRastPort; ColorTab : POINTER; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; CTFormat : byte) : longword;
-FUNCTION WritePixelArray(srcRect : POINTER; SrcX : WORD; SrcY : WORD; SrcMod : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; SrcFormat : byte) : longword;
-FUNCTION WriteRGBPixel(a1arg : pRastPort; x : WORD; y : WORD; argb : longword) : LONGINT;
+FUNCTION AllocCModeListTagList(ModeListTags : pTagItem location 'a1') : pList; syscall CyberGfxBase 072;
+FUNCTION BestCModeIDTagList(BestModeIDTags : pTagItem location 'a0') : longword; syscall CyberGfxBase 060;
+FUNCTION CModeRequestTagList(ModeRequest : POINTER location 'a0'; ModeRequestTags : pTagItem location 'a1') : longword; syscall CyberGfxBase 066;
+PROCEDURE CVideoCtrlTagList(ViewPort : pViewPort location 'a0'; TagList : pTagItem location 'a1'); syscall CyberGfxBase 162;
+PROCEDURE DoCDrawMethodTagList(Hook : pHook location 'a0'; a1arg : pRastPort location 'a1'; TagList : pTagItem location 'a2'); syscall CyberGfxBase 156;
+FUNCTION ExtractColor(a0arg : pRastPort location 'a0'; BitMap : pBitMap location 'a1'; Colour : longword location 'd0'; SrcX : longword location 'd1'; SrcY : longword location 'd2'; Width : longword location 'd3'; Height : longword location 'd4') : longword; syscall CyberGfxBase 186;
+FUNCTION FillPixelArray(a1arg : pRastPort location 'a1'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; SizeX : WORD location 'd2'; SizeY : WORD location 'd3'; ARGB : longword location 'd4') : longword; syscall CyberGfxBase 150;
+PROCEDURE FreeCModeList(ModeList : pList location 'a0'); syscall CyberGfxBase 078;
+FUNCTION GetCyberIDAttr(CyberIDAttr : longword location 'd0'; CyberDisplayModeID : longword location 'd1') : longword; syscall CyberGfxBase 102;
+FUNCTION GetCyberMapAttr(CyberGfxBitmap : pBitMap location 'a0'; CyberAttrTag : longword location 'd0') : longword; syscall CyberGfxBase 096;
+FUNCTION InvertPixelArray(a1arg : pRastPort location 'a1'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; SizeX : WORD location 'd2'; SizeY : WORD location 'd3') : longword; syscall CyberGfxBase 144;
+FUNCTION IsCyberModeID(displayID : longword location 'd0') : wordbool; syscall CyberGfxBase 054;
+FUNCTION LockBitMapTagList(BitMap : POINTER location 'a0'; TagList : pTagItem location 'a1') : POINTER; syscall CyberGfxBase 168;
+FUNCTION MovePixelArray(SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd2'; DestY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5') : longword; syscall CyberGfxBase 132;
+FUNCTION ReadPixelArray(destRect : POINTER location 'a0'; destX : WORD location 'd0'; destY : WORD location 'd1'; destMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; SrcX : WORD location 'd3'; SrcY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; DestFormat : byte location 'd7') : longword; syscall CyberGfxBase 120;
+FUNCTION ReadRGBPixel(a1arg : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1') : longword; syscall CyberGfxBase 108;
+FUNCTION ScalePixelArray(srcRect : POINTER location 'a0'; SrcW : WORD location 'd0'; SrcH : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; DestW : WORD location 'd5'; DestH : WORD location 'd6'; SrcFormat : byte location 'd7') : LONGINT; syscall CyberGfxBase 090;
+PROCEDURE UnLockBitMap(Handle : POINTER location 'a0'); syscall CyberGfxBase 174;
+PROCEDURE UnLockBitMapTagList(Handle : POINTER location 'a0'; TagList : pTagItem location 'a1'); syscall CyberGfxBase 180;
+FUNCTION WriteLUTPixelArray(srcRect : POINTER location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; ColorTab : POINTER location 'a2'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; CTFormat : byte location 'd7') : longword; syscall CyberGfxBase 198;
+FUNCTION WritePixelArray(srcRect : POINTER location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; SrcMod : WORD location 'd2'; a1arg : pRastPort location 'a1'; DestX : WORD location 'd3'; DestY : WORD location 'd4'; SizeX : WORD location 'd5'; SizeY : WORD location 'd6'; SrcFormat : byte location 'd7') : longword; syscall CyberGfxBase 126;
+FUNCTION WriteRGBPixel(a1arg : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1'; argb : longword location 'd2') : LONGINT; syscall CyberGfxBase 114;
 {
  Functions and procedures with array of const go here
 }
@@ -277,339 +273,6 @@ amsgbox,
 {$endif dont_use_openlib}
 tagsarray;
 
-FUNCTION AllocCModeListTagList(ModeListTags : pTagItem) : pList;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ModeListTags,A1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -072(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION BestCModeIDTagList(BestModeIDTags : pTagItem) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BestModeIDTags,A0
-        MOVEA.L CyberGfxBase,A6
-        JSR     -060(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION CModeRequestTagList(ModeRequest : POINTER; ModeRequestTags : pTagItem) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ModeRequest,A0
-        MOVEA.L ModeRequestTags,A1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -066(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE CVideoCtrlTagList(ViewPort : pViewPort; TagList : pTagItem);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ViewPort,A0
-        MOVEA.L TagList,A1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -162(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE DoCDrawMethodTagList(Hook : pHook; a1arg : pRastPort; TagList : pTagItem);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Hook,A0
-        MOVEA.L a1arg,A1
-        MOVEA.L TagList,A2
-        MOVEA.L CyberGfxBase,A6
-        JSR     -156(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION ExtractColor(a0arg : pRastPort; BitMap : pBitMap; Colour : longword; SrcX : longword; SrcY : longword; Width : longword; Height : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a0arg,A0
-        MOVEA.L BitMap,A1
-        MOVE.L  Colour,D0
-        MOVE.L  SrcX,D1
-        MOVE.L  SrcY,D2
-        MOVE.L  Width,D3
-        MOVE.L  Height,D4
-        MOVEA.L CyberGfxBase,A6
-        JSR     -186(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION FillPixelArray(a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; ARGB : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a1arg,A1
-        MOVE.L  DestX,D0
-        MOVE.L  DestY,D1
-        MOVE.L  SizeX,D2
-        MOVE.L  SizeY,D3
-        MOVE.L  ARGB,D4
-        MOVEA.L CyberGfxBase,A6
-        JSR     -150(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE FreeCModeList(ModeList : pList);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ModeList,A0
-        MOVEA.L CyberGfxBase,A6
-        JSR     -078(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION GetCyberIDAttr(CyberIDAttr : longword; CyberDisplayModeID : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  CyberIDAttr,D0
-        MOVE.L  CyberDisplayModeID,D1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -102(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION GetCyberMapAttr(CyberGfxBitmap : pBitMap; CyberAttrTag : longword) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L CyberGfxBitmap,A0
-        MOVE.L  CyberAttrTag,D0
-        MOVEA.L CyberGfxBase,A6
-        JSR     -096(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION InvertPixelArray(a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a1arg,A1
-        MOVE.L  DestX,D0
-        MOVE.L  DestY,D1
-        MOVE.L  SizeX,D2
-        MOVE.L  SizeY,D3
-        MOVEA.L CyberGfxBase,A6
-        JSR     -144(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION IsCyberModeID(displayID : longword) : BOOLEAN;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  displayID,D0
-        MOVEA.L CyberGfxBase,A6
-        JSR     -054(A6)
-        MOVEA.L (A7)+,A6
-        TST.W   D0
-        BEQ.B   @end
-        MOVEQ   #1,D0
-  @end: MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION LockBitMapTagList(BitMap : POINTER; TagList : pTagItem) : POINTER;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BitMap,A0
-        MOVEA.L TagList,A1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -168(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION MovePixelArray(SrcX : WORD; SrcY : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  SrcX,D0
-        MOVE.L  SrcY,D1
-        MOVEA.L a1arg,A1
-        MOVE.L  DestX,D2
-        MOVE.L  DestY,D3
-        MOVE.L  SizeX,D4
-        MOVE.L  SizeY,D5
-        MOVEA.L CyberGfxBase,A6
-        JSR     -132(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION ReadPixelArray(destRect : POINTER; destX : WORD; destY : WORD; destMod : WORD; a1arg : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD; DestFormat : byte) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L destRect,A0
-        MOVE.L  destX,D0
-        MOVE.L  destY,D1
-        MOVE.L  destMod,D2
-        MOVEA.L a1arg,A1
-        MOVE.L  SrcX,D3
-        MOVE.L  SrcY,D4
-        MOVE.L  SizeX,D5
-        MOVE.L  SizeY,D6
-        MOVE.L  DestFormat,D7
-        MOVEA.L CyberGfxBase,A6
-        JSR     -120(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION ReadRGBPixel(a1arg : pRastPort; x : WORD; y : WORD) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a1arg,A1
-        MOVE.L  x,D0
-        MOVE.L  y,D1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -108(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION ScalePixelArray(srcRect : POINTER; SrcW : WORD; SrcH : WORD; SrcMod : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; DestW : WORD; DestH : WORD; SrcFormat : byte) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L srcRect,A0
-        MOVE.L  SrcW,D0
-        MOVE.L  SrcH,D1
-        MOVE.L  SrcMod,D2
-        MOVEA.L a1arg,A1
-        MOVE.L  DestX,D3
-        MOVE.L  DestY,D4
-        MOVE.L  DestW,D5
-        MOVE.L  DestH,D6
-        MOVE.L  SrcFormat,D7
-        MOVEA.L CyberGfxBase,A6
-        JSR     -090(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE UnLockBitMap(Handle : POINTER);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Handle,A0
-        MOVEA.L CyberGfxBase,A6
-        JSR     -174(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE UnLockBitMapTagList(Handle : POINTER; TagList : pTagItem);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Handle,A0
-        MOVEA.L TagList,A1
-        MOVEA.L CyberGfxBase,A6
-        JSR     -180(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION WriteLUTPixelArray(srcRect : POINTER; SrcX : WORD; SrcY : WORD; SrcMod : WORD; a1arg : pRastPort; ColorTab : POINTER; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; CTFormat : byte) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L srcRect,A0
-        MOVE.L  SrcX,D0
-        MOVE.L  SrcY,D1
-        MOVE.L  SrcMod,D2
-        MOVEA.L a1arg,A1
-        MOVEA.L ColorTab,A2
-        MOVE.L  DestX,D3
-        MOVE.L  DestY,D4
-        MOVE.L  SizeX,D5
-        MOVE.L  SizeY,D6
-        MOVE.L  CTFormat,D7
-        MOVEA.L CyberGfxBase,A6
-        JSR     -198(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION WritePixelArray(srcRect : POINTER; SrcX : WORD; SrcY : WORD; SrcMod : WORD; a1arg : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD; SrcFormat : byte) : longword;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L srcRect,A0
-        MOVE.L  SrcX,D0
-        MOVE.L  SrcY,D1
-        MOVE.L  SrcMod,D2
-        MOVEA.L a1arg,A1
-        MOVE.L  DestX,D3
-        MOVE.L  DestY,D4
-        MOVE.L  SizeX,D5
-        MOVE.L  SizeY,D6
-        MOVE.L  SrcFormat,D7
-        MOVEA.L CyberGfxBase,A6
-        JSR     -126(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION WriteRGBPixel(a1arg : pRastPort; x : WORD; y : WORD; argb : longword) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L a1arg,A1
-        MOVE.L  x,D0
-        MOVE.L  y,D1
-        MOVE.L  argb,D2
-        MOVEA.L CyberGfxBase,A6
-        JSR     -114(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
 {
  Functions and procedures with array of const go here
 }

+ 26 - 392
packages/amunits/src/otherlibs/picasso96api.pas

@@ -35,10 +35,6 @@
 
 }
 {$mode objfpc}
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
-    {$smartlink on}
-{$endif use_amiga_smartlink}
 
 UNIT PICASSO96API;
 
@@ -407,33 +403,32 @@ USES Exec, utility, agraphics, intuition;
 
 VAR P96Base : pLibrary;
 
-FUNCTION p96AllocBitMap(SizeX : Ulong; SizeY : Ulong; Depth : Ulong; Flags : Ulong; Friend : pBitMap; RGBFormat : RGBFTYPE) : pBitMap;
-PROCEDURE p96FreeBitMap(BitMap : pBitMap);
-FUNCTION p96GetBitMapAttr(BitMap : pBitMap; Attribute : Ulong) : Ulong;
-FUNCTION p96LockBitMap(BitMap : pBitMap; Buffer : pCHAR; Size : Ulong) : LONGINT;
-PROCEDURE p96UnlockBitMap(BitMap : pBitMap; Lock : LONGINT);
-FUNCTION p96BestModeIDTagList(Tags : pTagItem) : Ulong;
-FUNCTION p96RequestModeIDTagList(Tags : pTagItem) : Ulong;
-FUNCTION p96AllocModeListTagList(Tags : pTagItem) : pList;
-PROCEDURE p96FreeModeList(List : pList);
-FUNCTION p96GetModeIDAttr(Mode : Ulong; Attribute : Ulong) : Ulong;
-FUNCTION p96OpenScreenTagList(Tags : pTagItem) : pScreen;
-FUNCTION p96CloseScreen(Screen : pScreen) : BOOLEAN;
-PROCEDURE p96WritePixelArray(ri : pRenderInfo; SrcX : WORD; SrcY : WORD; rp : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD);
-PROCEDURE p96ReadPixelArray(ri : pRenderInfo; DestX : WORD; DestY : WORD; rp : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD);
-FUNCTION p96WritePixel(rp : pRastPort; x : WORD; y : WORD; color : Ulong) : Ulong;
-FUNCTION p96ReadPixel(rp : pRastPort; x : WORD; y : WORD) : Ulong;
-PROCEDURE p96RectFill(rp : pRastPort; MinX : WORD; MinY : WORD; MaxX : WORD; MaxY : WORD; color : Ulong);
-PROCEDURE p96WriteTrueColorData(tci : pTrueColorInfo; SrcX : WORD; SrcY : WORD; rp : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD);
-PROCEDURE p96ReadTrueColorData(tci : pTrueColorInfo; DestX : WORD; DestY : WORD; rp : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD);
-FUNCTION p96PIP_OpenTagList(Tags : pTagItem) : pWindow;
-FUNCTION p96PIP_Close(Window : pWindow) : BOOLEAN;
-FUNCTION p96PIP_SetTagList(Window : pWindow; Tags : pTagItem) : LONGINT;
-FUNCTION p96PIP_GetTagList(Window : pWindow; Tags : pTagItem) : LONGINT;
-FUNCTION p96GetRTGDataTagList(Tags : pTagItem) : LONGINT;
-FUNCTION p96GetBoardDataTagList(Board : Ulong; Tags : pTagItem) : LONGINT;
-FUNCTION p96EncodeColor(RGBFormat : RGBFTYPE; Color : Ulong) : Ulong;
-
+FUNCTION p96AllocBitMap(SizeX : Ulong location 'd0'; SizeY : Ulong location 'd1'; Depth : Ulong location 'd2'; Flags : Ulong location 'd3'; Friend : pBitMap location 'a0'; RGBFormat : RGBFTYPE location 'd7') : pBitMap; syscall P96Base 030;
+PROCEDURE p96FreeBitMap(BitMap : pBitMap location 'a0'); syscall P96Base 036;
+FUNCTION p96GetBitMapAttr(BitMap : pBitMap location 'a0'; Attribute : Ulong location 'd0') : Ulong; syscall P96Base 042;
+FUNCTION p96LockBitMap(BitMap : pBitMap location 'a0'; Buffer : pCHAR location 'a1'; Size : Ulong location 'd0') : LONGINT; syscall P96Base 048;
+PROCEDURE p96UnlockBitMap(BitMap : pBitMap location 'a0'; Lock : LONGINT location 'd0'); syscall P96Base 054;
+FUNCTION p96BestModeIDTagList(Tags : pTagItem location 'a0') : Ulong; syscall P96Base 060;
+FUNCTION p96RequestModeIDTagList(Tags : pTagItem location 'a0') : Ulong; syscall P96Base 066;
+FUNCTION p96AllocModeListTagList(Tags : pTagItem location 'a0') : pList; syscall P96Base 072;
+PROCEDURE p96FreeModeList(List : pList location 'a0'); syscall P96Base 078;
+FUNCTION p96GetModeIDAttr(Mode : Ulong location 'd0'; Attribute : Ulong location 'd1') : Ulong; syscall P96Base 084;
+FUNCTION p96OpenScreenTagList(Tags : pTagItem location 'a0') : pScreen; syscall P96Base 090;
+FUNCTION p96CloseScreen(Screen : pScreen location 'a0') : wordbool; syscall P96Base 096;
+PROCEDURE p96WritePixelArray(ri : pRenderInfo location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; rp : pRastPort location 'a1'; DestX : WORD location 'd2'; DestY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5'); syscall P96Base 102;
+PROCEDURE p96ReadPixelArray(ri : pRenderInfo location 'a0'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; rp : pRastPort location 'a1'; SrcX : WORD location 'd2'; SrcY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5'); syscall P96Base 108;
+FUNCTION p96WritePixel(rp : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1'; color : Ulong location 'd2') : Ulong; syscall P96Base 114;
+FUNCTION p96ReadPixel(rp : pRastPort location 'a1'; x : WORD location 'd0'; y : WORD location 'd1') : Ulong; syscall P96Base 120;
+PROCEDURE p96RectFill(rp : pRastPort location 'a1'; MinX : WORD location 'd0'; MinY : WORD location 'd1'; MaxX : WORD location 'd2'; MaxY : WORD location 'd3'; color : Ulong location 'd4'); syscall P96Base 126;
+PROCEDURE p96WriteTrueColorData(tci : pTrueColorInfo location 'a0'; SrcX : WORD location 'd0'; SrcY : WORD location 'd1'; rp : pRastPort location 'a1'; DestX : WORD location 'd2'; DestY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5'); syscall P96Base 132;
+PROCEDURE p96ReadTrueColorData(tci : pTrueColorInfo location 'a0'; DestX : WORD location 'd0'; DestY : WORD location 'd1'; rp : pRastPort location 'a1'; SrcX : WORD location 'd2';  SrcY : WORD location 'd3'; SizeX : WORD location 'd4'; SizeY : WORD location 'd5'); syscall P96Base 138;
+FUNCTION p96PIP_OpenTagList(Tags : pTagItem location 'a0') : pWindow; syscall P96Base 144;
+FUNCTION p96PIP_Close(Window : pWindow location 'a0') : wordbool; syscall P96Base 150;
+FUNCTION p96PIP_SetTagList(Window : pWindow location 'a0'; Tags : pTagItem location 'a1') : LONGINT; syscall P96Base 156;
+FUNCTION p96PIP_GetTagList(Window : pWindow location 'a0'; Tags : pTagItem location 'a1') : LONGINT; syscall P96Base 162;
+FUNCTION p96GetRTGDataTagList(Tags : pTagItem location 'a0') : LONGINT; syscall P96Base 180;
+FUNCTION p96GetBoardDataTagList(Board : Ulong location 'd0'; Tags : pTagItem location 'a0') : LONGINT; syscall P96Base 186;
+FUNCTION p96EncodeColor(RGBFormat : RGBFTYPE location 'd0'; Color : Ulong location 'd1') : Ulong; syscall P96Base 192;
 {
  Functions and procedures with array of const go here
 }
@@ -466,367 +461,6 @@ amsgbox,
 tagsarray;
 
 
-FUNCTION p96AllocBitMap(SizeX : Ulong; SizeY : Ulong; Depth : Ulong; Flags : Ulong; Friend : pBitMap; RGBFormat : RGBFTYPE) : pBitMap;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  SizeX,D0
-        MOVE.L  SizeY,D1
-        MOVE.L  Depth,D2
-        MOVE.L  Flags,D3
-        MOVEA.L Friend,A0
-        MOVE.L  RGBFormat,D7
-        MOVEA.L P96Base,A6
-        JSR     -030(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE p96FreeBitMap(BitMap : pBitMap);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BitMap,A0
-        MOVEA.L P96Base,A6
-        JSR     -036(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION p96GetBitMapAttr(BitMap : pBitMap; Attribute : Ulong) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BitMap,A0
-        MOVE.L  Attribute,D0
-        MOVEA.L P96Base,A6
-        JSR     -042(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96LockBitMap(BitMap : pBitMap; Buffer : pCHAR; Size : Ulong) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BitMap,A0
-        MOVEA.L Buffer,A1
-        MOVE.L  Size,D0
-        MOVEA.L P96Base,A6
-        JSR     -048(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE p96UnlockBitMap(BitMap : pBitMap; Lock : LONGINT);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L BitMap,A0
-        MOVE.L  Lock,D0
-        MOVEA.L P96Base,A6
-        JSR     -054(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION p96BestModeIDTagList(Tags : pTagItem) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -060(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96RequestModeIDTagList(Tags : pTagItem) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -066(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96AllocModeListTagList(Tags : pTagItem) : pList;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -072(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE p96FreeModeList(List : pList);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L List,A0
-        MOVEA.L P96Base,A6
-        JSR     -078(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION p96GetModeIDAttr(Mode : Ulong; Attribute : Ulong) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Mode,D0
-        MOVE.L  Attribute,D1
-        MOVEA.L P96Base,A6
-        JSR     -084(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96OpenScreenTagList(Tags : pTagItem) : pScreen;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -090(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96CloseScreen(Screen : pScreen) : BOOLEAN;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Screen,A0
-        MOVEA.L P96Base,A6
-        JSR     -096(A6)
-        MOVEA.L (A7)+,A6
-        TST.W   D0
-        BEQ.B   @end
-        MOVEQ   #1,D0
-  @end: MOVE.B  D0,@RESULT
-  END;
-END;
-
-PROCEDURE p96WritePixelArray(ri : pRenderInfo; SrcX : WORD; SrcY : WORD; rp : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ri,A0
-        MOVE.L  SrcX,D0
-        MOVE.L  SrcY,D1
-        MOVEA.L rp,A1
-        MOVE.L  DestX,D2
-        MOVE.L  DestY,D3
-        MOVE.L  SizeX,D4
-        MOVE.L  SizeY,D5
-        MOVEA.L P96Base,A6
-        JSR     -102(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE p96ReadPixelArray(ri : pRenderInfo; DestX : WORD; DestY : WORD; rp : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ri,A0
-        MOVE.L  DestX,D0
-        MOVE.L  DestY,D1
-        MOVEA.L rp,A1
-        MOVE.L  SrcX,D2
-        MOVE.L  SrcY,D3
-        MOVE.L  SizeX,D4
-        MOVE.L  SizeY,D5
-        MOVEA.L P96Base,A6
-        JSR     -108(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION p96WritePixel(rp : pRastPort; x : WORD; y : WORD; color : Ulong) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L rp,A1
-        MOVE.L  x,D0
-        MOVE.L  y,D1
-        MOVE.L  color,D2
-        MOVEA.L P96Base,A6
-        JSR     -114(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96ReadPixel(rp : pRastPort; x : WORD; y : WORD) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L rp,A1
-        MOVE.L  x,D0
-        MOVE.L  y,D1
-        MOVEA.L P96Base,A6
-        JSR     -120(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE p96RectFill(rp : pRastPort; MinX : WORD; MinY : WORD; MaxX : WORD; MaxY : WORD; color : Ulong);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L rp,A1
-        MOVE.L  MinX,D0
-        MOVE.L  MinY,D1
-        MOVE.L  MaxX,D2
-        MOVE.L  MaxY,D3
-        MOVE.L  color,D4
-        MOVEA.L P96Base,A6
-        JSR     -126(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE p96WriteTrueColorData(tci : pTrueColorInfo; SrcX : WORD; SrcY : WORD; rp : pRastPort; DestX : WORD; DestY : WORD; SizeX : WORD; SizeY : WORD);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L tci,A0
-        MOVE.L  SrcX,D0
-        MOVE.L  SrcY,D1
-        MOVEA.L rp,A1
-        MOVE.L  DestX,D2
-        MOVE.L  DestY,D3
-        MOVE.L  SizeX,D4
-        MOVE.L  SizeY,D5
-        MOVEA.L P96Base,A6
-        JSR     -132(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE p96ReadTrueColorData(tci : pTrueColorInfo; DestX : WORD; DestY : WORD; rp : pRastPort; SrcX : WORD; SrcY : WORD; SizeX : WORD; SizeY : WORD);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L tci,A0
-        MOVE.L  DestX,D0
-        MOVE.L  DestY,D1
-        MOVEA.L rp,A1
-        MOVE.L  SrcX,D2
-        MOVE.L  SrcY,D3
-        MOVE.L  SizeX,D4
-        MOVE.L  SizeY,D5
-        MOVEA.L P96Base,A6
-        JSR     -138(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION p96PIP_OpenTagList(Tags : pTagItem) : pWindow;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -144(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96PIP_Close(Window : pWindow) : BOOLEAN;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Window,A0
-        MOVEA.L P96Base,A6
-        JSR     -150(A6)
-        MOVEA.L (A7)+,A6
-        TST.W   D0
-        BEQ.B   @end
-        MOVEQ   #1,D0
-  @end: MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96PIP_SetTagList(Window : pWindow; Tags : pTagItem) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Window,A0
-        MOVEA.L Tags,A1
-        MOVEA.L P96Base,A6
-        JSR     -156(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96PIP_GetTagList(Window : pWindow; Tags : pTagItem) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Window,A0
-        MOVEA.L Tags,A1
-        MOVEA.L P96Base,A6
-        JSR     -162(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96GetRTGDataTagList(Tags : pTagItem) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -180(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96GetBoardDataTagList(Board : Ulong; Tags : pTagItem) : LONGINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Board,D0
-        MOVEA.L Tags,A0
-        MOVEA.L P96Base,A6
-        JSR     -186(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION p96EncodeColor(RGBFormat : RGBFTYPE; Color : Ulong) : Ulong;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  RGBFormat,D0
-        MOVE.L  Color,D1
-        MOVEA.L P96Base,A6
-        JSR     -192(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
 
 
 {

+ 35 - 333
packages/amunits/src/otherlibs/ptreplay.pas

@@ -31,11 +31,6 @@
 
 }
 
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
-   {$smartlink on}
-{$endif use_amiga_smartlink}
-
 UNIT ptreplay;
 
 INTERFACE
@@ -66,32 +61,32 @@ USES Exec;
 
 VAR PTReplayBase : pLibrary;
 
-FUNCTION PTLoadModule(name : pCHAR) : pModule;
-PROCEDURE PTUnloadModule(module : pModule);
-FUNCTION PTPlay(module : pModule) : ULONG;
-FUNCTION PTStop(module : pModule) : ULONG;
-FUNCTION PTPause(module : pModule) : ULONG;
-FUNCTION PTResume(module : pModule) : ULONG;
-PROCEDURE PTFade(module : pModule; speed : BYTE);
-PROCEDURE PTSetVolume(module : pModule; vol : BYTE);
-FUNCTION PTSongPos(module : pModule) : BYTE;
-FUNCTION PTSongLen(module : pModule) : BYTE;
-FUNCTION PTSongPattern(module : pModule; Pos : WORD) : BYTE;
-FUNCTION PTPatternPos(Module : pModule) : BYTE;
-FUNCTION PTPatternData(Module : pModule; Pattern : BYTE; Row : BYTE) : POINTER;
-PROCEDURE PTInstallBits(Module : pModule; Restart : SHORTINT; NextPattern : SHORTINT; NextRow : SHORTINT; Fade : SHORTINT);
-FUNCTION PTSetupMod(ModuleFile : POINTER) : pModule;
-PROCEDURE PTFreeMod(Module : pModule);
-PROCEDURE PTStartFade(Module : pModule; speed : BYTE);
-PROCEDURE PTOnChannel(Module : pModule; Channels : SHORTINT);
-PROCEDURE PTOffChannel(Module : pModule; Channels : SHORTINT);
-PROCEDURE PTSetPos(Module : pModule; Pos : BYTE);
-PROCEDURE PTSetPri(Pri : SHORTINT);
-FUNCTION PTGetPri : SHORTINT;
-FUNCTION PTGetChan : SHORTINT;
-FUNCTION PTGetSample(Module : pModule; Nr : smallint) : pPTSample;
-
-FUNCTION PTLoadModule(name : string) : pModule;
+FUNCTION PTLoadModule(name : pCHAR location 'a0') : pModule; syscall PTReplayBase 030;
+PROCEDURE PTUnloadModule(module : pModule location 'a0'); syscall PTReplayBase 036;
+FUNCTION PTPlay(module : pModule location 'a0') : ULONG; syscall PTReplayBase 042;
+FUNCTION PTStop(module : pModule location 'a0') : ULONG; syscall PTReplayBase 048;
+FUNCTION PTPause(module : pModule location 'a0') : ULONG; syscall PTReplayBase 054;
+FUNCTION PTResume(module : pModule location 'a0') : ULONG; syscall PTReplayBase 060;
+PROCEDURE PTFade(module : pModule location 'a0'; speed : BYTE location 'd0'); syscall PTReplayBase 066;
+PROCEDURE PTSetVolume(module : pModule location 'a0'; vol : BYTE location 'd0'); syscall PTReplayBase 072;
+FUNCTION PTSongPos(module : pModule location 'a0') : BYTE; syscall PTReplayBase 078;
+FUNCTION PTSongLen(module : pModule location 'a0') : BYTE; syscall PTReplayBase 084;
+FUNCTION PTSongPattern(module : pModule location 'a0'; Pos : WORD location 'd0') : BYTE; syscall PTReplayBase 090;
+FUNCTION PTPatternPos(Module : pModule location 'a0') : BYTE; syscall PTReplayBase 096;
+FUNCTION PTPatternData(Module : pModule location 'a0'; Pattern : BYTE location 'd0'; Row : BYTE location 'd1') : POINTER; syscall PTReplayBase 102;
+PROCEDURE PTInstallBits(Module : pModule location 'a0'; Restart : SHORTINT location 'd0'; NextPattern : SHORTINT location 'd1'; NextRow : SHORTINT location 'd2'; Fade : SHORTINT location 'd3'); syscall PTReplayBase 108;
+FUNCTION PTSetupMod(ModuleFile : POINTER location 'a0') : pModule; syscall PTReplayBase 114;
+PROCEDURE PTFreeMod(Module : pModule location 'a0'); syscall PTReplayBase 120;
+PROCEDURE PTStartFade(Module : pModule location 'a0'; speed : BYTE location 'd0'); syscall PTReplayBase 126;
+PROCEDURE PTOnChannel(Module : pModule location 'a0'; Channels : SHORTINT location 'd0'); syscall PTReplayBase 132;
+PROCEDURE PTOffChannel(Module : pModule location 'a0'; Channels : SHORTINT location 'd0'); syscall PTReplayBase 138;
+PROCEDURE PTSetPos(Module : pModule location 'a0'; Pos : BYTE location 'd0'); syscall PTReplayBase 144;
+PROCEDURE PTSetPri(Pri : SHORTINT location 'd0'); syscall PTReplayBase 150;
+FUNCTION PTGetPri : SHORTINT; syscall PTReplayBase 156;
+FUNCTION PTGetChan : SHORTINT; syscall PTReplayBase 162;
+FUNCTION PTGetSample(Module : pModule location 'a0'; Nr : smallint location 'd0') : pPTSample; syscall PTReplayBase 168;
+
+FUNCTION PTLoadModule(const name : String) : pModule;
 
 {You can remove this include and use a define instead}
 {$I useautoopenlib.inc}
@@ -105,305 +100,18 @@ var
 
 IMPLEMENTATION
 
-uses
 {$ifndef dont_use_openlib}
-amsgbox,
+uses
+  amsgbox;
 {$endif dont_use_openlib}
-pastoc;
-
-FUNCTION PTLoadModule(name : pCHAR) : pModule;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L name,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -030(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE PTUnloadModule(module : pModule);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -036(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION PTPlay(module : pModule) : ULONG;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -042(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTStop(module : pModule) : ULONG;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -048(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTPause(module : pModule) : ULONG;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -054(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTResume(module : pModule) : ULONG;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -060(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE PTFade(module : pModule; speed : BYTE);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVE.L  speed,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -066(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTSetVolume(module : pModule; vol : BYTE);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVE.L  vol,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -072(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION PTSongPos(module : pModule) : BYTE;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -078(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTSongLen(module : pModule) : BYTE;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -084(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTSongPattern(module : pModule; Pos : WORD) : BYTE;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L module,A0
-        MOVE.L  Pos,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -090(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTPatternPos(Module : pModule) : BYTE;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -096(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTPatternData(Module : pModule; Pattern : BYTE; Row : BYTE) : POINTER;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  Pattern,D0
-        MOVE.L  Row,D1
-        MOVEA.L PTReplayBase,A6
-        JSR     -102(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE PTInstallBits(Module : pModule; Restart : SHORTINT; NextPattern : SHORTINT; NextRow : SHORTINT; Fade : SHORTINT);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  Restart,D0
-        MOVE.L  NextPattern,D1
-        MOVE.L  NextRow,D2
-        MOVE.L  Fade,D3
-        MOVEA.L PTReplayBase,A6
-        JSR     -108(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION PTSetupMod(ModuleFile : POINTER) : pModule;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L ModuleFile,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -114(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-PROCEDURE PTFreeMod(Module : pModule);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVEA.L PTReplayBase,A6
-        JSR     -120(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTStartFade(Module : pModule; speed : BYTE);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  speed,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -126(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTOnChannel(Module : pModule; Channels : SHORTINT);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  Channels,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -132(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTOffChannel(Module : pModule; Channels : SHORTINT);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  Channels,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -138(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTSetPos(Module : pModule; Pos : BYTE);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.L  Pos,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -144(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-PROCEDURE PTSetPri(Pri : SHORTINT);
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVE.L  Pri,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -150(A6)
-        MOVEA.L (A7)+,A6
-  END;
-END;
-
-FUNCTION PTGetPri : SHORTINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L PTReplayBase,A6
-        JSR     -156(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTGetChan : SHORTINT;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L PTReplayBase,A6
-        JSR     -162(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.B  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTGetSample(Module : pModule; Nr : smallint) : pPTSample;
-BEGIN
-  ASM
-        MOVE.L  A6,-(A7)
-        MOVEA.L Module,A0
-        MOVE.W  Nr,D0
-        MOVEA.L PTReplayBase,A6
-        JSR     -168(A6)
-        MOVEA.L (A7)+,A6
-        MOVE.L  D0,@RESULT
-  END;
-END;
-
-FUNCTION PTLoadModule(name : string) : pModule;
+
+
+FUNCTION PTLoadModule(const name : string) : pModule;
+var
+  s: RawByteString;
 begin
-    PTLoadModule := PTLoadModule(pas2c(name));
+  s:=name;
+  PTLoadModule := PTLoadModule(PChar(s));
 end;
 
 const
@@ -489,9 +197,3 @@ begin
 
 
 END. (* UNIT PTREPLAY *)
-
-
-
-
-
-

+ 17 - 13
packages/amunits/src/utilunits/amsgbox.pas

@@ -28,13 +28,12 @@ unit AMsgBox;
 interface
 
 
-
-FUNCTION MessageBox(tit,txt,gad:string) : LONGint;
-function MessageBox(tit,txt,gad:pchar):longint;
+FUNCTION MessageBox(const tit,txt,gad:RawByteString): LongInt;
+FUNCTION MessageBox(const tit,txt,gad:string): LongInt;
+function MessageBox(const tit,txt,gad:pchar): LongInt;
 
 implementation
 
-uses pastoc;
 type
  pEasyStruct = ^tEasyStruct;
    tEasyStruct = record
@@ -48,21 +47,26 @@ type
 
 FUNCTION EasyRequestArgs(window : pointer location 'a0'; easyStruct : pEasyStruct location 'a1'; idcmpPtr : longint location 'a2'; args : POINTER location 'a3') : LONGINT; syscall _IntuitionBase 588;
 
-FUNCTION MessageBox(tit,txt,gad:string) : LONGint;
+FUNCTION MessageBox(const tit,txt,gad:RawByteString): LongInt;
+begin
+  MessageBox:=MessageBox(PChar(tit),PChar(txt),PChar(gad));
+end;
+
+FUNCTION MessageBox(const tit,txt,gad:string) : LONGint;
 begin
-    MessageBox := MessageBox(pas2c(tit),pas2c(txt),pas2c(gad));
+  MessageBox := MessageBox(PChar(RawByteString(tit)),PChar(RawByteString(txt)),PChar(RawByteString(gad)));
 end;
 
-FUNCTION MessageBox(tit,txt,gad:pchar) : LONGint;
+FUNCTION MessageBox(const tit,txt,gad:pchar) : LONGint;
 VAR
   MyStruct : tEasyStruct;
 BEGIN
- MyStruct.es_StructSize:=SizeOf(tEasyStruct);
- MyStruct.es_Flags:=0;
- MyStruct.es_Title:=(tit);
- MyStruct.es_TextFormat:=(txt);
- MyStruct.es_GadgetFormat:=(gad);
- MessageBox := EasyRequestArgs(nil,@MyStruct,0,NIL);
+  MyStruct.es_StructSize:=SizeOf(tEasyStruct);
+  MyStruct.es_Flags:=0;
+  MyStruct.es_Title:=(tit);
+  MyStruct.es_TextFormat:=(txt);
+  MyStruct.es_GadgetFormat:=(gad);
+  MessageBox := EasyRequestArgs(nil,@MyStruct,0,NIL);
 END;
 
 end.

+ 2 - 2
packages/morphunits/src/iffparse.pas

@@ -270,14 +270,14 @@ FUNCTION WriteChunkRecords(iff : pIFFHandle location 'a0'; const buf : POINTER l
 FUNCTION SeekChunkBytes(iff : pIFFHandle location 'a0'; numBytes : LONGINT location 'd0'; mode : LONGINT location 'd1') : LONGINT; syscall IFFParseBase 276;
 FUNCTION SeekChunkRecords(iff : pIFFHandle location 'a0'; bytesPerRecord : LONGINT location 'd0'; numRecords : LONGINT location 'd1'; mode : LONGINT location 'd2') : LONGINT; syscall IFFParseBase 282;
 
-Function Make_ID(str : String) : LONGINT;
+Function Make_ID(const str : String) : LONGINT;
 function InitIFFPARSELibrary: boolean;
 
 
 IMPLEMENTATION
 
 
-function Make_ID(str : String) : LONGINT;
+function Make_ID(const str : String) : LONGINT;
 begin
   Make_ID := (LONGINT(Ord(Str[1])) shl 24) or
              (LONGINT(Ord(Str[2])) shl 16 ) or