Prev: 9551 Up: Map Next: 95AE
9568: Pick up an item
Used by the routine at 927E.
9568 LD DE,$0031 BEEP without disabling interrupts.
956B LD HL,$0376
956E CALL $03B6
9571 LD HL,($C524) Put the X co-ordinate in L and the Y co-ordinate in H.
9574 LD C,L Remember the X co-ordinate in C.
9575 LD L,H Convert the Y co-ordinate to a word offset.
9576 LD H,$00
9578 ADD HL,HL
9579 LD DE,$EA60 Add this to get a pointer in the screen offset buffer (EA60).
957C ADD HL,DE
957D PUSH HL Remember this.
957E LD A,(HL) Get the screen address in HL.
957F INC HL
9580 LD H,(HL)
9581 LD L,A
9582 LD A,C Restore the X co-ordinate.
9583 RRCA Divide by 8 to get an offset from a screen address.
9584 RRCA
9585 RRCA
9586 LD C,A Remember this offset.
9587 LD D,$00 Combine the screen address with the offset to get the right position.
9589 LD E,A
958A ADD HL,DE
958B LD DE,$9260 Convert up to put the graphic in the buffer at D260.
958E ADD HL,DE
The appropriate location of the item was found, now blank it out.
958F LD B,$08 8 lines.
9591 LD (HL),$00 Blank the graphic.
9593 INC HL
9594 LD (HL),$00
9596 DEC HL
9597 INC H Next line on screen.
9598 DJNZ $9591 Loop until all lines are done.
959A POP HL Restore the screen offset.
959B LD DE,$FFF0 Move back a line.
959E ADD HL,DE
959F LD A,(HL) Get the screen address in HL.
95A0 INC HL
95A1 LD H,(HL)
95A2 LD L,A
95A3 LD E,C Restore the offset and add it to get the right position.
95A4 LD D,$00
95A6 ADD HL,DE
95A7 LD DE,$9260 Convert this to an offset in the screen buffer at D260.
95AA ADD HL,DE
95AB JP $968D Jump forward to clear the second line of the item.
Prev: 9551 Up: Map Next: 95AE