summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-09-06 23:48:39 +0000
committerkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-09-06 23:48:39 +0000
commit30d1282892a3eaa756a7eb6bb6412f28d2b87476 (patch)
tree6610c54c6062c0126e92e355d4ce9142819774f1
parent64ef9d750cb7f49c389bb19c002dcd02abafd001 (diff)
downloadfpc-30d1282892a3eaa756a7eb6bb6412f28d2b87476.tar.gz
amunits: syscallified lowlevel unit
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@28610 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/amunits/src/coreunits/lowlevel.pas219
1 files changed, 16 insertions, 203 deletions
diff --git a/packages/amunits/src/coreunits/lowlevel.pas b/packages/amunits/src/coreunits/lowlevel.pas
index 7a7234b21f..77fe3fc730 100644
--- a/packages/amunits/src/coreunits/lowlevel.pas
+++ b/packages/amunits/src/coreunits/lowlevel.pas
@@ -31,11 +31,7 @@
nils.sjoholm@mailbox.swipnet.se
}
-
-{$I useamigasmartlink.inc}
-{$ifdef use_amiga_smartlink}
- {$smartlink on}
-{$endif use_amiga_smartlink}
+{$PACKRECORDS 2}
UNIT lowlevel;
@@ -267,22 +263,21 @@ Const
VAR LowLevelBase : pLibrary;
-FUNCTION AddKBInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-FUNCTION AddTimerInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-FUNCTION AddVBlankInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-FUNCTION ElapsedTime(context : pEClockVal) : ULONG;
-FUNCTION GetKey : ULONG;
-FUNCTION GetLanguageSelection : BYTE;
-PROCEDURE QueryKeys(queryArray : pKeyQuery; arraySize : ULONG);
-FUNCTION ReadJoyPort(port : ULONG) : ULONG;
-PROCEDURE RemKBInt(intHandle : POINTER);
-PROCEDURE RemTimerInt(intHandle : POINTER);
-PROCEDURE RemVBlankInt(intHandle : POINTER);
-FUNCTION SetJoyPortAttrsA(portNumber : ULONG;const tagList : pTagItem) : BOOLEAN;
-PROCEDURE StartTimerInt(intHandle : POINTER; timeInterval : ULONG; continuous : LONGINT);
-PROCEDURE StopTimerInt(intHandle : POINTER);
-FUNCTION SystemControlA(const tagList : pTagItem) : ULONG;
-
+FUNCTION AddKBInt(const intRoutine : POINTER location 'a0'; const intData : POINTER location 'a1') : POINTER; syscall LowLevelBase 060;
+FUNCTION AddTimerInt(const intRoutine : POINTER location 'a0'; const intData : POINTER location 'a1') : POINTER; syscall LowLevelBase 078;
+FUNCTION AddVBlankInt(const intRoutine : POINTER location 'a0'; const intData : POINTER location 'a1') : POINTER; syscall LowLevelBase 108;
+FUNCTION ElapsedTime(context : pEClockVal location 'a0') : ULONG; syscall LowLevelBase 102;
+FUNCTION GetKey : ULONG; syscall LowLevelBase 048;
+FUNCTION GetLanguageSelection : BYTE; syscall LowLevelBase 036;
+PROCEDURE QueryKeys(queryArray : pKeyQuery location 'a0'; arraySize : ULONG location 'd1'); syscall LowLevelBase 054;
+FUNCTION ReadJoyPort(port : ULONG location 'd0') : ULONG; syscall LowLevelBase 030;
+PROCEDURE RemKBInt(intHandle : POINTER location 'a1'); syscall LowLevelBase 066;
+PROCEDURE RemTimerInt(intHandle : POINTER location 'a1'); syscall LowLevelBase 084;
+PROCEDURE RemVBlankInt(intHandle : POINTER location 'a1'); syscall LowLevelBase 114;
+FUNCTION SetJoyPortAttrsA(portNumber : ULONG location 'd0'; const tagList : pTagItem location 'a1') : BOOLEAN; syscall LowLevelBase 132;
+PROCEDURE StartTimerInt(intHandle : POINTER location 'a1'; timeInterval : ULONG location 'd0'; continuous : LONGINT location 'd1'); syscall LowLevelBase 096;
+PROCEDURE StopTimerInt(intHandle : POINTER location 'a1'); syscall LowLevelBase 090;
+FUNCTION SystemControlA(const tagList : pTagItem location 'a1') : ULONG; syscall LowLevelBase 072;
{Here we read how to compile this unit}
{You can remove this include and use a define instead}
@@ -301,188 +296,6 @@ IMPLEMENTATION
uses amsgbox;
{$endif dont_use_openlib}
-FUNCTION AddKBInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intRoutine,A0
- MOVEA.L intData,A1
- MOVEA.L LowLevelBase,A6
- JSR -060(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-FUNCTION AddTimerInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intRoutine,A0
- MOVEA.L intData,A1
- MOVEA.L LowLevelBase,A6
- JSR -078(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-FUNCTION AddVBlankInt(const intRoutine : POINTER;const intData : POINTER) : POINTER;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intRoutine,A0
- MOVEA.L intData,A1
- MOVEA.L LowLevelBase,A6
- JSR -108(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-FUNCTION ElapsedTime(context : pEClockVal) : ULONG;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L context,A0
- MOVEA.L LowLevelBase,A6
- JSR -102(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-FUNCTION GetKey : ULONG;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L LowLevelBase,A6
- JSR -048(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-FUNCTION GetLanguageSelection : BYTE;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L LowLevelBase,A6
- JSR -036(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-PROCEDURE QueryKeys(queryArray : pKeyQuery; arraySize : ULONG);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L queryArray,A0
- MOVE.L arraySize,D1
- MOVEA.L LowLevelBase,A6
- JSR -054(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-FUNCTION ReadJoyPort(port : ULONG) : ULONG;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVE.L port,D0
- MOVEA.L LowLevelBase,A6
- JSR -030(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
-PROCEDURE RemKBInt(intHandle : POINTER);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intHandle,A1
- MOVEA.L LowLevelBase,A6
- JSR -066(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-PROCEDURE RemTimerInt(intHandle : POINTER);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intHandle,A1
- MOVEA.L LowLevelBase,A6
- JSR -084(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-PROCEDURE RemVBlankInt(intHandle : POINTER);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intHandle,A1
- MOVEA.L LowLevelBase,A6
- JSR -114(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-FUNCTION SetJoyPortAttrsA(portNumber : ULONG;const tagList : pTagItem) : BOOLEAN;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVE.L portNumber,D0
- MOVEA.L tagList,A1
- MOVEA.L LowLevelBase,A6
- JSR -132(A6)
- MOVEA.L (A7)+,A6
- TST.W D0
- BEQ.B @end
- MOVEQ #1,D0
- @end: MOVE.B D0,@RESULT
- END;
-END;
-
-PROCEDURE StartTimerInt(intHandle : POINTER; timeInterval : ULONG; continuous : LONGINT);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intHandle,A1
- MOVE.L timeInterval,D0
- MOVE.L continuous,D1
- MOVEA.L LowLevelBase,A6
- JSR -096(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-PROCEDURE StopTimerInt(intHandle : POINTER);
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L intHandle,A1
- MOVEA.L LowLevelBase,A6
- JSR -090(A6)
- MOVEA.L (A7)+,A6
- END;
-END;
-
-FUNCTION SystemControlA(const tagList : pTagItem) : ULONG;
-BEGIN
- ASM
- MOVE.L A6,-(A7)
- MOVEA.L tagList,A1
- MOVEA.L LowLevelBase,A6
- JSR -072(A6)
- MOVEA.L (A7)+,A6
- MOVE.L D0,@RESULT
- END;
-END;
-
const
{ Change VERSION and LIBVERSION to proper values }