Prev: 51840 Up: Map Next: 51943
51841: Run a phase and bonus level until completed or game over
Used by the routine at Init_Title_Screen.
Cashboxes_Completed 51841 CALL Cashboxes_Completed_0 Initialize everything and run the phase.
51844 RET C Return we've run out of lives.
At this point, the phase has been complete successfully, so flash the deposit boxes.
51845 LD B,16 Flash the deposit boxes 10 times.
Cashboxes_Flash_Loop 51847 PUSH BC Remember this.
51848 LD A,B Alternate between 0 and 1 for each iteration.
51849 AND 1
51851 CALL Deposit_Flash_Prep Display or hide all boxes.
51854 LD B,16 Pause.
51856 CALL Halt_Loop
51859 POP BC Restore number of times.
51860 DJNZ Cashboxes_Flash_Loop Loop if there is more to do.
51862 LD B,48 Pause.
51864 CALL Halt_Loop
51867 LD A,B A is now 0.
51868 CALL Deposit_Flash_Prep Set the initial state up and run the phase.
Get three random times from three separate sources, and run the duel with them.
51871 CALL Random_Number Generate a random number.
51874 LD B,A Put this in B as the delay before the first dueller draws.
51875 LD A,R Store R in C as the delay before the second dueller draws.
51877 LD C,A
51878 ADD A,B Combine the two previous values (ignoring overflow).
51879 LD D,A Put this in D as the delay before the third dueller draws.
51880 LD A,(52175) The value in 52175 is never used.
51883 LD HL,52148 Point to data that will be copied to Print_TwoToneText_Alias.
51886 CALL 50112 Run the duel.
51889 LD (52175),A Set 52175 to 1 if the duel completed successfully, or 0 if player lost a life.
51892 LD B,0 Pause and return.
51894 JP Halt_Loop
This routine sets or clears all the deposit flags, then displays them. This is used to flash the display at the end of a phase.
Deposit_Flash_Prep 51897 LD HL,52365 Writes A across all the deposit flags (copies to each from DoorDeposited_01).
51900 LD DE,52366
51903 LD BC,13
51906 LD (HL),A
51907 LDIR
51909 JP 52379 Redraw the boxes.
This entry point is used by the routine in Cashboxes_Completed.
Cashboxes_Completed_0 51912 CALL Prep_Display_Phase Print "day n" (if required) and "phase n".
Initialize the state of play, either from starting a new phase or losing a life. This entry point is used by the routines at Flash_Lives and 52551.
Cashboxes_Completed_1 51915 XOR A Clear the "mistakes" bit field at Mistakes.
51916 LD (54014),A
51919 CALL Cashboxes_Completed_2
51922 JR 51943 Jump to the main loop.
Initialize some things.
Cashboxes_Completed_2 51924 CALL Populate_Door_Buffer Initialize door flags.
51927 CALL Draw_PlayWithDoors Initialize the playfield.
51930 CALL Life_Images Display the "life" images.
51933 CALL 52379 Display the deposit boxes.
51936 CALL Draw_Score Display the score.
51939 CALL ActiveDoors Highlight the active doors.
51942 RET Return.
Prev: 51840 Up: Map Next: 51943