Prev: AC35 Up: Map Next: ACC6
AC36: routine21
Used by the routine at main_routine.
routine21 AC36 LD A,(NO_PLA) load NO_PLA into B as loop counter
AC39 LD B,A
routine21_0 AC3A PUSH BC preserve BC
AC3B LD A,(NO_PLA) load NO_PLA into A
AC3E SUB B subtract loop counter from A and store result in current_player variable and in temp_wizard_number ???
AC3F LD (current_player),A
AC42 LD (temp_wizard_number),A
AC45 LD HL,unknown_table_3 add result as offset to address of unknown_table_3
AC48 LD D,$00
AC4A LD E,A
AC4B ADD HL,DE
AC4C LD A,(HL) read byte at offset in table
AC4D BIT 4,A if bit 4 is set then jump to end of loop
AC4F JR NZ,routine21_6
AC51 LD HL,computer_player_flag clear computer_player_flag
AC54 LD (HL),$00
AC56 LD A,(current_player) load byte from WIZCON using current_player as an offset
AC59 LD HL,WIZCON
AC5C LD D,$00
AC5E LD E,A
AC5F ADD HL,DE
AC60 LD A,(HL)
AC61 OR A if the byte is zero then jump forward to routine21_1
AC62 JR Z,routine21_1
AC64 LD A,$01 else set computer_player_flag
AC66 LD (computer_player_flag),A
routine21_1 AC69 LD A,$46 set ATTR-P to $46 (bright yellow on black)
AC6B LD ($5C8F),A
AC6E CALL clear_bottom_row clear bottom row of screen (line 22)
AC71 LD A,(current_player) current_player into A and add $29 to get message number of player name in game messages table 1
AC74 ADD A,$29
AC76 LD BC,$1600 Print wizard name at coordinates (0,22)
AC79 CALL MPRINT
AC7C LD A,$37 Print s_turn_string
AC7E CALL MPRINT
AC81 CALL routine50 call routine50 ???
AC84 HALT do nothing for two frames
AC85 HALT
AC86 LD A,(current_player) copy current_player into temp_wizard_number ???
AC89 LD (temp_wizard_number),A
AC8C CALL highlight_objects call highlight_objects ???
AC8F LD B,$FF Busy wait loop to pause for approximately 1/4 second ???
routine21_2 AC91 PUSH BC
AC92 LD B,$FF
routine21_3 AC94 DJNZ routine21_3
AC96 POP BC
AC97 DJNZ routine21_2
AC99 CALL routine50 call routine50 ???
AC9C CALL wait_key_seed wait for a keypress
AC9F LD A,(computer_player_flag) if current player is human then jump forward to routine21_5
ACA2 OR A
ACA3 JR Z,routine21_5
ACA5 LD B,$3C else do nothing for 60 frames
routine21_4 ACA7 HALT
ACA8 DJNZ routine21_4
ACAA CALL clear_bottom_row clear bottom row of screen (line 22)
ACAD JP routine54 jump to routine54 ???
routine21_5 ACB0 CALL clear_bottom_row clear bottom row of screen (line 22)
ACB3 CALL routine22 wait for player to press 'S' or '0'
ACB6 CALL wait_no_key_seed wait for no key to be pressed
This entry point is used by the routine at routine54.
routine21_6 ACB9 POP BC restore BC
ACBA DEC B decrement loop counter and loop back to routine21_0 if not zero
ACBB JP NZ,routine21_0
ACBE LD HL,unknown32 set unknown32 to zero ???
ACC1 LD (HL),$00
ACC3 IM 1 set Interrupt Mode 1 and return
ACC5 RET
Prev: AC35 Up: Map Next: ACC6