Prev: 9223 Up: Map Next: 9258
9228: Check to see if Monty has collided with a nasty
Used by the routine at 9298.
Input
H Holds the Y co-ordinate
L Holds the X co-ordinate
F On exit, resets the zero flag if there was a collision
9228 LD A,L Get the X co-ordinate.
9229 AND $07 Convert it to a frame number and put it in B.
922B INC A
922C LD B,A
922D LD A,$00
922F SCF
9230 RRA
9231 DJNZ $9230
9233 LD B,A
9234 LD A,L Get the X co-ordinate.
9235 AND $F8 Convert it to a screen offset.
9237 RRCA
9238 RRCA
9239 RRCA
923A LD L,H Put the Y co-ordinate in HL.
923B LD H,$00
923D ADD HL,HL
923E LD DE,$EA60 Add the base offset for the screen address table (#$EA60).
9241 ADD HL,DE
9242 PUSH AF Remember the X co-ordinate.
9243 LD A,(HL) Get the actual screen address and put it in HL.
9244 INC HL
9245 LD H,(HL)
9246 LD L,A
9247 POP AF Restore the X co-ordinate.
9248 LD D,$00 Add this to the existing screen address to get an actual address.
924A LD E,A
924B ADD HL,DE
924C EX DE,HL Add an offset to get an address in the screen buffer at D260.
924D LD HL,$9260
9250 ADD HL,DE
9251 LD A,(HL) Get the byte there.
9252 AND B Test the bits against the X co-ordinate and store this in C.
9253 LD C,A
9254 LD A,(DE) Get the byte on screen.
9255 AND B Test the bits on screen against that in the buffer, which will reset the zero flag if they don't match.
9256 XOR C
9257 RET Return.
Prev: 9223 Up: Map Next: 9258