![]() |
Routines |
| Prev: CC1A | Up: Map | Next: CD28 |
|
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 | CCB0 | LD A,($EE2C) | Copy *Object_Slot_Count to B. | |
| CCB3 | LD B,A | |||
| CCB4 | LD IX,$EB00 | Point IX at Object_Slots. | ||
|
Process one slot.
|
||||
| Draw_Offset_Slots_Loop | CCB8 | LD A,(IX+$00) | Jump to Draw_Offset_Slots_Advance if this slot is empty. | |
| CCBB | AND A | |||
| CCBC | JR Z,Draw_Offset_Slots_Advance | |||
| CCBE | XOR A | Write 00 to *Draw_Flag_A and *Draw_Flag_B. | ||
| CCBF | LD ($EE1A),A | |||
| CCC2 | LD ($EE1B),A | |||
| CCC5 | LD HL,$E600 | Point *Buffer_Pointer_A at Draw_Buffer_A. | ||
| CCC8 | LD ($EE1C),HL | |||
| CCCB | LD HL,$E680 | Point *Buffer_Pointer_B at Draw_Buffer_B. | ||
| CCCE | LD ($EE1E),HL | |||
| CCD1 | EXX | Switch to the shadow registers. | ||
| CCD2 | LD L,(IX+$05) | Copy the depth to *Depth. | ||
| CCD5 | LD H,(IX+$06) | |||
| CCD8 | LD ($EE12),HL | |||
| CCDB | LD DE,($EE72) | Subtract *Heading from the Y coordinate and write it to *Rotated_Y. | ||
| CCDF | LD L,(IX+$03) | |||
| CCE2 | LD H,(IX+$04) | |||
| CCE5 | AND A | |||
| CCE6 | SBC HL,DE | |||
| CCE8 | LD ($EE10),HL | |||
| CCEB | LD DE,($EEF5) | Subtract *Heading_Y from the X coordinate and write it to *Rotated_X. | ||
| CCEF | LD L,(IX+$01) | |||
| CCF2 | LD H,(IX+$02) | |||
| CCF5 | AND A | |||
| CCF6 | SBC HL,DE | |||
| CCF8 | LD ($EE0E),HL | |||
| CCFB | CALL Test_In_View | Call Test_In_View. | ||
| CCFE | EXX | Switch back. | ||
| CCFF | JR NZ,Draw_Offset_Slots_Advance | Jump to Draw_Offset_Slots_Advance if the point is out of view. | ||
| CD01 | LD HL,$CD0F | Point the return address at Draw_Offset_Slots_Draw (using the stack). | ||
| CD04 | PUSH HL | |||
| CD05 | LD A,(IX+$07) | Fetch the letter from the slot. | ||
| CD08 | LD L,(IX+$09) | Jump to the slot handler. | ||
| CD0B | LD H,(IX+$0A) | |||
| CD0E | JP (HL) | |||
|
Finish the draw.
|
||||
| Draw_Offset_Slots_Draw | CD0F | LD HL,($EE1E) | Write 00 to the address at *Buffer_Pointer_B. | |
| CD12 | LD (HL),$00 | |||
| CD14 | PUSH IX | Stash IX and BC on the stack. | ||
| CD16 | PUSH BC | |||
| CD17 | CALL Process_Draw_List_23 | Call Process_Draw_List_23. | ||
| CD1A | CALL Process_Draw_List_1 | Call Process_Draw_List_1. | ||
| CD1D | POP BC | Restore BC and IX from the stack. | ||
| CD1E | POP IX | |||
|
Advance to the next slot.
|
||||
| Draw_Offset_Slots_Advance | CD20 | LD DE,$000B | Advance the slot pointer by 0B. | |
| CD23 | ADD IX,DE | |||
| CD25 | DJNZ Draw_Offset_Slots_Loop | Decrease the slot counter by one and loop back to Draw_Offset_Slots_Loop until it is zero. | ||
| CD27 | RET | Return. | ||
| Prev: CC1A | Up: Map | Next: CD28 |