Prev: 917A Up: Map Next: 9240
917B: Background : Draw a single column of a furniture bitmap.
Used by the routine at Bg_DrawColumn.
Input
Output
Bg_DrawItemColumn 917B LD (Bitmap_temp),HL
917E LD L,(IX+$02)
9181 CALL Bitmap_CopyFrame
9184 LD HL,(Bitmap_temp)
9187 LD A,(Bitmap_InfoCache_Height)
918A AND $7F
918C RLA
918D RLA
918E RLA
918F LD E,A
9190 LD D,$00
9192 ADD HL,DE
9193 EX DE,HL
9194 LD HL,$0050
9197 AND A
9198 SBC HL,DE
919A RET C
919B ADD HL,HL
919C LD E,L
919D LD D,H
919E ADD HL,HL
919F ADD HL,HL
91A0 ADD HL,HL
91A1 ADD HL,HL
91A2 ADD HL,DE
91A3 LD DE,(Ptr_Offscreen)
91A7 ADD HL,DE
91A8 LD (Temp_BlitTo),HL
91AB LD E,(IX+$00)
91AE LD D,(IX+$01)
91B1 LD HL,(Coords_EW)
91B4 LD A,(Camera_Compass)
91B7 BIT 0,A
91B9 JR Z,Bg_DrawItemColumn_0
91BB LD HL,(Coords_NS)
Bg_DrawItemColumn_0 91BE CALL sub_abs
91C1 EX DE,HL
91C2 LD A,(Bitmap_InfoCache_Width)
91C5 AND $7F
91C7 LD L,A
91C8 LD H,$00
91CA LD A,(Hero_LastDirection)
91CD CP $02
91CF JR Z,Bg_DrawItemColumn_1
Moving left.
91D1 EX DE,HL Calculate which bit of bitmap if visible.
91D2 AND A
91D3 SBC HL,DE
91D5 EX DE,HL
91D6 LD HL,$0020
91D9 SBC HL,DE
91DB JR Bg_DrawItemColumn_2
Moving right.
Bg_DrawItemColumn_1 91DD ADD HL,DE Calculate which bit of bitmap if visible.
91DE LD DE,$0022
91E1 AND A
91E2 SBC HL,DE
Bg_DrawItemColumn_2 91E4 SRL H
91E6 RR L
91E8 EX DE,HL
Blit a single 8 pixel column of a bitmap, held in the bitmap info cache.
DE Byte / Column offset of bitmap pixels, to start from.
Bitmap_DrawColumn 91E9 LD BC,(Bitmap_InfoCache) Get the address of the bitmap and offset to the correct column for blitting.
91ED EX DE,HL
91EE ADD HL,BC
91EF PUSH HL
91F0 EX (SP),IX
91F2 LD HL,(Temp_BlitTo) Get the address of where to blit too.
91F5 LD A,(Bitmap_InfoCache_Height)
91F8 AND $7F
91FA EX AF,AF' Calculate number of bytes to skip for each bitmap row.
91FB LD A,(Bitmap_InfoCache_Width)
91FE AND $7F
9200 LD C,A
9201 LD B,$00
9203 LD DE,$0022 Width of offscreen.
9206 EX AF,AF' Calculate height in pixels.
9207 AND A
9208 RLA
9209 RLA
920A RLA
Bg_DrawItemColumn_3 920B EX AF,AF'
920C LD A,(IX+$00) Get byte and mask out shape from background.
920F XOR (HL)
9210 LD (HL),A
9211 ADD HL,DE Next line down.
9212 ADD IX,BC Skip rest of bitmap for that row.
9214 EX AF,AF'
9215 DEC A Next row.
9216 JR NZ,Bg_DrawItemColumn_3
9218 POP IX
921A RET
This entry point is used by the routine at Bg_DrawColumn.
Bg_DrawItemColumn_4 921B LD C,A
921C LD B,$00
921E LD L,(IX+$00)
9221 LD H,(IX+$01)
9224 RES 7,H
9226 SBC HL,BC
9228 LD E,L
9229 LD D,H
922A ADD HL,BC
922B ADD HL,BC
922C LD C,L
922D LD B,H
922E LD HL,(_9689_coordsA)
9231 SBC HL,BC
9233 JR NC,Bg_DrawItemColumn_5
9235 LD HL,(_968b_coordsB)
9238 SCF
9239 SBC HL,DE
923B RET C
923C AND A
923D RET
Bg_DrawItemColumn_5 923E SCF
923F RET
Prev: 917A Up: Map Next: 9240