home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / games / gamesuite / !FastSpr / FSprHelp / SWIDocs < prev   
Text File  |  1995-01-29  |  6KB  |  300 lines

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