home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / Ti / Magazine / Tests / DOORSOSD.ZIP / userlib.h < prev    next >
Encoding:
Text File  |  1999-07-16  |  6.4 KB  |  203 lines

  1. userlib::idle_loop      equ     userlib@0000
  2. ;------------------------------------------------------------
  3. ; Waits for a key input and returns the keycode value in d0
  4. ; Supports APD and shuts down if user presses <DIAMOND>+<ON>
  5. ;------------------------------------------------------------
  6.  
  7. userlib::random        equ    userlib@0001
  8. ;----------------------------------------------------------------------------
  9. ; random(void)
  10. ;
  11. ; Function: Return a pseudorandom number
  12. ;
  13. ; input:  D0.W = upper limit
  14. ; output: D0.W = random number in [0..limit-1]
  15. ;----------------------------------------------------------------------------
  16.  
  17. userlib::rand_seed    equ    userlib@0002
  18. ;----------------------------------------------------------------------------
  19. ; WORD rand_seed
  20. ;
  21. ; Random seed used by random(). You may store values to it to initialize
  22. ; the random number seed.
  23. ;----------------------------------------------------------------------------
  24.  
  25.  
  26. userlib::exec        equ    userlib@0003
  27. ;----------------------------------------------------------------------------
  28. ;executes a program
  29. ;the parameter for this function is pushed on the stack
  30. ;input:    the handle of the program to execute
  31. ;output: d0.w = result
  32. ;
  33. ;Here are d0 values as result:
  34. ;0 -> everything is alright
  35. ;1 -> Not enough memory
  36. ;2 -> Lib not found
  37. ;3 -> Wrong lib version
  38. ;4 -> File format is not valid
  39. ;5 -> File is in use
  40. ;other -> file was not a Doors OS file but was run.
  41. ;----------------------------------------------------------------------------
  42.  
  43. userlib::FindSymEntry    equ    userlib@0004
  44. userlib::DrawCharXY        equ    userlib@0005
  45.  
  46. userlib::InputStr        equ    userlib@0006
  47. ;---------------------------------------------------------------------
  48. ; InputStr(x,y,maxchar)
  49. ;
  50. ;   Inputs a string at x,y
  51. ;
  52. ;Input:    d1.w = x
  53. ;    d2.w = y
  54. ;    d3.w = maxchar
  55. ;
  56. ;Output: d0.w = string lenght
  57. ;     a0.l = adress of the string
  58. ;---------------------------------------------------------------------
  59.  
  60. userlib::getpassword        equ    userlib@0007
  61. ;---------------------------------------------------------------------
  62. ;getpassword(void)
  63. ;
  64. ;   Asks for the Doors password and return in d1 the result
  65. ;
  66. ;Input: nothing
  67. ;
  68. ;Output: d1.w = 0  -> Good password
  69. ;    Otherwise the password was bad.
  70. ;
  71. ;    NO OTHER REGISTERS DETROYED
  72. ;---------------------------------------------------------------------
  73.  
  74. userlib::changepass        equ    userlib@0008
  75. ;---------------------------------------------------------------------
  76. ;changepass(void)
  77. ;
  78. ;   Asks for the old Doors password and if it is good, asks for a new Doors password
  79. ;
  80. ;Input and Output: nothing
  81. ;
  82. ;   NO REGISTERS DESTROYED
  83. ;---------------------------------------------------------------------
  84.  
  85. userlib::lockcalc        equ    userlib@0009
  86. ;---------------------------------------------------------------------
  87. ;lockcalc(void)
  88. ;
  89. ;   Turn off the calculator. When turned on, the Doors password is asked.
  90. ;    If the password is bad, the calc is turned off again.
  91. ;
  92. ;Input: nothing
  93. ;
  94. ;Output: d4=0 -> screen wasn't restored
  95. ;
  96. ;   NO OTHER REGISTERS DESTROYED
  97. ;
  98. ;NOTE:this function requires 3840 bytes free (2000 on a 89) to save the screen
  99. ;and later restore it. If there isn't place enough, the screen wont'be restored.
  100. ;---------------------------------------------------------------------
  101.  
  102. userlib::idle_hot        equ    userlib@000A
  103. ;---------------------------------------------------------------------
  104. ;idle_hot(void)
  105. ;
  106. ;   Same as idle_loop but:
  107. ;    -pressing the F7 (Home on the 89) key will protect your calc by turning off 
  108. ;    and asking for a password
  109. ;    -pressing the F8 (Mode on the 89) key will turn off your calc
  110. ;
  111. ;Input: nothing
  112. ;
  113. ;Output: d0.w = getkey code of key pressed
  114. ;    NO OTHER REGISTERS DETROYED
  115. ;---------------------------------------------------------------------
  116.  
  117. userlib::getfreeRAM        equ    userlib@000B
  118. ;---------------------------------------------------------------------
  119. ;  getfreeRAM(void)
  120. ;
  121. ;    returns the free memory, in bytes
  122. ;
  123. ;Input: nothing
  124. ;
  125. ;Output: d0.l = number of bytes free in memory
  126. ;
  127. ;    NO OTHER REGISTERS DESTROYED
  128. ;---------------------------------------------------------------------
  129.  
  130. userlib::smallmenu        equ    userlib@000C
  131. ;-------------------------------------------------------
  132. ; smallmenu(x,y,nbitem,txtlist)
  133. ;
  134. ;    Draws a small menu. Automatically adjusts width and height of the menu, taking into account the current font, the width and the height of the text
  135. ;    This function restores the part of the screen it takes,
  136. ;  so you don't have to redraw it.
  137. ;
  138. ;Input:
  139. ;    d0.w = x
  140. ;    d1.w = y
  141. ;    d2.b = nbitem
  142. ;    a0.l = string list; adding an extra null byte between 2 strings will force
  143. ;        smallmenu to draw an horizontal line.
  144. ;
  145. ;Output:
  146. ;    d0.w = Selected Item
  147. ;    d1.w = Last key pressed
  148. ;    d2.w = 0  -> ENTER pressed
  149. ;        Otherwise, another key has been pressed
  150. ;If there is not enough memory to save the screen, the menu won't be displayed
  151. ;
  152. ;-------------------------------------------------------
  153.  
  154. userlib::getfreearchive        equ    userlib@000D
  155. ;---------------------------------------------------------------------
  156. ;  getfreearchive(void)
  157. ;
  158. ;    returns the free memory in archive, in bytes
  159. ;
  160. ;Input: nothing
  161. ;
  162. ;Output: d0.l = number of bytes free in archive memory
  163. ;
  164. ;    NO OTHER REGISTERS DESTROYED
  165. ;---------------------------------------------------------------------
  166.  
  167. userlib::set_APD            equ    userlib@000E
  168. ;---------------------------------------------------------------------
  169. ;  set_APD(short new_APD)
  170. ;
  171. ;    Sets the Auto Power Down timer to shut down the calc after <new_APD> seconds
  172. ;
  173. ;Input: d0.w = new_APD
  174. ;
  175. ;Output: nothing
  176. ;
  177. ;    NO REGISTERS DESTROYED
  178. ;---------------------------------------------------------------------
  179.  
  180. userlib::get_APD            equ    userlib@000F
  181. ;---------------------------------------------------------------------
  182. ;  short get_APD(void)
  183. ;
  184. ;    Gets the APD value (in seconds)
  185. ;
  186. ;Input: nothing
  187. ;
  188. ;Outut: d0.w = APD value
  189. ;
  190. ;    NO REGISTERS DESTROYED
  191. ;---------------------------------------------------------------------
  192.  
  193. userlib::runprog    equ    userlib@0010
  194. ;---------------------------------------------------------------------
  195. ;  short runprog(char* commandline)
  196. ;
  197. ;Input: the parameter is pushed on the stack, it is a pointer to 
  198. ;    an ASCII string containing the commandline to run
  199. ;  example: "main\doors()"
  200. ;Output: d0.w : error code. Zero means no error.
  201. ;
  202. ;---------------------------------------------------------------------
  203.