Prev: 40243 Up: Map Next: 41174
40258: Routine at 9D42
Used by the routines at AroundTheClock and 43740.
40258 CALL Initialise_AYSound Call Initialise_AYSound.
40261 LD A,(39724) A=*39724.
40264 AND A Jump to 40275 if *39724 is zero.
40265 JR Z,40275
40267 CALL 42014 Call 42014.
40270 LD A,2 Write 2 to *39695.
40272 LD (39695),A
This entry point is used by the routine at 41586.
40275 CALL Initialise_AYSound Call Initialise_AYSound.
40278 LD A,(39724) Jump to 40298 if *39724 is zero.
40281 AND A
40282 JR Z,40298
40284 LD A,(39725) Jump to 43530 if *39725 is zero.
40287 AND A
40288 JP Z,43530
40291 LD A,(39722) Jump to Messaging_HardLuck if *39722 is not equal to zero.
40294 AND A
40295 JP NZ,Messaging_HardLuck
40298 XOR A Write 0 to;
40299 LD (39686),A
40302 LD (39684),A
40305 LD (39685),A
40308 LD HL,39717 HL=39717.
40311 DEC (HL) Decrease *HL by one.
40312 JP P,40371 Jump to 40371 if *HL is greater than or equal to A.
40315 PUSH HL Stash HL on the stack.
40316 LD HL,39687 HL=39687.
40319 LD A,(39696) E=*39696.
40322 LD E,A
40323 LD D,0 D=0.
40325 ADD HL,DE HL+=DE.
40326 LD A,(HL) A=*HL.
40327 POP HL Restore HL from the stack.
40328 LD (HL),A Write A to *HL.
Increment the floating hand frame number.
40329 LD A,(39623) A=*FloatingHand_FrameNumber.
40332 INC A Increment A by one.
40333 LD (39623),A Write the updated frame number back to *FloatingHand_FrameNumber.
Have we gone past the last frame?
40336 CP 6 Jump to CalculateHand_Offset if the frame number is not equal to 6.
40338 JR NZ,CalculateHand_Offset
The frame count has gone too high, so reset it.
40340 XOR A Reset *FloatingHand_FrameNumber back to 0.
40341 LD (39623),A
Convert the frame count to an offset in DE.
CalculateHand_Offset 40344 LD A,(39623) A=*FloatingHand_FrameNumber.
40347 ADD A,A Multiply A by 4 and store the result in E.
40348 ADD A,A
40349 LD E,A
40350 LD D,0 D=0.
Now fetch the frame and mask pointers from the table at Table_FloatingHandGraphics.
40352 LD HL,39624 Add the offset in DE to Table_FloatingHandGraphics.
40355 ADD HL,DE
40356 LD E,(HL) Fetch the frame graphic data pointer and store it in DE.
40357 INC HL
40358 LD D,(HL)
40359 LD (39699),DE Write DE to *FloatingHand_GraphicData.
40363 INC HL Fetch the mask graphic data pointer and store it in DE.
40364 LD E,(HL)
40365 INC HL
40366 LD D,(HL)
40367 LD (39701),DE Write DE to *FloatingHand_MaskData.
40371 LD A,(63521) Jump to 41645 if bit 4 of *ControlByte is unset.
40374 BIT 4,A
40376 JP Z,41645
40379 LD HL,39593 HL=39593.
40382 INC (HL) Increment *HL by one.
40383 LD HL,1 Write 0001 to *39707.
40386 LD (39707),HL
40389 LD HL,100 Write 0100 to *39709.
40392 LD (39709),HL
40395 LD A,(39697) A=*39697.
40398 ADD A,16 A+=16.
40400 LD (39698),A Write A to *39698.
40403 LD HL,(39619) HL=*FloatingHandCoordinates.
40406 INC L Increment L by one.
40407 LD A,H A=H.
40408 SUB 5 A-=5.
40410 LD H,A H=A.
40411 LD (39621),HL Write HL to *39621.
40414 LD A,(39695) A=*39695.
40417 INC A Increment A by one.
40418 LD (39695),A Write A to *39695.
40421 LD HL,35136 Write Graphics_HandNoDart to *FloatingHand_GraphicData.
40424 LD (39699),HL
40427 LD HL,35528 Write Graphics_HandMaskNoDart to *FloatingHand_MaskData.
40430 LD (39701),HL
40433 LD HL,35920 Copy 288 bytes of data from *Graphics_ThrownDart to *39733.
40436 LD DE,39733
40439 LD BC,288
40442 LDIR
40444 LD HL,39733 HL=39733.
40447 LD B,3 B=3.
40449 LD A,167 Write 167 to *42561.
40451 LD (42561),A
40454 PUSH BC Stash BC and HL on the stack.
40455 PUSH HL
40456 CALL 42553 Call 42553.
40459 POP HL Restore HL from the stack.
40460 LD DE,48 HL+=0048.
40463 ADD HL,DE
40464 POP BC Restore BC from the stack.
40465 DJNZ 40454 Decrease counter by one and loop back to 40454 until counter is zero.
40467 LD B,3 B=3.
40469 LD A,55 Write 55 to *42561.
40471 LD (42561),A
40474 PUSH BC Stash BC and HL on the stack.
40475 PUSH HL
40476 CALL 42553 Call 42553.
40479 POP HL Restore HL from the stack.
40480 LD DE,48 HL+=0048.
40483 ADD HL,DE
40484 POP BC Restore BC from the stack.
40485 DJNZ 40474 Decrease counter by one and loop back to 40474 until counter is zero.
40487 LD HL,39733 Write 39733 to *39703.
40490 LD (39703),HL
40493 LD HL,39877 Write 39877 to *39705.
40496 LD (39705),HL
40499 LD HL,39620 HL=39620.
40502 INC (HL) Increment *HL by one.
40503 CALL Handler_FloatingHand Call Handler_FloatingHand.
40506 CALL 42129 Call 42129.
40509 LD B,16 B=16.
40511 PUSH BC Stash BC on the stack.
40512 LD BC,(39707) BC=*39707.
40516 DEC BC Decrease BC by one.
40517 LD A,B Jump to 40516 until BC is zero.
40518 OR C
40519 JR NZ,40516
40521 LD HL,(39707) HL=*39707.
40524 LD BC,(39709) BC=*39709.
40528 ADD HL,BC HL+=BC.
40529 LD (39707),HL Write HL to *39707.
40532 LD HL,39698 HL=39698.
40535 DEC (HL) Decrease *HL by one.
40536 CALL 42129 Call 42129.
40539 POP BC Restore BC from the stack.
40540 DJNZ 40511 Decrease counter by one and loop back to 40511 until counter is zero.
Small pause.
40542 LD BC,6000 BC=6000.
SmallPause_Loop 40545 DEC BC Decrease BC by one.
40546 LD A,B Jump to SmallPause_Loop until BC is zero.
40547 OR C
40548 JR NZ,SmallPause_Loop
40550 LD B,16 B=16.
40552 PUSH BC Stash BC on the stack.
40553 LD A,B Jump to 40572 if B is less than 8.
40554 CP 8
40556 JR C,40572
40558 LD HL,39781 Write 39781 to *39703.
40561 LD (39703),HL
40564 LD HL,39925 Write 39925 to *39705.
40567 LD (39705),HL
40570 JR 40584 Jump to 40584.
40572 LD HL,39829 Write 39829 to *39703.
40575 LD (39703),HL
40578 LD HL,39973 Write 39973 to *39705.
40581 LD (39705),HL
40584 LD BC,(39707) BC=*39707.
40588 DEC BC Decrease BC by one.
40589 LD A,B Jump to 40588 until BC is zero.
40590 OR C
40591 JR NZ,40588
40593 LD HL,(39707) HL=*39707.
40596 LD BC,(39709) BC=*39709.
40600 SBC HL,BC HL-=BC.
40602 LD (39707),HL Write HL to *39707.
40605 LD HL,39698 HL=39698.
40608 INC (HL) Increment *HL by one.
40609 CALL 42129 Call 42129.
40612 POP BC Restore BC from the stack.
40613 DJNZ 40552 Decrease counter by one and loop back to 40552 until counter is zero.
40615 CALL Sounds_OpponentDart Call Sounds_OpponentDart.
40618 LD HL,40021 HL=40021.
40621 LD DE,74 DE=0074.
40624 LD A,(39695) A=*39695.
40627 DEC A Decrease A by one.
40628 JR Z,40634 Jump to 40634 if A is equal to C.
40630 ADD HL,DE HL+=DE.
40631 DEC A Decrease A by one.
40632 JR 40628 Jump to 40628.
40634 LD DE,(39621) DE=*39621.
40638 DEC E Decrease E by one.
40639 LD (HL),E Write E to *HL.
40640 INC HL Increment HL by one.
40641 LD (HL),D Write D to *HL.
40642 INC HL Increment HL by one.
40643 INC D Increment D by two.
40644 INC D
40645 CALL 42155 Call 42155.
40648 LD B,5 B=5.
40650 LD DE,(39621) DE=*39621.
40654 LD HL,30720 HL=30720.
40657 CALL 42868 Call 42868.
40660 LD A,(39621) Multiply *39621 by 8 and store the result in B.
40663 ADD A,A
40664 ADD A,A
40665 ADD A,A
40666 LD B,A
40667 LD A,(39696) A=*39696.
40670 ADD A,B A+=B.
40671 LD B,160 B=160.
40673 SUB B A-=B.
40674 ADD A,2 A+=2.
40676 LD (39720),A Write A to *39720.
40679 LD E,A E=A.
40680 LD D,0 D=0.
40682 LD A,(39622) A=*39622.
40685 ADD A,3 A+=3.
40687 ADD A,A A+=A.
40688 ADD A,A A+=A.
40689 ADD A,A A+=A.
40690 LD B,A B=A.
40691 LD A,(39697) A=*39697.
40694 ADD A,B A+=B.
40695 LD B,A B=A.
40696 LD A,192 A=192.
40698 SUB B A-=B.
40699 LD B,96 B=96.
40701 SUB B A-=B.
40702 ADD A,2 A+=2.
40704 LD (39721),A Write A to *39721.
40707 LD H,A H=A.
40708 LD L,0 L=0.
40710 LD A,E A=E.
40711 AND A Jump to 40728 if D is greater than or equal to A.
40712 JP P,40728
40715 NEG NEG.
40717 LD E,A E=A.
40718 LD A,H A=H.
40719 AND A Jump to 40743 if D is greater than or equal to A.
40720 JP P,40743
40723 NEG NEG.
40725 LD H,A H=A.
40726 JR 40748 Jump to 40748.
40728 LD A,H A=H.
40729 AND A Jump to 40738 if D is greater than or equal to A.
40730 JP P,40738
40733 NEG NEG.
40735 LD H,A H=A.
40736 JR 40753 Jump to 40753.
40738 LD BC,39660 BC=39660.
40741 JR 40756 Jump to 40756.
40743 LD BC,39666 BC=39666.
40746 JR 40756 Jump to 40756.
40748 LD BC,39672 BC=39672.
40751 JR 40756 Jump to 40756.
40753 LD BC,39678 BC=39678.
40756 LD (39613),BC Write BC to *39613.
40760 LD A,E A=E.
40761 AND A Jump to 40769 if D is not equal to A.
40762 JR NZ,40769
40764 LD BC,1606 BC=1606.
40767 JR 40778 Jump to 40778.
40769 LD BC,0 BC=0000.
40772 SBC HL,DE HL-=DE (with carry).
40774 INC BC Increment BC by one.
40775 JR NC,40772 Jump to 40772 if BC is greater than or equal to A.
40777 DEC BC Decrease BC by one.
40778 LD H,B H=B.
40779 LD L,C L=C.
40780 XOR A A=0.
40781 LD DE,39648 DE=39648.
40784 EX DE,HL Exchange the DE and HL registers.
40785 LD C,(HL) C=*HL.
40786 INC HL Increment HL by one.
40787 LD B,(HL) B=*HL.
40788 INC HL Increment HL by one.
40789 EX DE,HL Exchange the DE and HL registers.
40790 AND A Set flags.
40791 SBC HL,BC HL-=BC.
40793 ADD HL,BC HL+=BC.
40794 JR NC,40799 Jump to 40799 if HL is greater than or equal to A.
40796 INC A Increment A by one.
40797 JR 40784 Jump to 40784.
40799 LD HL,(39613) HL=*39613.
40802 LD E,A E=A.
40803 LD D,0 D=0.
40805 ADD HL,DE HL+=DE.
40806 LD A,(HL) A=*HL.
40807 LD (44873),A Write A to *44873.
40810 LD (39726),A Write A to *39726.
40813 XOR A Write 0 to *44874.
40814 LD (44874),A
40817 LD A,(39720) A=*39720.
40820 AND A Jump to 40826 if A is greater than or equal to A.
40821 JP P,40826
40824 NEG NEG.
40826 LD E,A E=A.
40827 LD D,0 D=0.
40829 LD HL,0 HL=0000.
40832 AND A Jump to 40839 if A is equal to A.
40833 JR Z,40839
40835 ADD HL,DE HL+=DE.
40836 DEC A Decrease A by one.
40837 JR 40832 Jump to 40832.
40839 PUSH HL Stash HL on the stack.
40840 LD A,(39721) A=*39721.
40843 AND A Jump to 40849 if A is greater than or equal to A.
40844 JP P,40849
40847 NEG NEG.
40849 LD E,A E=A.
40850 LD D,0 D=0.
40852 LD HL,0 HL=0000.
40855 AND A Jump to 40862 if A is equal to A.
40856 JR Z,40862
40858 ADD HL,DE HL+=DE.
40859 DEC A Decrease A by one.
40860 JR 40855 Jump to 40855.
40862 EX DE,HL Exchange the DE and HL registers.
40863 POP HL Restore HL from the stack.
40864 ADD HL,DE HL+=DE.
40865 LD BC,10 BC=0010.
40868 AND A Set flags.
40869 SBC HL,BC HL-=BC.
40871 ADD HL,BC HL+=BC.
40872 JR NC,40889 Jump to 40889 if A is greater than or equal to A.
40874 LD A,50 A=50.
40876 LD (44873),A Write A to *44873.
40879 LD (39726),A Write A to *39726.
40882 LD HL,39685 HL=39685.
40885 LD (HL),1 Write 1 to *HL.
40887 JR 40976 Jump to 40976.
40889 LD BC,59 BC=0059.
40892 AND A Set flags.
40893 SBC HL,BC HL-=BC.
40895 ADD HL,BC HL+=BC.
40896 JR NC,40908 Jump to 40908 if A is greater than or equal to A.
40898 LD A,25 A=25.
40900 LD (44873),A Write A to *44873.
40903 LD (39726),A Write A to *39726.
40906 JR 40976 Jump to 40976.
40908 LD BC,1656 BC=1656.
40911 AND A Set flags.
40912 SBC HL,BC HL-=BC.
40914 ADD HL,BC HL+=BC.
40915 JR C,40976 Jump to 40976 if A is less than A.
40917 LD BC,2304 BC=2304.
40920 AND A Set flags.
40921 SBC HL,BC HL-=BC.
40923 ADD HL,BC HL+=BC.
40924 JR NC,40937 Jump to 40937 if A is greater than or equal to A.
40926 LD A,(44873) A=*44873.
40929 LD B,A B=A.
40930 ADD A,A A+=A.
40931 ADD A,B A+=B.
40932 LD (44873),A Write A to *44873.
40935 JR 40976 Jump to 40976.
40937 LD BC,4802 BC=4802.
40940 AND A Set flags.
40941 SBC HL,BC HL-=BC.
40943 ADD HL,BC HL+=BC.
40944 JR C,40976 Jump to 40976 if A is less than A.
40946 LD BC,5776 BC=5776.
40949 AND A Set flags.
40950 SBC HL,BC HL-=BC.
40952 ADD HL,BC HL+=BC.
40953 JR NC,40969 Jump to 40969 if A is greater than or equal to A.
40955 LD A,(44873) A=*44873.
40958 ADD A,A A+=A.
40959 LD (44873),A Write A to *44873.
40962 LD HL,39684 Write 1 to *39684.
40965 LD (HL),1
40967 JR 40976 Jump to 40976.
40969 XOR A Write 0 to;
40970 LD (44873),A
40973 LD (39726),A
40976 LD A,(39724) A=*39724.
40979 AND A Jump to 41030 if A is equal to A.
40980 JR Z,41030
40982 CALL 42036 Call 42036.
40985 LD A,(39726) B=*39726
40988 LD B,A
40989 LD A,(39725) A=*39725.
40992 CP B Jump to 41145 if A is not equal to B.
40993 JP NZ,41145
40996 DEC A Decrease A by one.
40997 LD (39725),A Write A to *39725.
41000 CALL PrintString_Loop Call PrintString_Loop.
41003 DEFB 22,5,1 PRINT AT: 5, 1.
41006 DEFM " " "     ".
41011 DEFB 22,6,1 PRINT AT: 6, 1.
41014 DEFM " " "     ".
41019 DEFB 22,7,1 PRINT AT: 7, 1.
41022 DEFM " " "     ".
41027 DEFB 255 Terminator.
41028 JR 41145 Jump to 41145.
41030 LD DE,(44873) DE=*44873.
41034 LD A,(44873) B=*44873.
41037 LD B,A
41038 LD A,(39597) A=*39597.
41041 ADD A,B A+=B.
41042 LD (39597),A Write A to *39597.
41045 LD A,(39607) Jump to 41067 if *39607 is zero.
41048 AND A
41049 JR Z,41067
41051 LD A,(39608) Jump to 41062 if *ActivePlayer is zero.
41054 AND A
41055 JR Z,41062
41057 LD HL,(39600) HL=*2UP_Total.
41060 JR 41070 Jump to 41070.
41062 LD HL,(39602) HL=*1UP_Total.
41065 JR 41070 Jump to 41070.
41067 LD HL,(39711) HL=*Total.
41070 SBC HL,DE HL-=DE (with carry).
41072 JP C,Handler_Bust Jump to Handler_Bust if ?? is less than A.
41075 JP NZ,41103 Jump to 41103 if ?? is not equal to A.
41078 LD A,(39684) Jump to 41095 if *39684 is not equal to zero.
41081 AND A
41082 JP NZ,41095
41085 LD A,(39685) Jump to 41095 if *39685 is not equal to zero.
41088 AND A
41089 JP NZ,41095
41092 JP Handler_Bust Jump to Handler_Bust.
41095 LD HL,39686 Write 1 to *39686.
41098 LD (HL),1
41100 JP Handler_Bust_0 Jump to Handler_Bust_0.
41103 LD A,L A=L.
41104 DEC A Decrease A by one.
41105 OR H Set the bits from H.
41106 JP Z,Handler_Bust Jump to Handler_Bust if A is equal to H.
41109 LD A,(39607) Jump to 41131 if *39607 is zero.
41112 AND A
41113 JR Z,41131
41115 LD A,(39608) Jump to 41126 if *ActivePlayer is zero.
41118 AND A
41119 JR Z,41126
41121 LD (39600),HL Write HL to *2UP_Total.
41124 JR 41134 Jump to 41134.
41126 LD (39602),HL Write HL to *1UP_Total.
41129 JR 41134 Jump to 41134.
41131 LD (39711),HL Write HL to *Total.
41134 CALL 44567 Call 44567.
41137 LD A,(44894) A=*44894.
41140 ADD A,2 A+=2.
41142 LD (44894),A Write A to *44894.
41145 CALL CopyFloatingHandToDartboard Call CopyFloatingHandToDartboard.
41148 LD HL,2064 Write 2064 to *FloatingHandCoordinates.
41151 LD (39619),HL
41154 CALL Handler_FloatingHand Call Handler_FloatingHand.
41157 LD A,(39724) Jump to 40258 if *39724 is not equal to zero.
41160 AND A
41161 JP NZ,40258
41164 LD A,(39695) Jump to Handler_Bust_0 if *39695 is equal to 3.
41167 CP 3
41169 JR Z,Handler_Bust_0
41171 JP 41850 Jump to 41850.
Prev: 40243 Up: Map Next: 41174