Routines |
Prev: EED3 | Up: Map | Next: EFCB |
This checks that the hero is within the roll call bounds. hero_map_position_x must be in ($72..$7C) and hero_map_position_y must be in ($6A..$72). If not, then the bell is sounded and the "MISSED ROLL CALL" message is queued. Otherwise all visible characters are made to face bottom left.
|
||||
Is the hero within the roll call area bounds?
|
||||
event_roll_call | EF9A | LD DE,$727C | Load DE with the X coordinates of the roll call area ($72..$7C) | |
EF9D | LD HL,$81B8 | Point HL at global map position (hero) | ||
EFA0 | LD B,$02 | Set B for two iterations | ||
Start loop
|
||||
event_roll_call_0 | EFA2 | LD A,(HL) | Fetch the next coord | |
EFA3 | CP D | Jump if the hero's out of bounds | ||
EFA4 | JR C,not_at_roll_call | |||
EFA6 | CP E | |||
EFA7 | JR NC,not_at_roll_call | |||
EFA9 | INC HL | On the second iteration advance to hero_map_position_y ($6A..$72) | ||
EFAA | LD DE,$6A72 | On the second iteration load DE with the Y coordinates of the main gate ($6A..$72) | ||
EFAD | DJNZ event_roll_call_0 | ...loop | ||
Make all visible characters turn forward.
|
||||
EFAF | LD HL,$800D | Point HL at the visible character's input field (always $800D) | ||
EFB2 | LD B,$08 | Set B for 8 iterations | ||
Start loop
|
||||
event_roll_call_1 | EFB4 | LD (HL),$80 | Set input to input_KICK | |
EFB6 | INC L | Point HL at the visible character's direction field (always $800E) | ||
EFB7 | LD (HL),$03 | Set the direction field to 3 => face bottom left | ||
EFB9 | LD A,L | Advance HL to the next vischar | ||
EFBA | ADD A,$1F | |||
EFBC | LD L,A | |||
EFBD | DJNZ event_roll_call_1 | ...loop | ||
EFBF | RET | Return | ||
not_at_roll_call | EFC0 | XOR A | Make the bell ring perpetually | |
EFC1 | LD ($A130),A | |||
EFC4 | LD B,A | Queue the message "MISSED ROLL CALL" | ||
EFC5 | CALL queue_message | |||
EFC8 | JP hostiles_pursue | Exit via hostiles_pursue |
Prev: EED3 | Up: Map | Next: EFCB |