Ticket #2771: setOwner.txt

File setOwner.txt, 2.7 KB (added by Kirben, 18 years ago)

setOwner disasm.

Line 
1Monkey Island 2:
2o_setOwnerOf proc far ; DATA XREF: dseg:0B8Ao
3 ; dseg:0C8Ao dseg:0D8Ao
4 ; dseg:0E8Ao
5
6var_2= word ptr -2
7
8 enter 2, 0
9 push di
10 push si
11 push 80h ; 'Ç'
12 nop
13 push cs
14 call near ptr getVarOrDirectWord
15 mov si, ax
16 push 40h ; '@'
17 nop
18 push cs
19 call near ptr getVarOrDirectByte
20 mov di, ax
21 or di, di
22 jnz cseg_74D0
23 push si
24 push cs
25 call near ptr clearOwnerOf
26 add sp, 2
27 mov al, _currentScript
28 sub ah, ah
29 imul bx, ax, 12h
30 mov [bp+var_2], bx
31 cmp vm_slot.type[bx], ah
32 jnz cseg_74D0
33 mov bx, vm_slot.number[bx]
34 shl bx, 1
35 cmp inventory[bx], si
36 jnz cseg_74D0
37 push di
38 push si
39 call putOwner
40 add sp, 4
41 push di
42 nop
43 push cs
44 call near ptr runInventoryScript
45 add sp, 2
46 push cs
47 call near ptr stopObjectCode
48 pop si
49 pop di
50 leave
51 retf
52; ---------------------------------------------------------------------------
53 db 90h ; É
54; ---------------------------------------------------------------------------
55
56cseg_74D0: ; CODE XREF: o_setOwnerOf+1Bj
57 ; o_setOwnerOf+34j
58 ; o_setOwnerOf+40j
59 push di
60 push si
61 call putOwner
62 add sp, 4
63 push 0
64 nop
65 push cs
66 call near ptr runInventoryScript
67 add sp, 2
68 nop
69 push cs
70 call near ptr nullsub_1
71 pop si
72 pop di
73 leave
74 retf
75o_setOwnerOf endp
76
77Day of the Tentacle:
78o_setOwner proc far ; CODE XREF: executeScript+32J
79 ; DATA XREF: dseg:0D3Ao
80
81var_2= word ptr -2
82
83 enter 2, 0
84 push di
85 push si
86 call pop
87 mov di, ax
88 call pop
89 mov si, ax
90 or di, di
91 jnz loc_712_6BE
92 push si
93 push cs
94 call near ptr clearOwnerOf
95 add sp, 2
96-
97 mov al, _currentScript
98 sub ah, ah
99 imul bx, ax, 14h
100 mov [bp+var_2], bx
101 cmp vm_slot.type[bx], ah
102 jnz loc_712_6BE
103-
104 mov bx, vm_slot.number[bx]
105 shl bx, 1
106 add bx, _inventory
107 cmp [bx], si
108 jnz loc_712_6BE
109 push di
110 push si
111 call putOwner
112 add sp, 4
113 push di
114 call runInventoryScript
115 add sp, 2
116 push cs
117 call near ptr stopObjectCode
118 pop si
119 pop di
120 leave
121 retf
122; ---------------------------------------------------------------------------
123
124loc_712_6BE: ; CODE XREF: o_setOwner+16j
125 ; o_setOwner+2Fj o_setOwner+3Dj
126 push di
127 push si
128 call putOwner
129 add sp, 4
130 push si
131 call runInventoryScript
132 add sp, 2
133 pop si
134 pop di
135 leave
136 retf
137o_setOwner endp
138
139