Prev: 54401 Up: Map Next: 54459
54406: Draw Life Icon Cells
Used by the routine at DrawLivesDisplay.
Draws the life icon cell pixels into the display file. Given an icon index in A, looks up the icon cell data address from the descriptor table, then for each cell computes the screen pixel address and OR-blits the icon pixels into the display file. Used by DrawLivesDisplay to repaint the lives display.
Input
A Icon index; selects the cell data from the icon descriptor table
Draw_Life_Icon_Cells 54406 ADD A,A Double the icon index to form a 16-bit table offset.
54407 LD E,A
54408 LD D,0
54410 LD HL,50700 Index into the icon descriptor table.
54413 ADD HL,DE
54414 LD E,(HL) Load the icon cell data address.
54415 INC HL
54416 LD D,(HL)
54417 EX DE,HL
54418 LD E,C Set DE to the source data and load the cell count into B.
54419 LD D,B
54420 LD B,(HL)
Draw_Life_Icon_Cells_Loop 54421 PUSH BC Stash the loop state on the stack.
54422 INC HL Compute the pixel row for this icon cell.
54423 LD A,D
54424 ADD A,(HL)
54425 INC HL
54426 LD C,A
54427 LD A,E Compute the pixel column and stash the data pointer on the stack.
54428 ADD A,(HL)
54429 PUSH HL
54430 LD L,A Compute the row lookup address in BC.
54431 LD B,197
54433 SLA C
54435 RL B
54437 LD H,198 Compute the column lookup address in HL.
54439 SLA L
54441 RL H
54443 LD A,(HL) Resolve the screen pixel address for this cell.
54444 INC HL
54445 LD H,(HL)
54446 LD L,A
54447 LD A,(BC) Combine the pixel row mask with the screen address.
54448 OR L
54449 LD L,A
54450 INC BC
54451 LD A,(BC) OR the icon pixel data into the display file.
54452 OR (HL)
54453 LD (HL),A
54454 POP HL Restore the data pointer and loop state, and repeat for the next cell.
54455 POP BC
54456 DJNZ Draw_Life_Icon_Cells_Loop
54458 RET Return.
Prev: 54401 Up: Map Next: 54459