Prev: D056 Up: Map Next: D096
D06C: Check if a tile is a wall or a background
Check ia a tile is a wall. Used by the routines at C05A, C14D, C2FD, C3E0, C4A6, C620, D040, D056 and D0E4.
Input
HL Address pointer of tile in the tile type buffer
Output
F Return Z:1 if tile type is in the list Z:0 if tile type is not in the list
A Return A=<tile type> if found ; A=0 if not found
D06C PUSH HL Save HL and BC
D06D PUSH BC
D06E LD A,(HL) Set A to the tile type pointed by HL
D06F LD B,$04 Set B to the number of tiles of type 'wall'
D071 LD HL,$D096 Set HL to the address pointer of the list of tiles 'wall'
Check if the tile type in A is in the list of B elements pointed by HL
D074 LD C,$FF Check if A is equal to (HL)
D076 CPI
D078 JP Z,$D085 Jump if so
D07B DJNZ $D076 Jump back and check next element
is not in the list
D07D POP BC Restore BC
D07E POP HL Restore HL
D07F LD A,$01 Set flag Z=0
D081 OR A
D082 LD A,$00 Set A = $00
D084 RET
is in the list
D085 XOR A Set flag Z=1
D086 DEC HL Set A to the tile type found
D087 LD A,(HL)
D088 POP BC Restore BC and HL
D089 POP HL
D08A RET
Check into the list of background tiles Used by the routines at B64E, C6C2, CB03 and D14D.
D08B PUSH HL Save HL and BC
D08C PUSH BC
D08D LD A,(HL) Set A to the tile type pointed by HL
D08E LD B,$06 Set B to the number of tiles of type 'background'
D090 LD HL,$D09A Set HL to the address pointer of the list of tiles 'background'
D093 JP $D074
Prev: D056 Up: Map Next: D096