| The Hobbit (v1.0) | Routines |
| Prev: 9404 | Up: Map | Next: 946F |
|
Used while choosing between candidate objects (86ED). Sets B5EC to 1 if the action could possibly apply to the target: either there is a default handler for the action (C61F), or the target itself has a handler for it (9ADC). The checks in A100 are also applied. Sets B5EC to 0 if the action is not possible at all, for example when the target is the actor.
|
||||
| 9436 | PUSH IX | Save the caller's IX and HL | ||
| 9438 | PUSH HL | |||
| 9439 | CALL $9A9F | Does the action even make sense (not done to yourself, for instance)? | ||
| 943C | LD A,$00 | Assume not | ||
| 943E | JR Z,$9468 | It does not: record that and stop | ||
| 9440 | LD A,($B5D8) | A = the action being tried | ||
| 9443 | LD IX,$C61F | Is there a default handler for it (one that applies to any object)? | ||
| 9447 | CALL $9D12 | |||
| 944A | CP $FF | (A is left holding either the action, if found, or $FF if there is no default handler) | ||
| 944C | LD A,$01 | Assume it could apply | ||
| 944E | JR NZ,$9468 | A default handler exists: that settles it | ||
| 9450 | CALL $A100 | No default handler: is this one of the actions that uses the instrument's own handlers rather than the target's? | ||
| 9453 | LD A,$01 | Assume it could apply | ||
| 9455 | JR Z,$9468 | Yes: accept it for now (the instrument itself gets checked properly later) | ||
| 9457 | LD A,($B5D9) | No: does the TARGET itself carry a handler for this action? | ||
| 945A | CALL $9B25 | |||
| 945D | LD A,($B5D8) | |||
| 9460 | CALL $9ADC | |||
| 9463 | LD A,$01 | Assume it could apply | ||
| 9465 | JR C,$9468 | It does (found): that settles it | ||
| 9467 | SUB A | No handler anywhere: it could not apply after all | ||
| 9468 | LD ($B5EC),A | Record the answer | ||
| 946B | POP HL | Restore the caller's HL and IX | ||
| 946C | POP IX | |||
| 946E | RET | |||
| Prev: 9404 | Up: Map | Next: 946F |