home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
games
/
gamesuite
/
!FastSpr
/
FSprHelp
/
SWIDocs
< prev
Wrap
Text File
|
1995-01-29
|
6KB
|
300 lines
FastSpr Version 3.01
====================
SWI Documentation
=================
FastSpr supports an SWI block based at &47D00.
--------------------------------
FastSpr_Plot
============
Plots a sprite
On Entry
R0 = sprite number
R1 = x coordinate
R2 = y coordinate
On exit
R0 corrupted
R1, R2 preserved
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI plots a sprite to the current screen bank (see the SWI FastSpr_ScreenBank). The sprite number is made up as follow.
MSB
/--byte 3 --\ /-- byte 2 -- \ /-- bytes 1 and 0 --\
[sprite pool] [animation frame] [sprite number]
So animation frame 4 of sprite 7 from pool 2 would have the number &02040007.
The coordinates are in pixels from the top left. Note that this is different
from OS cooridinate, which begin at the bottom left. For a MODE 13 screen
the bottom right hand pixel is (319,255). The sprite will be plotted so that
it’s centre is at the coordinates given (unless you choose differently with
FSPConv).
==================================
FastSpr_ClearWindow
===================
Clears the current graphics window
On Entry
No parameters
On exit
No results
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI fills the current graphics window with the current backdrop colour.
The action is similar to BASIC’s CLS, but only the FastSpr window, as set by
FastSpr_SetClipWindow, is cleared.
==================================
FastSpr_SetClipWindow
=====================
Sets the graphics window
On Entry
R0 = minimum x coord (inclusive)
R1 = minimum y coord (inclusive)
R2 = maximum x coord (exclusive)
R3 = maximum y coord (exclusive)
On exit
Registers preserved
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI sets the current clipping window. If you wish to use FSP2 type
files the minimum and maximum x coordinates must be multiples of 4. For FSP1
files they may assume any value. The clipping window must be within the
screen boundaries. When a screen mode is selected the clip window is set to
the whole screen. For MODE 13 this means R0=0, R1=0, R2=320, R3=256.
==================================
FastSpr_Load
============
Loads a sprite file
On Entry
R0 = filename
R1 = pool number
On Exit
R0 corrupted
R1 preserved
Executes in SVC mode. Interrupt status may be altered. SWI is not
re-entrant.
Use
This command loads a sprite file into the RMA. The pool number is in the
range 0-&3E.
==================================
FastSpr_GetAddress
==================
Returns addresses of certain routines within FastSpr.
On Entry
No parameters
On Exit
R0 = address of Plot routine
R1 = address of ClearWindow routine
R2 = address of ScreenBank routine
R4 = address of FastSpr’s variable.
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI returns addresses of useful routines within FastSpr. You may set up
registers as for the relevant SWI and call these routines directly. This
will save a bit of time by bypassing the operating system’s SWI handler, but
will lead to problems if the RMA is tidied or FastSpr is RMKilled etc.
==================================
FastSpr_SetBackdrop
===================
Sets the backdrop colour
On Entry
R0 = colour 0-&FF
On Exit
Registers preserved
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI sets the backdrop colour as used by FastSpr_ClearWindow. R0 is the
byte value written to the screen, so the colours are identical to those shown
in the palette of Paint.
==================================
FastSpr_ScreenBank
==================
Selects the current screen bank
On Entry
R0 = bank number or address
On Exit
R0 preserved
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI sets the screen bank. R0=0 selects bank 1, R0=1 selects bank 2
(yes, I’m sorry...). A value greater than &8000 is taken to be the address
of an area of memory to be used as a screen.
==================================
FastSpr_SpritesAreAt
====================
The old form of implementing sprite pools
On Entry
R0 = address of sprite files
On Exit
R0 preserved
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI sets the address of the sprite file in pool 0. It should not be
used for new programs and is retained for past comptibility.
==================================
FastSpr_ReadSize
================
Return the size of a sprite
On Entry
R0 = sprite number
On Exit
R0 = x size
R1 = y size
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI returns the size of a sprite in pixels. The sprite number is in the
same format as used by FastSpr_Plot.
==================================
FastSpr_GetPointer
==================
Get the address of a sprite pool pointer
On Entry
R0 = pool number
On Exit
R0 = address of pointer
Executes in SVC mode. Interrupt status unaltered. SWI is re-entrant.
Use
This SWI returns the address of FastSpr’s pointer to the sprite file in the
specified pool. If you wish to tell FastSpr you have loaded a sprite file
into user memory you would store its address at the address returned in R0.
Example
...load file into memory block at R1...
MOV R0,#1
SWI FastSpr_GetPointer
STR R1,[R0]
This is very easily interfaced with Amnesia.
MOV R0,#1
SWI FastSpr_GetPointer
ADR R1,filename
MOV R2,#0
SWI Amnesia_LoadFile
...
.filename
DCB "FSPSprites",0
or identically
SYS "FastSpr_GetPointer",1 TO adr
SYS "Amnesia_LoadFile",adr,"FSPSprites",0
==================================
FastSpr_SetFlash
================
SetFlash was inactive in this version.
========================================
This file last updated 16/10/94 by A.Southgate.