home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / gamesuite_1 / GameSuite / !FastSpr / Microhelp / swidocs < prev   
Encoding:
Text File  |  1991-03-31  |  6.1 KB  |  275 lines

  1. <HTML><h1>FastSpr Version 3.01</h1>
  2.  
  3. <h6>SWI Documentation</h6>
  4.  
  5. FastSpr supports an SWI block based at &47D00.
  6.  
  7.     <a href="#plot">FastSpr_Plot</a>
  8.     <a href="#clearwindow">FastSpr_ClearWindow</a>
  9.     <a href="#setclipwindow">FastSpr_SetClipWindow</a>
  10.     <a href="#load">FastSpr_Load</a>
  11.     <a href="#getaddress">FastSpr_GetAddress</a>
  12.     <a href="#setbackdrop">FastSpr_SetBackdrop</a>
  13.     <a href="#screenbank">FastSpr_ScreenBank</a>
  14.     <a href="#spritesareat">FastSpr_SpritesAreAt</a>
  15.     <a href="#readsize">FastSpr_ReadSize</a>
  16.     <a href="#getpointer">FastSpr_GetPointer</a>
  17.  
  18. --------------------------------
  19.  
  20. <a name="plot"><h6>FastSpr_Plot</h6></a>
  21.  
  22. Plots a sprite
  23.  
  24. On Entry
  25.  R0 = sprite number
  26.  R1 = x coordinate
  27.  R2 = y coordinate
  28.  
  29. On exit
  30.  R0 corrupted
  31.  R1, R2 preserved
  32.  
  33. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  34.  
  35. Use
  36.  
  37. This SWI plots a sprite to the current screen bank (see the SWI
  38. FastSpr_ScreenBank).  The sprite number is made up as follow.
  39.  
  40. MSB
  41. /--byte 3 --\ /--  byte 2 --  \ /-- bytes 1 and 0 --\
  42. [sprite pool] [animation frame]    [sprite number]
  43.  
  44. So animation frame 4 of sprite 7 from pool 2 would have the number &02040007.
  45.  
  46. The coordinates are in pixels from the top left.  Note that this is different
  47. from OS cooridinates, which begin at the bottom left.  For a MODE 13 screen
  48. the bottom right hand pixel is (319,255).  The sprite will be plotted so that
  49. it’s centre is at the coordinates given (unless you choose differently with
  50. FSPConv).
  51.  
  52. <a name="clearwindow"><h6>FastSpr_ClearWindow</h6></a>
  53.  
  54. Clears the current graphics window
  55.  
  56. On Entry
  57.  
  58. No parameters
  59.  
  60. On exit
  61.  
  62. No results
  63.  
  64. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  65.  
  66. Use
  67.  
  68. This SWI fills the current graphics window with the current backdrop colour. 
  69. The action is similar to BASIC’s CLS, but only the FastSpr window, as set by
  70. FastSpr_SetClipWindow, is cleared.
  71.  
  72. <a name="setclipwindow"><h6>FastSpr_SetClipWindow</h6></a>
  73.  
  74. Sets the graphics window
  75.  
  76. On Entry
  77.  
  78. R0 = minimum x coord (inclusive)
  79. R1 = minimum y coord (inclusive)
  80. R2 = maximum x coord (exclusive)
  81. R3 = maximum y coord (exclusive)
  82.  
  83. On exit
  84.  
  85. Registers preserved
  86.  
  87. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  88.  
  89. Use
  90.  
  91. This SWI sets the current clipping window.  If you wish to use FSP2 type
  92. files the minimum and maximum x coordinates must be multiples of 4.  For FSP1
  93. files they may assume any value.  The clipping window must be within the
  94. screen boundaries.  When a screen mode is selected the clip window is set to
  95. the whole screen.  For MODE 13 this means R0=0, R1=0, R2=320, R3=256.
  96.  
  97. <a name="load"><h6>FastSpr_Load</h6></a>
  98.  
  99. Loads a sprite file
  100.  
  101. On Entry
  102.  
  103. R0 = filename
  104. R1 = pool number
  105.  
  106. On Exit
  107.  
  108. R0 corrupted
  109. R1 preserved
  110.  
  111. Executes in SVC mode.  Interrupt status may be altered.  SWI is not
  112. re-entrant.
  113.  
  114. Use
  115.  
  116. This command loads a sprite file into the RMA.  The pool number is in the
  117. range 0-&3E.
  118.  
  119. <a name="getaddress"><h6>FastSpr_GetAddress</h6></a>
  120.  
  121. Returns addresses of certain routines within FastSpr.
  122.  
  123. On Entry
  124.  
  125. No parameters
  126.  
  127. On Exit
  128.  
  129. R0 = address of <a href="#plot">Plot</a> routine
  130. R1 = address of <a href="#clearwindow">ClearWindow</a> routine
  131. R2 = address of <a href="#screenbank">ScreenBank</a> routine
  132.  
  133. R4 = address of FastSpr’s variables.
  134.  
  135. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  136.  
  137. Use
  138.  
  139. This SWI returns addresses of useful routines within FastSpr.  You may set up
  140. registers as for the relevant SWI and call these routines directly.  This
  141. will save a bit of time by bypassing the operating system’s SWI handler, but
  142. will lead to problems if the RMA is tidied or FastSpr is RMKilled etc.
  143.  
  144. <a name="setbackdrop"><h6>FastSpr_SetBackdrop</h6></a>
  145.  
  146. Sets the backdrop colour
  147.  
  148. On Entry
  149.  
  150. R0 = colour 0-&FF
  151.  
  152. On Exit
  153.  
  154. Registers preserved
  155.  
  156. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  157.  
  158. Use
  159.  
  160. This SWI sets the backdrop colour as used by <a href="#clearwindow">FastSpr_ClearWindow</a>.  R0 is the
  161. byte value written to the screen, so the colours are identical to those shown
  162. in the palette of Paint.
  163.  
  164. <a name="screenbank"><h6>FastSpr_ScreenBank</h6></a>
  165.  
  166. Selects the current screen bank
  167.  
  168. On Entry
  169.  
  170. R0 = bank number or address
  171.  
  172. On Exit
  173.  
  174. R0 preserved
  175.  
  176. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  177.  
  178. Use
  179.  
  180. This SWI sets the screen bank.  R0=0 selects bank 1, R0=1 selects bank 2
  181. (yes, I’m sorry...).  A value greater than &8000 is taken to be the address
  182. of an area of memory to be used as a screen.
  183.  
  184. <a name="spritesareat"><h6>FastSpr_SpritesAreAt</h6></a>
  185.  
  186. The old form of implementing sprite pools
  187.  
  188. On Entry
  189.  
  190. R0 = address of sprite files
  191.  
  192. On Exit
  193.  
  194. R0 preserved
  195.  
  196. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  197.  
  198. Use
  199.  
  200. This SWI sets the address of the sprite file in pool 0.  It should not be
  201. used for new programs and is retained for past comptibility.
  202.  
  203. <a name="readsize"><h6>FastSpr_ReadSize</h6></a>
  204.  
  205. Return the size of a sprite
  206.  
  207. On Entry
  208.  
  209. R0 = sprite number
  210.  
  211. On Exit
  212.  
  213. R0 = x size
  214. R1 = y size
  215.  
  216. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  217.  
  218. Use
  219.  
  220. This SWI returns the size of a sprite in pixels.  The sprite number is in the
  221. same format as used by <a href="#plot">FastSpr_Plot</a>.
  222.  
  223. <a name="getpointer"><h6>FastSpr_GetPointer</h6></a>
  224.  
  225. Get the address of a sprite pool pointer
  226.  
  227. On Entry
  228.  
  229. R0 = pool number
  230.  
  231. On Exit
  232.  
  233. R0 = address of pointer
  234.  
  235. Executes in SVC mode.  Interrupt status unaltered.  SWI is re-entrant.
  236.  
  237. Use
  238.  
  239. This SWI returns the address of FastSpr’s pointer to the sprite file in the
  240. specified pool.  If you wish to tell FastSpr you have loaded a sprite file
  241. into user memory you would store its address at the address returned in R0.
  242.  
  243. Example
  244.  
  245. ...load file into memory block at R1...
  246. MOV R0,#1
  247. SWI FastSpr_GetPointer
  248. STR R1,[R0]
  249.  
  250. This is very easily interfaced with Amnesia.
  251.  
  252. MOV R0,#1
  253. SWI FastSpr_GetPointer
  254. ADR R1,filename
  255. MOV R2,#0
  256. SWI <a href="Amnesia:Microhelp.SWIDocs#loadfile">Amnesia_LoadFile</a>
  257.  
  258. ...
  259.  
  260. .filename
  261. DCB "FSPSprites",0
  262.  
  263. or identically
  264.  
  265. SYS "FastSpr_GetPointer",1 TO adr
  266. SYS "Amnesia_LoadFile",adr,"FSPSprites",0
  267.  
  268. <a name="setflash"><h6>FastSpr_SetFlash</h6></a>
  269.  
  270. SetFlash was inactive in this version.
  271.  
  272. --------------
  273.  
  274. This file last updated 16/10/94 by A.Southgate.
  275.