Prev: 52250 Up: Map Next: 52520
52400: Draw Offset Slots
Used by the routines at Advance_Object_Slots and Dispatch_Phase_Two.
For each occupied slot at Object_Slots, subtracts *Heading and *Heading_Y, tests whether the point is in view, and jumps to the slot's draw routine.
Set up the slot walk.
Draw_Offset_Slots 52400 LD A,(60972) Copy *Object_Slot_Count to B.
52403 LD B,A
52404 LD IX,60160 Point IX at Object_Slots.
Process one slot.
Draw_Offset_Slots_Loop 52408 LD A,(IX+0) Jump to Draw_Offset_Slots_Advance if this slot is empty.
52411 AND A
52412 JR Z,Draw_Offset_Slots_Advance
52414 XOR A Write 0 to *Draw_Flag_A and *Draw_Flag_B.
52415 LD (60954),A
52418 LD (60955),A
52421 LD HL,58880 Point *Buffer_Pointer_A at Draw_Buffer_A.
52424 LD (60956),HL
52427 LD HL,59008 Point *Buffer_Pointer_B at Draw_Buffer_B.
52430 LD (60958),HL
52433 EXX Switch to the shadow registers.
52434 LD L,(IX+5) Copy the depth to *Depth.
52437 LD H,(IX+6)
52440 LD (60946),HL
52443 LD DE,(61042) Subtract *Heading from the Y coordinate and write it to *Rotated_Y.
52447 LD L,(IX+3)
52450 LD H,(IX+4)
52453 AND A
52454 SBC HL,DE
52456 LD (60944),HL
52459 LD DE,(61173) Subtract *Heading_Y from the X coordinate and write it to *Rotated_X.
52463 LD L,(IX+1)
52466 LD H,(IX+2)
52469 AND A
52470 SBC HL,DE
52472 LD (60942),HL
52475 CALL Test_In_View Call Test_In_View.
52478 EXX Switch back.
52479 JR NZ,Draw_Offset_Slots_Advance Jump to Draw_Offset_Slots_Advance if the point is out of view.
52481 LD HL,52495 Point the return address at Draw_Offset_Slots_Draw (using the stack).
52484 PUSH HL
52485 LD A,(IX+7) Fetch the letter from the slot.
52488 LD L,(IX+9) Jump to the slot handler.
52491 LD H,(IX+10)
52494 JP (HL)
Finish the draw.
Draw_Offset_Slots_Draw 52495 LD HL,(60958) Write 0 to the address at *Buffer_Pointer_B.
52498 LD (HL),0
52500 PUSH IX Stash IX and BC on the stack.
52502 PUSH BC
52503 CALL Process_Draw_List_23 Call Process_Draw_List_23.
52506 CALL Process_Draw_List_1 Call Process_Draw_List_1.
52509 POP BC Restore BC and IX from the stack.
52510 POP IX
Advance to the next slot.
Draw_Offset_Slots_Advance 52512 LD DE,11 Advance the slot pointer by 11.
52515 ADD IX,DE
52517 DJNZ Draw_Offset_Slots_Loop Decrease the slot counter by one and loop back to Draw_Offset_Slots_Loop until it is zero.
52519 RET Return.
Prev: 52250 Up: Map Next: 52520