Prev: 8DF9 Up: Map Next: 8EC0
8DFC: Tablet / Alter Action Function.
Checks for a dropped object, if it matches the expected items
A graphic on the scenery item is replaced with an ascii character.
Input
IX Pointer to scenery item action data.
ActionTablet 8DFC LD A,(CamDirection_DFD2) Only works if camera is facing (3)
8DFF CP $03
8E01 JR NZ,ActionTablet_0
8E03 LD HL,ActionTabletExt Store address for tablet.
8E06 LD (IX+$0E),L
8E09 LD (IX+$0F),H
8E0C LD HL,( BitmapData_Tablet) Store address of the tablet's bitmap.
8E0F LD (IX+$10),L
8E12 LD (IX+$11),H
8E15 LD (IX+$12),$02 Along with the width.
8E19 LD HL,(ManData_PosPrimary_dfc3)
8E1C LD E,(IX+$05)
8E1F LD D,(IX+$06)
This entry point is used by the routine at ActionSeal.
ActionAlterEntry 8E22 CALL Vector_ABS(hl_minus_de) Get distance between man and scenery item.
8E25 LD DE,$0022 If distance less than 22 (within range)?
8E28 AND A
8E29 SBC HL,DE
8E2B JR C,ActionTablet_1 Yes.
8E2D RET Z No, so see if man is within 7 units of item.
This entry point is used by the routine at ActionSeal.
ActionTablet_0 8E2E XOR A If out of range, clear flags.
8E2F LD (TripValue),A
8E32 LD (IX+$0B),A
8E35 RET
Item within range.
ActionTablet_1 8E36 ADD HL,DE Get distance again.
8E37 LD A,(IX+$0D) Is man next to item flag set?
8E3A AND A
8E3B JR NZ,ActionTablet_2
8E3D LD DE,$0007
8E40 AND A
8E41 SBC HL,DE
8E43 RET NC If not just return.
8E44 LD HL,TripValue Set flags to show man is next to item, ready to drop an item.
8E47 LD (HL),$01
8E49 INC HL
8E4A LD HL,$0000
8E4D LD (IX+$0D),$01
8E51 RET
Man next to item.
ActionTablet_2 8E52 PUSH HL
8E53 LD A,(ActionFlags) Has an object just been dropped.
8E56 BIT 7,A
8E58 JR Z,ActionTablet_6
8E5A RES 7,A Yes, reset flag.
8E5C LD (ActionFlags),A
8E5F LD HL,(ActionObjectDroppedPtr) Get address of dropped object.
8E62 INC HL
8E63 INC HL
8E64 LD A,(HL) Get its bitmap index.
This entry point is used by the routine at ActionTabletExt.
ActionTablet_3 8E65 LD B,$05 }
8E67 LD L,(IX+$0E) Get pointer to extended scenery data.
8E6A LD H,(IX+$0F)
Look for object within extended data.
ActionTablet_4 8E6D CP (HL)
8E6E JR Z,ActionTablet_5 Object found.
8E70 INC HL
8E71 INC HL
8E72 INC HL
8E73 DJNZ ActionTablet_4
8E75 JR ActionTablet_6 Object not found.
Object found in list
ActionTablet_5 8E77 LD (HL),$00 Mark it off the list.
8E79 INC HL Get ascii value of icon to replace image on scenery
8E7A LD A,(HL)
8E7B AND A
8E7C JR Z,ActionTablet_6 Ignore if zero.
8E7E INC HL Get bitmap offset to draw icon onto.
8E7F LD L,(HL)
8E80 LD H,$00
8E82 LD E,(IX+$10) Get bitmap address to offset from first bitmap.
8E85 LD D,(IX+$11)
8E88 ADD HL,DE Add the two together to get true offset.
8E89 LD DE,BmpStart_E
8E8C LD C,(IX+$12) Get bitmap width.
8E8F LD B,$00
8E91 PUSH IX Draw compass letter onto scenery item to replace image of object.
8E93 CALL Vector_Char_InsertIntoBitmap
8E96 CALL Vector_Screen_DrawStage Update everything.
8E99 POP IX
ActionTablet_6 8E9B POP HL If man is range just return.
8E9C LD DE,$0007
8E9F AND A
8EA0 SBC HL,DE
8EA2 RET C
8EA3 XOR A
8EA4 LD (TripValue),A If not then reset flags for this test.
8EA7 LD (IX+$0D),A
8EAA RET
8EAB INC H
8EAC LD E,(HL)
8EAD LD (DE),A
8EAE SUB A
8EAF INC BC
8EB0 LD D,H
8EB1 LD C,(HL)
8EB2 LD C,(HL)
8EB3 LD E,B
8EB4 JR NZ,DisplayMenu_0
8EB6 JR NZ,DisplayMenu_1
8EB8 JR NZ,$8EDA
8EBA NOP
8EBB NOP
8EBC NOP
8EBD NOP
8EBE NOP
8EBF NOP
Prev: 8DF9 Up: Map Next: 8EC0