160 |
|
|
161 |
|
D(bug("FindLibSymbol %s in %s...\n", sym+1, lib+1)); |
162 |
|
|
163 |
< |
if (*(uint32 *)XLM_RUN_MODE == MODE_EMUL_OP) { |
163 |
> |
if (ReadMacInt32(XLM_RUN_MODE) == MODE_EMUL_OP) { |
164 |
|
M68kRegisters r; |
165 |
|
|
166 |
|
// Find shared library |
167 |
< |
static const uint16 proc1[] = { |
168 |
< |
0x558f, // subq.l #2,a7 |
169 |
< |
0x2f08, // move.l a0,-(a7) |
170 |
< |
0x2f3c, 0x7077, 0x7063, // move.l #'pwpc',-(a7) |
171 |
< |
0x2f3c, 0, 1, // move.l #kReferenceCFrag,-(a7) |
172 |
< |
0x2f09, // move.l a1,-(a7) |
173 |
< |
0x2f0a, // move.l a2,-(a7) |
174 |
< |
0x2f0b, // move.l a3,-(a7) |
175 |
< |
0x3f3c, 1, // (GetSharedLibrary) |
176 |
< |
0xaa5a, // CFMDispatch |
177 |
< |
0x301f, // move.w (a7)+,d0 |
178 |
< |
M68K_RTS |
167 |
> |
static const uint8 proc1[] = { |
168 |
> |
0x55, 0x8f, // subq.l #2,a7 |
169 |
> |
0x2f, 0x08, // move.l a0,-(a7) |
170 |
> |
0x2f, 0x3c, 0x70, 0x77, 0x70, 0x63, // move.l #'pwpc',-(a7) |
171 |
> |
0x2f, 0x3c, 0x00, 0x00, 0x00, 0x01, // move.l #kReferenceCFrag,-(a7) |
172 |
> |
0x2f, 0x09, // move.l a1,-(a7) |
173 |
> |
0x2f, 0x0a, // move.l a2,-(a7) |
174 |
> |
0x2f, 0x0b, // move.l a3,-(a7) |
175 |
> |
0x3f, 0x3c, 0x00, 0x01, // (GetSharedLibrary) |
176 |
> |
0xaa, 0x5a, // CFMDispatch |
177 |
> |
0x30, 0x1f, // move.w (a7)+,d0 |
178 |
> |
M68K_RTS >> 8, M68K_RTS & 0xff |
179 |
|
}; |
180 |
|
r.a[0] = (uint32)lib; |
181 |
|
r.a[1] = (uint32)&conn_id; |
187 |
|
return NULL; |
188 |
|
|
189 |
|
// Find symbol |
190 |
< |
static const uint16 proc2[] = { |
191 |
< |
0x558f, // subq.l #2,a7 |
192 |
< |
0x2f00, // move.l d0,-(a7) |
193 |
< |
0x2f08, // move.l a0,-(a7) |
194 |
< |
0x2f09, // move.l a1,-(a7) |
195 |
< |
0x2f0a, // move.l a2,-(a7) |
196 |
< |
0x3f3c, 5, // (FindSymbol) |
197 |
< |
0xaa5a, // CFMDispatch |
198 |
< |
0x301f, // move.w (a7)+,d0 |
199 |
< |
M68K_RTS |
190 |
> |
static const uint8 proc2[] = { |
191 |
> |
0x55, 0x8f, // subq.l #2,a7 |
192 |
> |
0x2f, 0x00, // move.l d0,-(a7) |
193 |
> |
0x2f, 0x08, // move.l a0,-(a7) |
194 |
> |
0x2f, 0x09, // move.l a1,-(a7) |
195 |
> |
0x2f, 0x0a, // move.l a2,-(a7) |
196 |
> |
0x3f, 0x3c, 0x00, 0x05, // (FindSymbol) |
197 |
> |
0xaa, 0x5a, // CFMDispatch |
198 |
> |
0x30, 0x1f, // move.w (a7)+,d0 |
199 |
> |
M68K_RTS >> 8, M68K_RTS & 0xff |
200 |
|
}; |
201 |
|
r.d[0] = conn_id; |
202 |
|
r.a[0] = (uint32)sym; |