![]() |
Routines |
| Prev: 45981 | Up: Map | Next: 46184 |
|
Used by the routine at ProcessDisplayPointer.
When the count is still set, swaps the two display pointers and reads the object flags.
|
||||
| SwapObjectDisplayPointers | 46085 | AND A | Jump ahead to SwapObjectDisplayPointers_ExtractObjectAttributes if the count is zero. | |
| 46086 | JR Z,SwapObjectDisplayPointers_ExtractObjectAttributes | |||
| 46088 | LD HL,(45448) | Read the two pointers at 45448 and ObjectTablePointer+12. | ||
| 46091 | LD DE,(45450) | |||
| 46095 | LD (45448),DE | Store the pointer from DE at 45448. | ||
| 46099 | LD (45450),HL | Store the pointer from HL at 45450. | ||
|
Extract object attributes.
|
||||
| SwapObjectDisplayPointers_ExtractObjectAttributes | 46102 | CALL ExtractObjectAttributes | Call ExtractObjectAttributes to read the object's flags. | |
| 46105 | LD HL,45448 | Jump ahead to SwapObjectDisplayPointers_TestStepObjectMatches when the saved display pointer at 45448 is set. | ||
| 46108 | LD A,(HL) | |||
| 46109 | INC HL | |||
| 46110 | OR (HL) | |||
| 46111 | JR NZ,SwapObjectDisplayPointers_TestStepObjectMatches | |||
| 46113 | LD A,(40990) | Take the display flag and continue at SwapObjectDisplayPointers_RunDisplayPointer. | ||
| 46116 | JR SwapObjectDisplayPointers_RunDisplayPointer | |||
|
Step back to the object id and see whether it matches the schedule.
|
||||
| SwapObjectDisplayPointers_TestStepObjectMatches | 46118 | DEC HL | Jump ahead to SwapObjectDisplayPointers_0 if this id does not match the schedule entry. | |
| 46119 | LD A,(HL) | |||
| 46120 | CP (IY+14) | |||
| 46123 | JR NZ,SwapObjectDisplayPointers_0 | |||
| 46125 | INC HL | Jump ahead to SwapObjectDisplayPointers_ObjectAttributeContinue if this id matches the schedule entry. | ||
| 46126 | LD A,(HL) | |||
| 46127 | CP (IY+15) | |||
| 46130 | JR Z,SwapObjectDisplayPointers_ObjectAttributeContinue | |||
| 46132 | DEC HL | Step back one entry. | ||
| SwapObjectDisplayPointers_0 | 46133 | LD A,(HL) | Go to SwapObjectDisplayPointers_ObjectAttributeContinue if this display byte does not match the schedule. | |
| 46134 | CP (IY+16) | |||
| 46137 | JR NZ,SwapObjectDisplayPointers_ObjectAttributeContinue | |||
| 46139 | INC HL | Read the next display byte and compare it with IY+17. | ||
| 46140 | LD A,(HL) | |||
| 46141 | CP (IY+17) | |||
| SwapObjectDisplayPointers_ObjectAttributeContinue | 46144 | LD A,(40989) | Take the object attribute and continue at SwapObjectDisplayPointers_TestBitClear when the display byte does not match IY+17. | |
| 46147 | JR NZ,SwapObjectDisplayPointers_TestBitClear | |||
| SwapObjectDisplayPointers_RunDisplayPointer | 46149 | XOR 32 | Flip bit 5 of the value. | |
| SwapObjectDisplayPointers_TestBitClear | 46151 | BIT 5,A | Jump ahead to SwapObjectDisplayPointers_ObjectTablePointer if bit 5 is clear. | |
| 46153 | LD BC,4616 | |||
| 46156 | JR Z,SwapObjectDisplayPointers_ObjectTablePointer | |||
| 46158 | LD BC,2066 | Take 2066 for the display. | ||
| SwapObjectDisplayPointers_ObjectTablePointer | 46161 | LD HL,45442 | Use the object table pointer (ObjectTablePointer+4). | |
| 46164 | LD (HL),B | |||
| 46165 | INC HL | |||
| 46166 | LD (HL),C | |||
| 46167 | LD A,B | |||
| 46168 | LD DE,45426 | Take the display data pointer. | ||
| 46171 | LD HL,45421 | Point HL at the display flag at DisplayFlag and call CopySixDisplayBytes to copy six bytes. | ||
| 46174 | CALL CopySixDisplayBytes | |||
| 46177 | LD A,C | Take the attribute count and point at the second display flag. | ||
| 46178 | LD DE,45432 | |||
| 46181 | LD HL,45422 | |||
|
View the equivalent code in;
|
||||
| Prev: 45981 | Up: Map | Next: 46184 |