Prev: 49765 Up: Map Next: 49858
49808: Set up room floor-wall connector graphics
Used by the routine at 49765.
49808 LD A,1 Graphics type = 1 (fixed scenery item)
49810 LD (60227),A
49813 LD A,17 Graphic number - address pointer offset for graphic address table at 38851 - unnecessary because it'll be overwritten in a few more instructions at 49845
49815 LD (60240),A
49818 LD A,(60280) Room graphic item's horizontal position within current room, in half-character (4 pixel) steps. Copy into data buffer.
49821 LD (60232),A
49824 LD A,(60281) Room graphic item's vertical position within current room, in pixels. Copy into data buffer.
49827 LD (60234),A
Sets up (including mirroring if needed) wall/floor connector graphics, depending on which wall is being dealt with (left, right or back)
back wall-floor connector side wall-floor connector mirrored side wall-floor connector
Uses the byte at 60287 to identify the graphics address offset (C register) and frame (A register) for the wall/floor connector graphic address:
  • Back wall (byte value = 0)
  • Right wall (byte value = 1)
  • Left wall (byte value = 2)
49830 LD A,(60287)
49833 CP 0 Back wall - offset for graphics address 38879, back wall floor section (see 40392)
49835 JR Z,49841
49837 LD C,16 Right/left wall - offset for:
  • address pointer = 38881, right wall side/wall floor section (see 40423), or
  • address pointer = 38883, left wall (mirrored) side wall/floor section (see 32851)
49839 JR 49845
49841 LD C,15
49843 LD A,1
49845 LD (60240),A
Calculate graphics offset based on level offset and the above
49848 LD A,(60279) Level type offset to scenery graphics (either 0 or 12 depending on whether it's a 'brick' or 'cavern' style level)
49851 ADD A,C Add to calculated value to indicate the correct graphic number based on level type and wall alignment
49852 CALL 57538 Set up graphics (copy graphics address pointers and mirror any graphic data)
49855 CALL 57520 Copy the item data from the working buffer 60227 into a 16 byte room item data set at 31744.
Prev: 49765 Up: Map Next: 49858