Prev: 81F4 Up: Map Next: 82A0
8203: Draw a block (views 0 and 2)
One block's picture, drawn straight into the render buffer as immediate data, 16 pixels wide. Each of the eight steps paints one row of the block's outline -- the two bytes' edge pixels merged with what is behind them -- and the row eight below it outright, in the dithered shades of the faces. There is one of these for each pair of views, since turning the view round a quarter mirrors the shading: DRAW_BLOCK_TURNED is the other. SELECT_BLOCK_DRAWER points IY at the right one and DRAW_SCENE jumps to it.
Ends by jumping back into DRAW_SCENE rather than returning.
Input
HL The block's place in PLANES
DE The row length less one ($1F)
DRAW_BLOCK 8203 CALL PLANE_TO_BUFFER HL = the top left of the block in the render buffer.
8206 LD A,(HL) The first step: the outline row, and the solid row eight below...
8207 OR $01
8209 LD (HL),A
820A INC H
820B LD (HL),$AA
820D INC L
820E LD (HL),$BB
8210 DEC H
8211 LD A,(HL)
8212 AND $7F
8214 LD (HL),A
8215 ADD HL,DE
8216 LD A,(HL) ...and so on down.
8217 AND $F8
8219 OR $04
821B LD (HL),A
821C INC H
821D LD (HL),$55
821F INC L
8220 LD (HL),$EE
8222 DEC H
8223 LD A,(HL)
8224 AND $1F
8226 OR $40
8228 LD (HL),A
8229 ADD HL,DE
822A LD A,(HL)
822B AND $E0
822D OR $11
822F LD (HL),A
8230 INC H
8231 LD (HL),$AA
8233 INC L
8234 LD (HL),$BB
8236 DEC H
8237 LD A,(HL)
8238 AND $07
823A OR $10
823C LD (HL),A
823D ADD HL,DE
823E LD A,(HL)
823F AND $80
8241 OR $44
8243 LD (HL),A
8244 INC H
8245 LD (HL),$55
8247 INC L
8248 LD (HL),$EE
824A DEC H
824B LD A,(HL)
824C AND $01
824E OR $44
8250 LD (HL),A
8251 ADD HL,DE
8252 LD (HL),$91
8254 INC H
8255 LD A,(HL)
8256 AND $80
8258 OR $2A
825A LD (HL),A
825B INC L
825C LD A,(HL)
825D AND $01
825F OR $BA
8261 LD (HL),A
8262 DEC H
8263 LD (HL),$11
8265 ADD HL,DE
8266 LD (HL),$44
8268 INC H
8269 LD A,(HL)
826A AND $E0
826C OR $15
826E LD (HL),A
826F INC L
8270 LD A,(HL)
8271 AND $07
8273 OR $E8
8275 LD (HL),A
8276 DEC H
8277 LD (HL),$46
8279 ADD HL,DE
827A LD (HL),$A9
827C INC H
827D LD A,(HL)
827E AND $F8
8280 OR $02
8282 LD (HL),A
8283 INC L
8284 LD A,(HL)
8285 AND $1F
8287 OR $A0
8289 LD (HL),A
828A DEC H
828B LD (HL),$1B
828D ADD HL,DE
828E LD (HL),$54
8290 INC H
8291 LD A,(HL)
8292 OR $01
8294 LD (HL),A
8295 INC L
8296 LD A,(HL)
8297 OR $80
8299 LD (HL),A
829A DEC H
829B LD (HL),$6E
829D JP BLOCK_DRAWN Back to DRAW_SCENE.
Prev: 81F4 Up: Map Next: 82A0