![]() |
Routines |
| Prev: DA15 | Up: Map | Next: DAC3 |
|
Used by the routine at Dispatch_Handlers.
Draws CarriedObject and drops it when it lines up with a slot.
|
||||||
|
Point at the carried object.
|
||||||
| Handler_CarriedObject | DA3F | LD HL,$7C70 | Write Buffer_ActiveFont to *CHARS. | |||
| DA42 | LD ($5C36),HL | |||||
| DA45 | LD IX,$648B | Point IX at CarriedObject. | ||||
|
Return unless something is being carried.
|
||||||
| DA49 | LD A,(IX+$00) | Return if nothing is being carried. | ||||
| DA4C | BIT 7,A | |||||
| DA4E | RET NZ | |||||
|
Stash the clip window and use the object's.
|
||||||
| DA4F | LD HL,($6419) | Stash the current clip window on the stack. | ||||
| DA52 | PUSH HL | |||||
| DA53 | LD HL,($641B) | |||||
| DA56 | PUSH HL | |||||
| DA57 | LD L,(IX+$10) | Write the object's clip window to *ClipWindow. | ||||
| DA5A | LD H,(IX+$11) | |||||
| DA5D | LD ($6419),HL | |||||
| DA60 | LD L,(IX+$12) | |||||
| DA63 | LD H,(IX+$13) | |||||
| DA66 | LD ($641B),HL | |||||
|
Store and draw the object.
|
||||||
| DA69 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | ||||
| DA6C | CALL JumpTable_StorePosition | Call JumpTable_StorePosition. | ||||
| DA6F | CALL JumpTable_DrawEntity | Call JumpTable_DrawEntity. | ||||
|
Restore the clip window.
|
||||||
| DA72 | POP HL | Restore the clip window from the stack. | ||||
| DA73 | LD ($641B),HL | |||||
| DA76 | POP HL | |||||
| DA77 | LD ($6419),HL | |||||
|
Only drop when the object is cell-aligned.
|
||||||
| DA7A | LD A,$07 | Return unless both fine offsets are 07. | ||||
| DA7C | CP (IX+$03) | |||||
| DA7F | RET NZ | |||||
| DA80 | CP (IX+$02) | |||||
| DA83 | RET NZ | |||||
|
Only drop on the stored drop cell.
|
||||||
| DA84 | LD A,(IX+$00) | Return unless the column and row match the stored drop cell. | ||||
| DA87 | CP (IX+$0E) | |||||
| DA8A | RET NZ | |||||
| DA8B | LD A,(IX+$01) | |||||
| DA8E | CP (IX+$0F) | |||||
| DA91 | RET NZ | |||||
|
Stamp the object into the room.
|
||||||
| DA92 | LD C,(IX+$00) | Call JumpTable_PrintSprite with the object's cell, size and sprite ID. | ||||
| DA95 | LD B,(IX+$01) | |||||
| DA98 | LD E,(IX+$04) | |||||
| DA9B | LD D,(IX+$05) | |||||
| DA9E | LD A,(IX+$06) | |||||
| DAA1 | CALL JumpTable_PrintSprite | |||||
|
Mark it as no longer carried.
|
||||||
| DAA4 | SET 7,(IX+$00) | Set bit 7 of *IX+00. | ||||
|
Only the Event_RevealLadder object writes a window into the room.
|
||||||
| DAA8 | LD A,(IX+$06) | Skip the window write unless this is D9. | ||||
| DAAB | CP $D9 | |||||
| DAAD | RET NZ | |||||
| DAAE | LD C,(IX+$00) | Convert the drop cell into a Buffer_RoomTiles offset. | ||||
| DAB1 | LD B,(IX+$01) | |||||
| DAB4 | RES 7,C | |||||
| DAB6 | CALL JumpTable_ConvertCoordinate | |||||
|
Write a 2-wide window into those tiles.
|
||||||
| DAB9 | LD DE,$5DCE | Write 0E and 0F into those tiles. | ||||
| DABC | ADD HL,DE | |||||
| DABD | LD (HL),$0E | |||||
| DABF | INC HL | |||||
| DAC0 | LD (HL),$0F | |||||
| DAC2 | RET | Return. | ||||
| Prev: DA15 | Up: Map | Next: DAC3 |