home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / wst!blz1.dms / in.adf / docs / rilibdocs.lha / RIAmosFuncLib.doc < prev    next >
Encoding:
Text File  |  1994-09-05  |  9.5 KB  |  306 lines

  1. Library Name:
  2.   riamosfunclib #75
  3.  
  4. Authors:
  5.   ReflectiveImages, 17 Mayles Road, Southsea, Portsmouth, Hampshire, UK PO4 8NP
  6.  
  7. OverView:
  8.   Renamed by me as not only is it funcy but cool for AMos converts.
  9.  
  10. Authors Docs:
  11.  
  12. Func Library v1.0
  13. =================
  14.  
  15. By Steven Matty
  16. ©1994 Reflective Images
  17.  
  18.   This library was written primarily to emulate the functions that were
  19. present in AM*S but not in Blitz Basic 2. It began life as a load of Blitz
  20. Statements but was then converted to high speed 680x0. The library will
  21. continually be expanded upon and free updates will be sent on request.
  22. If you decide to use any of the function please give me a little cred, not
  23. a lot, just something. Anyway, enough of this baloney....on with the
  24. command list. 
  25.  
  26.     success=Reserve(banknumber,length)
  27.     Erase(banknumber)
  28.     EraseAll
  29.     address.l=Start(banknumber)
  30.     length.l=Length(banknumber)
  31.     success=BLoad(filename$,banknumber/address[,length,offset])
  32.     success=BSave(filename$,banknumber/address,length)
  33.     success=PLoad(filename$,banknumber/address)
  34.     bytes.l=FileSize(filename$)
  35.     banknumber=NextBank
  36.     bytes.l=MemFree
  37.     value.l=Max(value1.l,value2.l)
  38.     value.l=Min(value1.l,value2.l)
  39.     value.l=XOR(value1.l,value2.l)
  40.     id.w=Lisa
  41.     Reboot
  42.     code.b=KeyCode
  43.     CopyByte sourceaddress.l,destaddress.l,numbytes.l
  44.     CopyWord sourceaddress.l,destaddress.l,numwords.l
  45.     CopyLong sourceaddress.l,destaddress.l,numlongs.l
  46.     FillMem sourceaddress.l,numberbytes.l[,bytevalue.l]
  47.     CacheOff
  48.     number.l=Timer
  49.     ResetTimer
  50.     success=Rename(source$,dest$)
  51.     success=MakeDir(dirname$)
  52.     tagnumber.l=GTTagValue[(tagnumber)]
  53.     success=CludgeShapes(shapenum#,numshapes,address)
  54.     success=CludgeSound(soundnumber,address)
  55.  
  56. ********************************* NOTE **************************************
  57. * VALID BANKS RANGE FROM 0-49 INCLUSIVE. DO NOT USE A VALUE GREATER THAN 49 *
  58. * OR IT WILL BE INTERPRETED AS AN ADDRESS RATHER THAN A BANKNUMBER          *
  59. *****************************************************************************
  60.  
  61. Function: Reserve
  62. --------------------------------------------------------------------------------
  63. Mode   : Amiga/Blitz
  64. Syntax : success=Reserve(banknumber,length)
  65.  
  66.   This will attempt to reserve <length> bytes of memory. If succesfull,
  67. it will return the address of the bank. If unsuccessfull, 0 is returned.
  68. Banks are limited by the Compiler Options Menu.
  69.  
  70.  
  71. Statement: Erase
  72. --------------------------------------------------------------------------------
  73. Mode   : Amiga/Blitz
  74. Syntax : Erase(banknumber)
  75.  
  76.   The Erase command will erase the specified memory bank.
  77.  
  78.  
  79. Statement: EraseAll
  80. --------------------------------------------------------------------------------
  81. Mode   : Amiga/Blitz
  82. Syntax : EraseAll
  83.  
  84.   This command will erase ALL allocated memory banks.
  85.  
  86.  
  87. Function: BLoad
  88. --------------------------------------------------------------------------------
  89. Mode   : Amiga
  90. Syntax : success=BLoad(filename$,bank/address[,length,offset,memtype])
  91.  
  92.   If bank is specified, then the file is loaded into that bank. If address
  93. is specified then it is loaded to the address. Valid banks are 0-49. 
  94. If the bank does not exist, Blitz will reserve a bank for you.
  95. If the bank does exist, Blitz will erase the bank from memory, and
  96. allocate a new one.
  97. The return result is -1 for success, or 0 for failure  (not enough RAM, 
  98. file not exist). If offset is specified, then <length> bytes will be read
  99. from the specified offset position in the file.
  100. If memtype is specified, then the file is loaded into a memory block
  101. of that particular memtype (%10=Chip, %1=Public)
  102.  
  103.  
  104. Function: PLoad
  105. -------------------------------------------------------------------------------
  106. Mode   : Amiga
  107. Syntax : success=PLoad(filename$,bank/address)
  108.  
  109.   This will attempt to load the executable file to the specified address.
  110.   -1 is success, 0 is failure.
  111.  
  112.  
  113. Function: BSave
  114. --------------------------------------------------------------------------------
  115. Mode   : Amiga
  116. Syntax : success=BSave(filename$,bank/address,length)
  117.  
  118.   This will save <length> bytes at bank/address to the file. Return result
  119. is -1 for success, 0 for failure. If length > bank length then the length
  120. of the bank is saved instead. If 0 is specified, the entire bank is saved.
  121.  
  122.  
  123. Function: Start
  124. -------------------------------------------------------------------------------
  125. Mode   : Amiga/Blitz
  126. Syntax : start_address.l=Start(banknumber.b)
  127.  
  128.   This will return the start address of the specified bank. (0=no bank)
  129.  
  130.  
  131. Function: Length
  132. -------------------------------------------------------------------------------
  133. Mode   : Amiga/Blitz
  134. Syntax : length_of_bank.l=Length(banknumber.b)
  135.  
  136.   This will return the length of the specified bank in bytes. (0=No bank)
  137.  
  138.  
  139. Function: MemFree
  140. --------------------------------------------------------------------------------
  141. Mode   : Amiga/Blitz
  142. Syntax : bytes.l=MemFree
  143.  
  144.   This will return the total amount of Public Free RAM available to the
  145. system.
  146.  
  147.  
  148. Function: NextBank
  149. --------------------------------------------------------------------------------
  150. Mode   : Amiga/Blitz
  151. Syntax : bank.b=NextBank
  152.  
  153.   This will return the number of the first available bank (-1 if none free).
  154.  
  155.  
  156. Statement: FillMem
  157. -------------------------------------------------------------------------------
  158. Mode   : Amiga/Blitz
  159. Syntax : FillMem(address.l,length.l,value.b)
  160.  
  161.    This will fill 'length' bytes starting from the specified address with 
  162.    'value'.
  163.  
  164.  
  165. Statement: CopyByte
  166. --------------------------------------------------------------------------------
  167. Mode   : Amiga/Blitz
  168. Syntax : CopyByte(source.l,dest.l,num.l)
  169.  
  170.   This will copy <num> bytes from <source> to <dest> 
  171.  
  172. Statement: CopyWord
  173. --------------------------------------------------------------------------------
  174. Mode   : Amiga/Blitz
  175. Syntax : CopyByte(source.l,dest.l,num.l)
  176.  
  177.   This will copy <num> words from <source> to <dest> 
  178.  
  179. Statement: CopyLong
  180. --------------------------------------------------------------------------------
  181. Mode   : Amiga/Blitz
  182. Syntax : CopyByte(source.l,dest.l,num.l)
  183.  
  184.   This will copy <num> longwords from <source> to <dest> 
  185.  
  186.  
  187. Function: MakeDir
  188. --------------------------------------------------------------------------------
  189. Mode   : Amiga
  190. Syntax : success=MakeDir(name$)
  191.  
  192.    This function attempts to create a directory called <name$>
  193.    If it is unsuccessfull, 0 is returned else -1 is returned.
  194.  
  195. Function: Rename
  196. --------------------------------------------------------------------------------
  197. Mode   : Amiga
  198. Syntax : success=Rename(source$,dest$)
  199.  
  200.    This attempts to rename the file <source$> to <dest$>
  201.    NOTE: It is not possible to rename across devices.
  202.    -1 is returned if successfull, else 0.
  203.  
  204.  
  205. Function: Timer
  206. --------------------------------------------------------------------------------
  207. Mode   : Amiga/Blitz
  208. Syntax : t.l=Timer
  209.  
  210.    This will return the number of 50ths of a second since startup or the
  211.    last call to ResetTimer.
  212.  
  213. Statement: ResetTimer
  214. --------------------------------------------------------------------------------
  215. Mode   : Amiga/Blitz
  216. Syntax : ResetTimer
  217.  
  218.    This will recent the CIA timer to 0.
  219.  
  220.  
  221. Function: Lisa
  222. --------------------------------------------------------------------------------
  223. Mode   : Amiga/Blitz
  224. Syntax : chipver=Lisa
  225.  
  226.    This will return the current Lisa chip version :
  227.  
  228.     $00 for OCS Denise
  229.     $F7 for ECS Denise
  230.     $F8 for AGA Lisa
  231.  
  232. Statement: Reboot
  233. --------------------------------------------------------------------------------
  234. Mode   : Amiga/Blitz
  235. Syntax : Reboot
  236.  
  237.    This will perform a cold reboot
  238.  
  239.  
  240. Function: FileSize
  241. --------------------------------------------------------------------------------
  242. Mode   : Amiga
  243. Syntax : size.l=FileSize(filename$)
  244.  
  245.   This return the length (in bytes) of the file.
  246.  
  247. Statement: CacheOff
  248. --------------------------------------------------------------------------------
  249. Mode   : Amiga/Blitz
  250. Syntax : Cache Off
  251.  
  252.   This will turn off the instruction cache of the CPU.
  253.  
  254. Function: XOR
  255. --------------------------------------------------------------------------------
  256. Mode   : Amiga/Blitz
  257. Syntax : x.l=XOR(x.l,y.l)
  258.  
  259.   This will perform an Exclusive-Or operation between X and Y and put the
  260. result back into X 
  261. e.g
  262.  
  263.     x=XOR(%101,%100)
  264.  
  265. Will place %001 into X (%101 XOR %100 = %001)
  266.  
  267.  
  268. Function: Max/Min
  269. -------------------------------------------------------------------------------
  270. Mode   : Amiga/Blitz
  271. Syntax : value=Max(first_var,second_var)
  272.          value=Min(first_var,second_var)
  273.  
  274.   This will compare both values and return either the Higher of the values
  275.   (Max) or the Lower (Min). This currently supports INTEGERs only.
  276.  
  277.  
  278. Function: KeyCode
  279. -------------------------------------------------------------------------------
  280. Mode   : Amiga/Blitz
  281. Syntax : keycode=KeyCode
  282.  
  283.     This will return the status of the keyboard in the form of a keycode.
  284.     You will need to experiment to find out the desired keycode for
  285.     a particular key.
  286.     This merely peeks address $bfec01 and returns the value found.
  287.  
  288. Statement/Function : CludgeShapes
  289. -------------------------------------------------------------------------------
  290. Mode   : Amiga/Blitz
  291. Syntax : [success]=CludgeShapes(shape#,numshapes,address)
  292.  
  293.    This allows the creation of shapes through INCBIN statements. It
  294. allocates chip memory for each shape and copies the data into this.
  295. It does the same as LoadShapes except it grabs shapes from memory.
  296.  
  297.  
  298. Statement/Function : CludgeSound
  299. ------------------------------------------------------------------------------
  300. Mode   : Amiga/Blitz
  301. Syntax : [success]=CludgeSound(sound#,address)
  302.  
  303.   This does that same for CludgeShapes but works on only 1 sound at a time
  304. NOTE: Looped sounds are not currently supported! The sound must be a valid
  305. 8SVX sample.
  306.