Prev: 35141 Up: Map Next: 35393
35293: Display and process input for character selection menu for "travel to", "summon" or "locate"
Used by the routines at 32035, 33036 and 33312.
Input
HL (On stack) Pointer to text ("TRAVEL TO", "SUMMON" or "LOCATE") pushed onto stack before call to this routine
35293 CALL 38116 Set parameters for and play short downward scale sound...
35296 CALL 38116 ...twice
35299 LD A,(23467) Load A with 1 if Banshee is released, else load with 0...
35302 AND 1 ...
35304 ADD A,11 Set height of character selection menu window according to whether or not Banshee is free...
35306 LD (41901),A ...
35309 LD A,3 Display character selection menu...
35311 CALL 36979 ...
35314 LD HL,44017 Print "WHO DO YOU WANT TO..." text...
35317 CALL 36725 ...
35320 POP HL Restore HL (address to return to upon RET instruction)...
35321 EX (SP),HL ...and swap with next value on stack (pointer to text that was PUSHed before this routine was called)
35322 CALL 36725 Print the text
35325 LD HL,43221 Set character at 43221 (letter preceding menu items) to "@" (i.e. the character immediately before "A")...
35328 LD A,64 ...
35330 LD (HL),A ...
35331 LD B,7 Load B with 7 as there are initially 7 characters
35333 LD A,(23467) If Banshee is not released...
35336 BIT 0,A ...
35338 JR Z,35341 ...then skip ahead to 35341
35340 INC B Add one as with Banshee free there are 8 characters
35341 LD A,B Load number of characters into A...
35342 LD (35375),A ...and use to modify instruction at 35374
35345 XOR A Set B to zero...
35346 LD B,A ...
35347 PUSH AF Store AF
35348 PUSH BC Store BC
35349 LD (30615),A Change Current Character to value in A
35352 LD A,B Copy B into A
35353 ADD A,65 Set character at 43221 (letter preceding menu items) to ASCII code of "A", plus index of character...
35355 LD (43221),A ...
35358 LD HL,43220 Point HL at this prefix text...
35361 CALL 36725 ...and print it
35364 LD HL,34905 Point HL to code to print full name of Current Character...
35367 CALL 36725 ...and print it
35370 POP BC Restore BC (B=current character number)
35371 INC B Increase B for next character
35372 POP AF Restore AF
35373 INC A Increase A to count number characters printed in menu
The operand of the instruction at 35374 represents the number of currently active characters in the game (excluding Magic Knight). This is modified by the instruction at 35342.
35374 CP 7 If number of characters printed is not equal to number of characters to print...
35376 JR NZ,35347 ...then loop back to 35347 for next character
35378 CALL 37333 Process input for menu, and load ASCII code of shortcut for selected (i.e. SPACE or fire pressed) item into A
35381 SUB 65 Subtract ASCII code of "A" from letter of character chosen to get index of selected character in A
35383 LD (30615),A Set this to be the Current Character
35386 CALL 34896 Print short name of Current Character in command summary window at bottom of screen
35389 CALL 35393 Display warning and abort if command is not safe while Gimbal whited-out
35392 RET Return
Prev: 35141 Up: Map Next: 35393