Prev: 51136 Up: Map Next: 51521
51173: Display title screen
Displays the title screen and on return, sets the control method and initiates variables for a new game.
Init_Title_Screen 51173 LD HL,52148 Calls TitleScreen with HL=Copied_5B80.
51176 CALL TitleScreen
51179 LD B,0 Unused.
51181 LD A,(23728) Grab the value stored at Controller and if it is $01 then jump ahead to Set_Control_Alias which writes Controls_Keyboard to Control_Routine_Alias.
51184 LD HL,54171
51187 DEC A
51188 JR Z,Set_Control_Alias
51190 LD HL,54162 Write Controls_Joystick to Control_Routine_Alias.
Set_Control_Alias 51193 LD (52754),HL
Resets all game variables/ states ready for a new game.
51196 LD HL,52614 Clears the score (writes 0 over seven bytes from Scoredigit06).
51199 LD DE,52615
51202 LD (HL),0
51204 LD BC,6
51207 LDIR
Starting_Lives 51209 LD A,3 Initialise Lives to 3.
51211 LD (52313),A
51214 LD HL,257 Initialise CashboxReference_Inactive to 257.
51217 LD (54364),HL
51220 LD HL,0 Clears Door_Routine_01, Door_Routine_02 and Door_Routine_03 (sets them to 0000).
51223 LD (52756),HL
51226 LD (52758),HL
51229 LD (52760),HL
51232 LD HL,8224 Clear Day_ASCII and Phase_ASCII to 8224 (ASCII space-space).
51235 LD (51800),HL
51238 LD (51802),HL
51241 LD HL,52365 Clear down the deposit flags (copies 0 to each from DoorDeposited_01).
51244 LD DE,52366
51247 LD BC,13
51250 LD (HL),0
51252 LDIR
51254 XOR A Set the border to black.
51255 OUT (254),A
51257 INC A Write 1 to 52175.
51258 LD (52175),A
51261 CALL Init_Progress
51264 CALL Set_Day_Attributes
51267 CALL Prep_Display_Day
51270 LD A,3 Writes 3 to 52763.
51272 LD (52763),A
51275 LD HL,1280 Writes 1280 to 52764.
51278 LD (52764),HL
51281 LD A,1 Writes 1 to 53649.
51283 LD (53649),A
51286 LD A,(23729) Grabs the Level, if it's level 1 then jump to Level_01 with HL=Phase.
51289 LD HL,51786
51292 DEC A
51293 JR Z,Level_01
51295 CALL 51521
51298 INC (HL)
51299 CALL 51521
51302 INC (HL)
51303 DEC A
51304 JR Z,Init_Title_Screen_0
51306 CALL 51521
51309 INC (HL)
51310 CALL 51521
51313 INC (HL)
51314 CALL 51521
51317 INC (HL)
51318 JR Init_Title_Screen_1
Level_01 51320 LD HL,52802 Writes Choose_Default_Set to Chooser_Routine_Buffer.
51323 LD (52767),HL
51326 CALL Cashboxes_Completed
51329 RET C
51330 LD HL,52847 Writes Choose_Bandit_03 to Chooser_Routine_Buffer.
51333 LD (52767),HL
51336 CALL 51521
51339 CALL Cashboxes_Completed
51342 RET C
Init_Title_Screen_0 51343 LD HL,52831 Writes Choose_Bandit_02 to Chooser_Routine_Buffer.
51346 LD (52767),HL
51349 CALL 51521
51352 CALL Cashboxes_Completed
51355 RET C
51356 LD HL,52821 Writes Choose_Julius to Chooser_Routine_Buffer.
51359 LD (52767),HL
51362 CALL 51521
51365 CALL Cashboxes_Completed
51368 RET C
51369 LD HL,52862 Writes Choose_Bandit_04 to Chooser_Routine_Buffer.
51372 LD (52767),HL
51375 CALL 51521
51378 CALL Cashboxes_Completed
51381 RET C
Init_Title_Screen_1 51382 LD HL,52877 Writes Choose_Bandit_05 to Chooser_Routine_Buffer.
51385 LD (52767),HL
51388 CALL 51521
51391 CALL Cashboxes_Completed
51394 RET C
51395 LD HL,52892 Writes Choose_Bandit_06 to Chooser_Routine_Buffer.
51398 LD (52767),HL
51401 CALL 51521
51404 CALL Cashboxes_Completed
51407 RET C
51408 LD HL,52892 Writes Choose_Bandit_06 to Chooser_Routine_Buffer.
51411 LD (52767),HL
51414 CALL 51521
51417 CALL Set_Dusk_Attributes
51420 CALL Cashboxes_Completed
51423 RET C
51424 LD HL,52892 Writes Choose_Bandit_06 to Chooser_Routine_Buffer.
51427 LD (52767),HL
51430 CALL 51521
51433 CALL Set_Night_Attributes
51436 CALL Cashboxes_Completed
51439 RET C
Init_Title_Screen_2 51440 CALL Set_Day_Attributes
51443 CALL Prep_Display_Day
51446 LD B,7
Init_Title_Screen_3 51448 PUSH BC
51449 CALL Cashboxes_Completed
51452 POP BC
51453 RET C
51454 PUSH BC
51455 CALL 51521
51458 POP BC
51459 DJNZ Init_Title_Screen_3
51461 CALL Set_Dusk_Attributes
51464 CALL Cashboxes_Completed
51467 RET C
51468 CALL Set_Night_Attributes
51471 CALL Cashboxes_Completed
51474 RET C
51475 LD HL,53649
51478 LD A,(HL)
51479 LD (HL),0
51481 AND A
51482 JR Z,Init_Title_Screen_2
51484 LD HL,52148
51487 LD DE,23424
51490 LD BC,64
51493 LDIR
51495 CALL Sheriff_Star Call Sheriff_Star.
51498 CALL Halt_Loop
51501 CALL Halt_Loop
51504 CALL Halt_Loop
51507 CALL Halt_Loop
Init_Title_Screen_4 51510 XOR A
51511 IN A,(254)
51513 OR 224
51515 INC A
51516 JR Z,Init_Title_Screen_4
51518 NOP
51519 JR Init_Title_Screen_2
Prev: 51136 Up: Map Next: 51521