Product specifications
COMTS1: LD A,L ;Check to see that sprite
CP 192 ;is on-screen
JR NZ,COMTS2 ;If condition true then goto
LD A,H ;COMTS2 else return to
CP 0 ;routine with TRUFAL = false
RET Z
;
COMTS2: LD A,(OFFSET) ;Perform impact true/false
ADD A,L ;test on each of the four
CP E ;sides of the two active
JR C,COMTS3 ;sprites
LD A,(OFFSET) ;If at any point the test
ADD A,E ;routine shows that the
CP L ;two sprites are not close
JR C,COMTS3 ;enough for impact to take
LD A,(OFFSET) ;place then an exit is made
ADD A,H ;to COMTS3 and TRUFAL is
CP D ;false
JR C,COMTS3 ;Only if ALL impact test
LD A,(OFFSET) ;conditions are true will
ADD A,D ;TRUFAL be set to true
CP H ;when the test routine
JR C,COMTS3 ;is completed
LD A,1
LD (TRUFAL),A
RET ;Return to calling routine
;
COMTS3: NOP ;At this point here it is
;possible to include extra
;or specific user defined tests.
RET ;Return to calling routine
Looking underneath sprites at the background
In many situations it may be desirable or even necessary to look underneath sprites at
objects or regions contained within the pattern background.
There is a direct and simple proportional relationship between the pattern background
and the position of sprites on screen.
Referring to scion 2.4 and assuming for the moment that this routine is being written
for a graphics 2 mode application, and that we are using 16 times 16 bit sprites, there
are actually two ways in which this problem can be tackled.
If we re using a high resolution plottable type graphics 2 mode set up (as BASIC
does), then the routine will not detect characters underneath sprites, but will detect
bits within pattern generator table bytes and will act on the pattern generator table.
This code is listed in Option 1.