Prev: C20F Up: Map Next: C290
C265: Check for and set up back wall brickwork/rock scenery
Used by the routine at C20F.
Input
C Contains either 0, indicating a 'blank' section of wall, or 2, indicating some brickwork.
Bit 0 has already been checked and is zero, indicating there isn't a door in this room position.
Checks for any brickwork scenery that needs to be set up. See Trivia: Setting the scene(ry) for an explanation of how DOORS and BRICKWORK are evaluated from the room data set.
Decoration for the back wall - scenery graphics that appears on the walls of 'brick' levels (9EE8) or 'cavern' levels (A035)
brickwork pattern 2 brickwork pattern 2 brickwork pattern 3 brickwork pattern 4
back wall scenery 1 back wall scenery 2 back wall scenery 3 back wall scenery 4
First, check if bit 1 is set - if so, there's brickwork at this position:
C265 LD A,C
C266 AND $02 Check bit 1. If it's set, there's BRICKWORK to set up at this room position.
C268 JR Z,$C290 If it's NOT set, skip over the next routine.
Brickwork identified. Set up graphics pointers & data for one of 8 back wall brickwork ('brick' levels) or rock ('cavern level') patterns
C26A LD A,$01 Graphics type = 1 (fixed scenery item)
C26C LD ($EB43),A
C26F LD A,($EB78) Horizontal room position of item (in half-character/4-pixel increments). Copy into data buffer ready to be transferred into a room item data set (at 7C00)
C272 LD ($EB48),A
C275 RRA Use this byte by shifting into the lowest 3 bits...
C276 RRA
C277 RRA
C278 AND $03 ...To provide one of 4 values (0-3), used to pick one of the four brickwork/decoration types
C27A INC A Incremented so number set correctly at 1-4
C27B LD ($EB50),A Store as graphics pointer offset
C27E LD A,L Use bits 0-4 of the low byte (L) of the HL register pair to set variable heights for the decoration. At the start of this routine, HL is typically at the start of one of the data bank sets at 7C00, meaning the height (in relation to the top of the room, in pixels) will be either 0 or 16 pixels. However, this routine can be reached with HL pointing somewhere in the room data at 61A9, so the height of the brickwork can be be quite varied.
C27F AND $1F
C281 LD ($EB4A),A
C284 LD C,$17 Offset for brickwork graphics at 97C3, pointing to 97EF
C286 LD A,($EB77) Add graphic offset if Maroc is on a 'cavern' level, to use the second set of rock graphics (9807) instead of the the bricks
C289 ADD A,C
C28A CALL $E0C2 Call setup graphics routine (copy graphics address pointers and mirror any relevant graphic data)
C28D CALL $E0B0 Copy the 16 bytes of graphic data for the brickwork scenery from the data buffer at EB43 to one of the room data sets at 7C00.
Prev: C20F Up: Map Next: C290