Prev: 54364 Up: Map Next: 54415
54366: Highlight Active Doors
Used by the routines at Prep_Display_Phase and Door_Prep_01.
This routine highlights the doors which are currently being displayed in the playarea.
ActiveDoors 54366 LD A,(54364) A=CashboxReference_Inactive.
54369 LD C,56 C=56 (not highlighted).
54371 CALL ActiveDoors_Start Call ActiveDoors_Start.
54374 LD A,(54365) A=CashboxReference_Active.
54377 LD C,58 C=58 (highlighted).
Sets a counter as three doors are highlighted as being "in-view".
ActiveDoors_Start 54379 LD B,3 B=3.
ActiveDoors_Loop 54381 PUSH AF Stash AF on the stack.
54382 CALL ActiveDoors_Paint Call ActiveDoors_Paint.
54385 POP AF Restore AF from the stack.
54386 INC A Increment A by one.
54387 CP 13 If A is 13 then call ActiveDoors_SetDoorOne.
54389 CALL NC,ActiveDoors_SetDoorOne
54392 DJNZ ActiveDoors_Loop Decrease the B counter by one and loop back to ActiveDoors_Loop until it is zero.
54394 RET Return.
If the active doors spill over the last door, then cycle back to the beginning. For example, if door 11 is active, then it's 11, 12 and 1 which are highlighted.
ActiveDoors_SetDoorOne 54395 LD A,1 A=1.
54397 RET Return.
Handles writing the attribute value held by C to the screen.
ActiveDoors_Paint 54398 CP 7 Is A less than 7?
54400 LD HL,22533 HL=22533 (left-hand side).
54403 JR NC,ActiveDoors_Paint_Skip If A was less than 7 jump to ActiveDoors_Paint_Skip.
54405 LD HL,22783 HL=22783 (right-hand side).
ActiveDoors_Paint_Skip 54408 ADD A,A HL=HL + A * 2.
54409 ADD A,L
54410 LD L,A
54411 LD (HL),C Writes the attribute value held by C to HL and HL + 1. This is because the number images are two characters wide.
54412 INC HL
54413 LD (HL),C
54414 RET Return.
Prev: 54364 Up: Map Next: 54415