Product specifications
CALL DRWSPR ;Display two sprites on-screen
RET ;Return to calling routine
;
;CLRSPR-CLEAR SPRITE ATTRIBUTE TABLE
;
; NO REGISTER SET UP REQUIRED ON ETRY
;
; VRAM START ADDRESS OF SPRITE ATTRIBUTE TABLE
; ASSUMED TO BE HELD IN TWO BYTE LOCATION SATSAD
; (SPRITE ATTRIBUTE TABLE START ADDRESS)
;
SATSAD: DW 0 ;SATSAD is a two byte location
;which MUST hold the start
;address of the sprite attribute table
;
CLRSPR: LD DE,(SATSAD) ;Set write to VRAM pointer to
CALL VSETOT ;start of sprite attribute table
LD B,32 ;Set loop counter = 32
CLRSP1: LD C,192 ;Set first byte to be output
;(sprite Y coord) to 192
CALL VDOUTP ;and output byte to sprite
;attribute table
LD C,0 ;Set output byte to zero
CALL VDOUTP ;and output it 3 times to
CALL VDOUTP ;the remaining three bytes
CALL VDOPUTP ;within each control block of the
;sprite attribute table
DJNZ CLRSP1 ;Decrement loop counter and
;if loop counter < > 0 then
;goto CLRSP1 else drop through
;to CLRSP2
CLRSP2: RET ;Return to calling routine
;
;BLKSPR-LIMIT NUMBER OF ACTIVE SPRITES TO VALUE CONTAINED IN
A ON ENTRY
;
; IF A = O THEN NO ACTIVE SPRITES
; IF A = (N) THEN (N) ACTIVE SPRITES WHERE
; 1 < = N < = 31
; IF A > 31 THEN REUTRN FROM ROUTINE AND NO ACTION
; TAKEN
;
BLKSPR: CP 32 ;If A > 31 on entry to THIS
;routine then return to
RET NC ;calling routine else drop
;through to BLKSP1
BLKSP1: SLA A ;Multiply contents of A
SLA A ;by 4
LD E,A ;Add the value of A * 4 to
LD D,0 ;the start address of the
LD HL,(SATSAD) ;sprite attribute table
ADD HL,DE