Prev: 24576 Up: Map Next: 25746
25472: Level Selection
Used by the routine at TitleScreen.
LevelSelect 25472 LD DE,23424 HL points to Print_TwoToneText_Alias on entry as DE is also Print_TwoToneText_Alias - this does nothing, it just creates a very short pause.
25475 LD BC,64
25478 LDIR
25480 LD HL,16384 Writes 0 to all 6911 bytes of the screen buffer (i.e. "blanks it").
25483 LD DE,16385
25486 LD BC,6911
25489 LD (HL),0
25491 LDIR
25493 LD HL,22688 Writes 40 to 22688 in the attribute buffer 256 times.
Value Ink Paper Bright
40 0 5 0
25496 LD DE,22689
25499 LD BC,256
25502 LD (HL),40
25504 LDIR
25506 LD (HL),32 ...and 32 to the attribute buffer another 95 times (following on from the previous location).
Value Ink Paper Bright
32 0 4 0
25508 LD BC,95
25511 LDIR
Prints the labels to the screen.
25513 LD HL,25772 Pass LevelSelect_One to Print_LevelSelect (index "1").
25516 LD A,1
25518 CALL Print_LevelSelect
25521 LD HL,25779 Pass LevelSelect_Three to Print_LevelSelect (index "2").
25524 LD A,2
25526 CALL Print_LevelSelect
25529 LD HL,25786 Pass LevelSelect_Six to Print_LevelSelect (index "3").
25532 LD A,3
25534 CALL Print_LevelSelect
25537 LD HL,25746 Points to LevelSelect_Copy and sends it to Print_TwoToneText_Alias
Value Ink Paper Bright
7 7 0 0
6 6 0 0
25540 LD DE,16419
25543 LD BC,1798
25546 CALL Print_TwoToneText_Alias
Prints the images to the screen.
25549 LD A,37 Calls LevelSelect_Graphics with (draw | 37) for index "1".
25551 LD B,1
25553 CALL LevelSelect_Graphics
25556 LD A,8 Calls LevelSelect_Graphics with (draw | 8) for index "2".
25558 LD B,2
25560 CALL LevelSelect_Graphics
25563 LD A,25 Calls LevelSelect_Graphics with (draw | 25) for index "3".
25565 LD B,3
25567 CALL LevelSelect_Graphics
Loop for getting user keyboard input.
25570 LD HL,23729 Used later for setting the current level at Level.
LevelSelect_Input 25573 LD A,247 Read from the keyboard;
Port Number Bit
0 1 2 3 4
247 1 2 3 4 5
25575 IN A,(254)
25577 RRA If "1" is pressed, jump to LevelSelect_Level_01.
25578 JR NC,LevelSelect_Level_01
25580 RRA If "2" is pressed, jump to LevelSelect_Level_03.
25581 JR NC,LevelSelect_Level_03
25583 RRA If "3" is pressed, jump to LevelSelect_Level_06.
25584 JR NC,LevelSelect_Level_06
25586 JR LevelSelect_Input Cycle back to LevelSelect_Input.
Act on level being selected.
LevelSelect_Level_01 25588 LD (HL),1 Store $01 at Level and call LS_AnimateShot with (shot | 38) for index "1".
25590 LD A,38
25592 LD B,1
25594 CALL LS_AnimateShot
25597 LD A,1 Jump to LevelSelect_Text_Flash with HL=LevelSelect_One and A=$01.
25599 LD HL,25772
25602 JP LevelSelect_Text_Flash
LevelSelect_Level_03 25605 LD (HL),2 Store 2 at Level and call LS_AnimateShot with (shot | 9) for index "2".
25607 LD A,9
25609 LD B,2
25611 CALL LS_AnimateShot
25614 LD A,2 Jump to LevelSelect_Text_Flash with HL=LevelSelect_Three and A=$02.
25616 LD HL,25779
25619 JP LevelSelect_Text_Flash
LevelSelect_Level_06 25622 LD (HL),3 Store 3 at Level and call LS_AnimateShot with (shot | 26) for index "3".
25624 LD A,26
25626 LD B,3
25628 CALL LS_AnimateShot
25631 LD A,3 Jump to LevelSelect_Text_Flash with HL=LevelSelect_Six and A=3.
25633 LD HL,25786
25636 JP LevelSelect_Text_Flash
Animates the selected bandit being shot.
LS_AnimateShot 25639 PUSH BC
25640 CALL LevelSelect_Graphics Call LevelSelect_Graphics.
25643 CALL Shot_Sound_01_Alias Call Shot_Sound_01_Alias.
25646 LD B,16 Short interrupt driven halt loop.
LS_AnimateShot_Halt_Loop 25648 HALT
25649 DJNZ LS_AnimateShot_Halt_Loop
25651 POP BC
25652 LD A,39 Call LevelSelect_Graphics with (floor | 27).
25654 CALL LevelSelect_Graphics
25657 RET Return.
Prints the images to the screen.
LevelSelect_Graphics 25658 PUSH BC Stash the current counter and convert the accumulator which is holding a character ID into their memory location.
25659 CALL Character_Address_Alias
25662 EX DE,HL
25663 POP AF
25664 LD HL,16546 Work out which screen position to use;
A Screen Address
1 16546
2 16557
3 16568
25667 DEC A
25668 JR Z,LevelSelect_Graphics_Skip
25670 LD HL,16557
25673 DEC A
25674 JR Z,LevelSelect_Graphics_Skip
25676 LD HL,16568
LevelSelect_Graphics_Skip 25679 LD B,88 Set the dimensions and call Draw_Character.
25681 LD C,6
25683 CALL Draw_Character
25686 RET Return.
Flashes the selected level text.
LevelSelect_Text_Flash 25687 LD B,8 This prints LevelSelect_Whitespace and the passed level copy alternately with a delay caused by a HALT loop (which continues execution after an interrupt is fired), the sequence repeats 8 times.
25689 LD C,A
LevelSelect_Text_Flash_Loop 25690 PUSH HL
25691 PUSH BC
25692 LD A,C
25693 CALL Print_LevelSelect
25696 LD B,16
LevelSelect_Flash_Halt_Loop_01 25698 HALT
25699 DJNZ LevelSelect_Flash_Halt_Loop_01
25701 LD HL,25793
25704 POP BC
25705 PUSH BC
25706 LD A,C
25707 CALL Print_LevelSelect
25710 LD B,16
LevelSelect_Flash_Halt_Loop_02 25712 HALT
25713 DJNZ LevelSelect_Flash_Halt_Loop_02
25715 POP BC
25716 POP HL
25717 DJNZ LevelSelect_Text_Flash_Loop
25719 LD A,C
25720 CALL Print_LevelSelect
25723 RET Return.
Print level select copy to the screen.
Print_LevelSelect 25724 LD DE,20514 First, work out which screen position to use;
A Screen Address
1 20514
2 20525
3 20536
25727 DEC A
25728 JR Z,LevelSelect_0
25730 LD DE,20525
25733 DEC A
25734 JR Z,LevelSelect_0
25736 LD DE,20536
LevelSelect_0 25739 LD BC,1794 Then call the print routine at Print_TwoToneText_Alias.
Value Ink Paper Bright
7 7 0 0
2 2 0 0
25742 CALL Print_TwoToneText_Alias
25745 RET Return.
Prev: 24576 Up: Map Next: 25746