![]() |
Routines |
| Prev: 55829 | Up: Map | Next: 56003 |
|
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 | 55871 | LD HL,31856 | Write Buffer_ActiveFont to *CHARS. | |||
| 55874 | LD (23606),HL | |||||
| 55877 | LD IX,25739 | Point IX at CarriedObject. | ||||
|
Return unless something is being carried.
|
||||||
| 55881 | LD A,(IX+0) | Return if nothing is being carried. | ||||
| 55884 | BIT 7,A | |||||
| 55886 | RET NZ | |||||
|
Stash the clip window and use the object's.
|
||||||
| 55887 | LD HL,(25625) | Stash the current clip window on the stack. | ||||
| 55890 | PUSH HL | |||||
| 55891 | LD HL,(25627) | |||||
| 55894 | PUSH HL | |||||
| 55895 | LD L,(IX+16) | Write the object's clip window to *ClipWindow. | ||||
| 55898 | LD H,(IX+17) | |||||
| 55901 | LD (25625),HL | |||||
| 55904 | LD L,(IX+18) | |||||
| 55907 | LD H,(IX+19) | |||||
| 55910 | LD (25627),HL | |||||
|
Store and draw the object.
|
||||||
| 55913 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | ||||
| 55916 | CALL JumpTable_StorePosition | Call JumpTable_StorePosition. | ||||
| 55919 | CALL JumpTable_DrawEntity | Call JumpTable_DrawEntity. | ||||
|
Restore the clip window.
|
||||||
| 55922 | POP HL | Restore the clip window from the stack. | ||||
| 55923 | LD (25627),HL | |||||
| 55926 | POP HL | |||||
| 55927 | LD (25625),HL | |||||
|
Only drop when the object is cell-aligned.
|
||||||
| 55930 | LD A,7 | Return unless both fine offsets are 7. | ||||
| 55932 | CP (IX+3) | |||||
| 55935 | RET NZ | |||||
| 55936 | CP (IX+2) | |||||
| 55939 | RET NZ | |||||
|
Only drop on the stored drop cell.
|
||||||
| 55940 | LD A,(IX+0) | Return unless the column and row match the stored drop cell. | ||||
| 55943 | CP (IX+14) | |||||
| 55946 | RET NZ | |||||
| 55947 | LD A,(IX+1) | |||||
| 55950 | CP (IX+15) | |||||
| 55953 | RET NZ | |||||
|
Stamp the object into the room.
|
||||||
| 55954 | LD C,(IX+0) | Call JumpTable_PrintSprite with the object's cell, size and sprite ID. | ||||
| 55957 | LD B,(IX+1) | |||||
| 55960 | LD E,(IX+4) | |||||
| 55963 | LD D,(IX+5) | |||||
| 55966 | LD A,(IX+6) | |||||
| 55969 | CALL JumpTable_PrintSprite | |||||
|
Mark it as no longer carried.
|
||||||
| 55972 | SET 7,(IX+0) | Set bit 7 of *IX+0. | ||||
|
Only the Event_RevealLadder object writes a window into the room.
|
||||||
| 55976 | LD A,(IX+6) | Skip the window write unless this is 217. | ||||
| 55979 | CP 217 | |||||
| 55981 | RET NZ | |||||
| 55982 | LD C,(IX+0) | Convert the drop cell into a Buffer_RoomTiles offset. | ||||
| 55985 | LD B,(IX+1) | |||||
| 55988 | RES 7,C | |||||
| 55990 | CALL JumpTable_ConvertCoordinate | |||||
|
Write a 2-wide window into those tiles.
|
||||||
| 55993 | LD DE,24014 | Write 14 and 15 into those tiles. | ||||
| 55996 | ADD HL,DE | |||||
| 55997 | LD (HL),14 | |||||
| 55999 | INC HL | |||||
| 56000 | LD (HL),15 | |||||
| 56002 | RET | Return. | ||||
| Prev: 55829 | Up: Map | Next: 56003 |