Prev: C2C2 Up: Map Next: C32D
C2F8: Set up RIGHT vertical wall/floor connector graphics
Used by the routine at C2C2.
The left wall/floor connector has been set up already at C1C0
right side wall-floor connector right side wall-floor connector
C2F8 LD A,$07 Graphic type = 7 (RIGHT corner wall section)
C2FA LD ($EB43),A
C2FD LD A,$30 Graphic vertical position within current room, in pixels, from top of room playing area (fixed value for all rooms).
C2FF LD ($EB4A),A
C302 LD A,$05 Item properties byte. Default = 5 - bit 0 set means item is visible, bit 2 set means item will need erasing (e.g. before re-drawing again)
C304 LD ($EB4E),A
Calculate horizontal position of graphic within room - this will depend on the size of the room.
The room's first data byte (from the set at 61A9) indicates the room size, and is used to calculate the horizontal position of the right corner section.
C307 LD A,($EB7C) Get the 1st data byte for the room (at 61A9)
C30A DEC A The value is in half-character (4 pixel) steps; to calculate this, decrement the value twice
C30B DEC A
C30C RLA ...and multiply by 8
C30D RLA
C30E RLA
C30F AND $F8 Filter off any carry bits (it will be a multiple of 8 so we don't need bits 0-2)
C311 LD ($EB48),A ...and store.
C314 LD A,$01 Graphics frame offset (= no offset)
C316 LD ($EB50),A
C319 LD C,$12 Graphic number in graphics address pointer table at 97C3, this offset points to graphic address 97E5
C31B LD A,($EB77) Level type graphics pointer offset (for 0 for 'brick' levels, 12 for 'cavern levels')
C31E ADD A,C Add to graphic address pointer offset
C31F CALL $E0C2 Set up graphics
C322 CALL $E0B0 Copy the 16 bytes of calculated data from EB43 to a bank in the room item data sets at 7C00
C325 LD HL,($EABE) Retrieve address pointer after the above 16 bytes have been copied
C328 LD (HL),$FF Set the first byte of the next data bank to 255 (end-of-data)
C32A LD HL,($DAEE) Retrieve address pointer to the room item data sets at 7C00
Prev: C2C2 Up: Map Next: C32D