home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsm / psionics / SysCalls.3 < prev    next >
Text File  |  1994-10-25  |  18KB  |  642 lines

  1. PSIONICS FILE - SYSCALLS.3
  2. ==========================
  3. System calls (part 3)
  4. Last modified 1994-09-06
  5. ========================
  6.  
  7. See part 1 for general notes and explanations.
  8.  
  9.  
  10.  
  11. Fn $8D is used for the Window Server, and is described in the Psionics file
  12. WSERVER.
  13.  
  14.  
  15. Fn $8E Sub $00 to $10 control various parts of the hardware, and should not
  16. be used by OPL programs.
  17.  
  18.  
  19. Fn $8E Sub $11
  20. HwGetSupplyStatus
  21.     BX: 6 byte buffer
  22. Gets information about the power supply. The buffer is filled with the
  23. following data:
  24.   Offset  0 (word): main battery voltage in mV
  25.   Offset  2 (word): backup battery voltage in mV
  26.   Offset  4 (word): positive if external power is available, zero if not
  27.                     available, and negative if the detector is disabled
  28.                     because an SSD door is open.
  29. The returned voltages should be taken with a grain of salt: I have observed
  30. the following values:
  31.     1800: no main batteries
  32.     1800: low main batteries
  33.     2056: new main batteries
  34.     2300: no lithium battery
  35.     2556: lithium battery fitted
  36.  
  37.  
  38. Fn $8E Sub $12
  39. HwLcdContrastDelta
  40.     AL: step direction
  41. Alters the LCD contrast by one step, upwards if AL is between 0 and 127, and
  42. downwards if it is between 128 and 255 (all inclusive).
  43.  
  44.  
  45. Fn $8E Sub $13
  46. HwReadLcdContrast
  47.     AL: -> setting
  48. Gets the current LCD contrast setting. On a Series 3, only the bottom 4 bits
  49. are significant.
  50.  
  51.  
  52. Fn $8E Sub $14
  53. HwSwitchOff
  54.     CX: delay in quarter seconds
  55. Switches the machine off for the specified time, then back on again. The
  56. machine may also be turned on by external events. The delay must be at least
  57. 9 (2.25 seconds).
  58.  
  59.  
  60. Fn $8E Sub $15 should only be used by device drivers.
  61.  
  62.  
  63. Fn $8E Sub $16
  64. HwExit
  65.  
  66. Exits the emulation on PC systems; has no effect on actual Psion machines.
  67.  
  68.  
  69. Fn $8E Sub $17 to $1A should only be used by device drivers.
  70.  
  71.  
  72. Fn $8E Sub $1B
  73. HwGetPsuType
  74.     AL: -> PSU type
  75. Gets the PSU type: 0 = original, 1 = "Maxim", 2 = "Pan", 3 = Series 3.
  76.  
  77.  
  78. Fn $8E Sub $1C
  79. HwSupplyWarnings
  80.     BX: 8 byte buffer
  81. Gets information about the power supply. The buffer is filled with the
  82. following data:
  83.   Offset  0 (word): main battery good voltage threshold in mV
  84.   Offset  2 (word): backup battery good voltage threshold in mV
  85.   Offset  4 (word): main battery nominal maximum voltage in mV
  86.   Offset  6 (word): backup battery nominal maximum voltage in mV
  87. The values will depend on the battery type set by GenSetBatteryType.
  88.  
  89.  
  90. Fn $8E Sub $1D
  91. HwForceSupplyReading
  92. @No documentation available at present@
  93.  
  94.  
  95. Fn $8E Sub $1E
  96. HwGetBackLight
  97.     AX: -> current value
  98. On systems fitted with a backlight, this value indicates control of the
  99. backlight function. If the top bit is set, the operating system will ignore
  100. the backlight toggle key. The remaining bits give the auto-light-off time in
  101. ticks (1/32 second); zero means that auto-light-off is disabled.
  102.  
  103.  
  104. Fn $8E Sub $1F
  105. HwSetBackLight
  106.     BX: new value
  107. Sets the backlight control value (see HwGetBackLight).
  108.  
  109.  
  110. Fn $8E Sub $20
  111. HwBackLight fails
  112.     AL: action -> status before call
  113. This call fails if no backlight is fitted. Otherwise, the actions are:
  114.     0 = switch backlight off
  115.     1 = switch backlight on
  116.     2 = toggle backlight
  117.     3 = no action
  118. The status returned is that of the backlight before the call: 0 = off, 1 = on.
  119.  
  120.  
  121. Fn $8E Sub $21 controls various parts of the hardware, and should not be used
  122. by OPL programs.
  123.  
  124.  
  125. Fn $8E Sub $22
  126. HwSupplyInfo v3
  127.     BX: 22 byte buffer
  128. Fills the buffer with additional information about the power supply:
  129.   Offset  0 (byte): main battery status:
  130.     0 = not present
  131.     1 = very low voltage
  132.     2 = low voltage
  133.     3 = good voltage
  134.   Offset  1 (byte): worst main battery status since batteries last inserted
  135.   Offset  2 (byte): non-zero if backup battery voltage is good
  136.   Offset  3 (byte): non-zero if external supply is present
  137.   Offset  4 (word): warning flags
  138.     Bit 0: set if power supply too low for sound
  139.     Bit 1: set if power supply too low to use flash
  140.     Bit 2: set   if offset 6 changed because system clock changed
  141.            clear if offset 6 changed because the batteries were changed
  142.   Offset  6 (long): abstime when batteries inserted
  143.   Offset 10 (long): ticks running on battery
  144.   Offset 14 (long): ticks running on external supply
  145.   Offset 18 (long): mA-ticks (i.e. mAhours * 60 * 60 * 32)
  146.  
  147.  
  148. Fn $8E Sub $28
  149. HwGetScanCodes v3
  150.     BX: 20 byte buffer
  151. The buffer is filled with information describing the state of each key on
  152. the keyboard. For the Series 3a, the offset and bit for each key are given
  153. in the following table ("2:4" means offset 2, bit 4).
  154.     System   9:1  Esc     15:0  Delete   4:0  1 14:1  A 12:2  N  0:6
  155.     Data     7:1  Tab      0:2  Enter    0:0  2 14:2  B  8:6  O  4:5
  156.     Word    11:1  Control  4:7  ShiftR   6:7  3 10:6  C 10:3  P  2:5
  157.     Agenda   3:1  ShiftL   2:7  Up      14:5  4  8:2  D 10:4  Q 12:1
  158.     Time     1:1  Psion    0:7  Left     0:4  5  8:3  E 10:5  R  8:1
  159.     World    5:1  Menu    10:7  Down     0:5  6 14:3  F 10:1  S 12:4
  160.     Calc     3:0  Diamond  8:7  Right    0:1  7  6:6  G  8:5  T  8:4
  161.     Sheet    1:0  Space    8:0  Help     6:2  8  4:3  H 14:6  U  6:5
  162.     + and =  2:3  - and _  2:2                9  4:4  I  4:2  V 10:2
  163.     * and :  2:6  / and ;  2:1                0  2:4  J  6:4  W 12:5
  164.     , and <  6:1  . and > 14:4                        K  4:1  X 12:6
  165.                                                       L  4:6  Y  0:3
  166.                                                       M  6:3  Z 12:3
  167.  
  168.  
  169. Fn $8F
  170. GenDataSegment
  171.  
  172. This call is only useful in assembler code; it sets ES to point to the start
  173. of the kernel data space (accessible in OPL using GenGetOsData).
  174.  
  175.  
  176. Fn $90
  177. ProcPanic
  178.     AL: reason
  179. Panic the current process; this call never returns.
  180.  
  181.  
  182. Fn $91
  183. ProcCopyFromById fails
  184.     BX: process ID
  185.     CX: number of bytes to copy
  186.     SI: remote address of first byte to copy
  187.     DI: local address of first byte to copy
  188. Copy a number of bytes from the indicated process to the current process.
  189.  
  190.  
  191. Fn $92
  192. ProcCopyToById fails
  193.     BX: process ID
  194.     CX: number of bytes to copy
  195.     SI: local address of first byte to copy
  196.     DI: remote address of first byte to copy
  197. Copies a number of bytes from the current process to the indicated process.
  198.  
  199.  
  200. Fn $93
  201. CharIsDigit
  202. Fn $94
  203. CharIsHexDigit
  204. Fn $95
  205. CharIsPrintable
  206. Fn $96
  207. CharIsAlphabetic
  208. Fn $97
  209. CharIsAlphaNumeric
  210. Fn $98
  211. CharIsUpperCase
  212. Fn $99
  213. CharIsLowerCase
  214. Fn $9A
  215. CharIsSpace
  216. Fn $9B
  217. CharIsPunctuation
  218. Fn $9C
  219. CharIsGraphic
  220. Fn $9D
  221. CharIsControl
  222.     AL: character to test
  223.     EQ: -> set if test fails, clear if test succeeds
  224. Tests to see whether the character has the indicated property. These functions
  225. are language dependent.
  226.  
  227.  
  228. Fn $9E
  229. CharToUpperChar
  230. Fn $9F
  231. CharToLowerChar
  232. Fn $A0
  233. CharToFoldedChar
  234.     AL: character 1 -> converted character 1
  235.     AH: character 2 -> converted character 2
  236. Converts two characters to uppercase, lowercase, or folded (uppercase with no
  237. accents). These functions are language dependent.
  238.  
  239.  
  240. Fn $A1
  241. BufferCopy
  242.     CX: length to be copied
  243.     SI: address of "from" buffer
  244.     DI: address of "to" buffer
  245. Copies a number of bytes from one buffer to another. The case of the buffers
  246. overlapping is handled correctly.
  247.  
  248.  
  249. Fn $A2
  250. BufferSwap
  251.     CX: length to be swapped
  252.     SI: address of buffer 1
  253.     DI: address of buffer 2
  254. Swaps the contents of two buffers. The case of the buffers overlapping is
  255. handled correctly.
  256.  
  257.  
  258. Fn $A3
  259. BufferCompare
  260. Fn $A4
  261. BufferCompareFolded
  262.     BX: length of buffer 2
  263.     CX: length of buffer 1
  264.     SI: address of buffer 1
  265.     DI: address of buffer 2
  266.     UL: -> set if buffer 1 less than buffer 2
  267.     EQ: -> set if buffers are identical
  268. The contents of the two buffers are compared byte-for-byte, using unsigned
  269. comparisons, and the result flags set accordingly. BufferCompareFolded acts
  270. as if each character had been passed to CharToFoldedChar before comparison.
  271.  
  272.  
  273. Fn $A5
  274. BufferMatch fails
  275. Fn $A6
  276. BufferMatchFolded fails
  277.     CX: length of buffer
  278.     DX: length of pattern
  279.     SI: address of buffer
  280.     DI: address of pattern
  281. The buffer is searched to determine if the pattern occurs within it (using
  282. the usual wildcards); the call fails if it does not. BufferMatchFolded acts
  283. as if each character had been passed to CharToFoldedChar bef