Prev: 95D4 Up: Map Next: 9C28
9745: Routine at 9745
Used by the routine at Start_1UP_Game.
Game_Over 9745 CALL $9C6F
9748 CALL $9ED2
974B CALL $9D29
974E LD A,($B150)
9751 LD A,($B150)
9754 CALL $B15A
9757 CALL Game_Over_3
975A AND A
975B RET M
975C LD A,$40 Write 40 to 9C29.
975E LD ($9C29),A
9761 LD C,$00
9763 CALL Game_Over_2
9766 LD C,$40
9768 XOR A Write 00 to 9C29.
9769 LD ($9C29),A
976C CALL Game_Over_2
976F LD A,($9C2C)
9772 CP $02
9774 JR NZ,Game_Over_1
9776 CALL $AF01
9779 AND A
977A JR NZ,Game_Over_0
977C XOR A Clear the yin-yang images by writing 00 to P1_Points_Awarded and P2_Points_Awarded and calling Yin_Yang_1UP.
977D LD ($AA08),A
9780 LD ($AA48),A
Game_Over_0 9783 CALL Yin_Yang_1UP
9786 XOR A Clear the yin-yang images by writing 00 to P1_Yin_Yang and P2_Yin_Yang and calling 95D4, BF13.
9787 LD ($AA01),A
978A LD ($AA41),A
Game_Over_1 978D CALL $95D4
9790 CALL $BF13
9793 LD C,$00
9795 LD A,$40 Write 40 to 9C29.
9797 LD ($9C29),A
979A CALL Game_Over_39
979D CALL Game_Over_48
97A0 LD C,$40
97A2 XOR A
97A3 LD ($9C29),A
97A6 CALL Game_Over_39
97A9 CALL Game_Over_48
97AC RET
97AD LD A,($AA19)
97B0 LD ($AA36),A
97B3 LD A,($AA59)
97B6 LD ($AA76),A
97B9 XOR A
97BA RET Return.
Game_Over_2 97BB CALL Game_Over_47
97BE CALL Game_Over_15
97C1 CALL Game_Over_19
97C4 CALL Game_Over_36
97C7 CALL Game_Over_48
97CA RET Return.
Game_Over_3 97CB LD A,($9C2C) If Num_Players is not 00 then jump to Check_Quit_Game.
97CE AND A
97CF JP NZ,Check_Quit_Game
97D2 LD A,R
97D4 LD A,$01 Write 01 to;
97D6 LD ($AA46),A
97D9 LD ($AA06),A
Should we start a 1 player game?
97DC LD A,$24 Check if "1" key is pressed.
97DE CALL Keyboard_Test
97E1 JR NC,Start_1UP If it is, jump to Start_1UP.
97E3 IN A,($1F) Take a reading from the kempston joystick port.
97E5 BIT 5,A If the fire button is not being pressed, jump to Game_Over_4.
97E7 JP NZ,Game_Over_4
97EA AND $10 Keep only bit 4 (fire), if it's not being pressed, jump to Game_Over_4.
97EC JP Z,Game_Over_4
Starts a 1 player game.
Start_1UP 97EF LD A,$01 Write 01 to;
97F1 LD ($9C2C),A
97F4 LD ($AA46),A
97F7 DEC A Write 00 to;
97F8 LD ($AA06),A
97FB CALL New_Round Call New_Round.
97FE LD A,$80 A=80.
9800 RET Return.
Should we start a 2 player game?
Game_Over_4 9801 LD A,$1C Check if "2" key is pressed.
9803 CALL Keyboard_Test
9806 JR C,Demo_Configs_Main No keys were pressed, continue on to Demo_Configs_Main.
Starts a 2 player game.
Start_2UP 9808 LD A,$02 Write 02 to;
980A LD ($9C2C),A
980D XOR A Write 00 to;
980E LD ($AA06),A
9811 LD ($AA46),A
9814 CALL New_Round Call New_Round.
9817 LD A,$80 A=80.
9819 RET Return.
Should we go to the config page?
Demo_Configs_Main 981A LD A,$23 Check if "0" key is pressed.
981C CALL Keyboard_Test
981F JR C,Game_Over_5 No keys were pressed, continue on to Game_Over_5.
9821 CALL Game_Configs_Main Call Game_Configs_Main.
9824 LD A,$80 A=80.
9826 RET Return.
Checks if "G" and "H" are being held to quit a game.
Check_Quit_Game 9827 LD A,$01 Check if "H" key is pressed.
9829 CALL Keyboard_Test
982C JR C,Game_Over_5 No keys were pressed, continue on to Game_Over_5.
982E LD A,$06 Check if "G" key is pressed.
9830 CALL Keyboard_Test
9833 JR C,Game_Over_5 No keys were pressed, continue on to Game_Over_5.
9835 XOR A Write 00 to;
9836 LD ($9C2C),A
9839 LD A,$80 A=80.
983B AND A
983C RET Return.
Game_Over_5 983D LD A,($AA03)
9840 AND A
9841 JR Z,Game_Over_6
9843 LD ($AA05),A
9846 JP Game_Over_8
Game_Over_6 9849 LD A,($AA06)
984C AND A
984D JR Z,Game_Over_7
984F CALL $AADC
9852 CALL $AB0A
9855 CALL $A090
9858 CALL $AAF3
985B CALL $AB16
985E JR Game_Over_8
Game_Over_7 9860 LD A,$01
9862 CALL $8B1F
9865 LD C,$00
9867 CALL Game_Over_11
986A LD A,(HL)
986B LD ($AA05),A
Game_Over_8 986E LD A,($AA43)
9871 AND A
9872 JR Z,Game_Over_9
9874 LD ($AA45),A
9877 LD A,$01
9879 RET
Game_Over_9 987A LD A,($AA46)
987D AND A
987E JR Z,Game_Over_10
9880 CALL $AB22
9883 CALL $AB50
9886 CALL $A090
9889 CALL $AB39
988C CALL $AB5C
988F XOR A
9890 RET
Game_Over_10 9891 LD A,$02
9893 CALL $8B1F
9896 LD C,$40
9898 CALL Game_Over_11
989B LD A,(HL)
989C LD ($AA45),A
989F RET
Game_Over_11 98A0 BIT 5,A
98A2 JR Z,Game_Over_12
98A4 SET 4,A
Game_Over_12 98A6 AND $1F
98A8 LD E,A
98A9 LD D,$00
98AB LD HL,$98DD
98AE ADD HL,DE
98AF PUSH HL
98B0 LD HL,$AA17
98B3 LD A,C
98B4 ADD A,L
98B5 LD L,A
98B6 LD A,(HL)
98B7 AND A
98B8 POP HL
98B9 RET Z
98BA LD DE,$0021
98BD ADD HL,DE
98BE RET
This entry point is used by the routine at Start_1UP_Game.
Game_Over_13 98BF LD HL,$9C2C HL=Num_Players.
98C2 LD B,$01 Set a counter of 1.
98C4 CALL Populate_Score_Buffer Call Populate_Score_Buffer.
98C7 CALL Zero_To_Space Call Zero_To_Space.
98CA LD HL,$0019 Point to Score_Buffer and call Print_String.
98CD LD DE,$B024
98D0 CALL Print_String
98D3 LD HL,$0319 Point to Text_Player and call Print_String.
98D6 LD DE,$B03E
98D9 CALL Print_String
98DC RET Return.
98DD LD BC,$0405
98E0 LD BC,$0903
98E3 EX AF,AF'
98E4 LD BC,$0602
98E7 RLCA
98E8 LD BC,$0101
98EB LD BC,$0101
98EE LD C,$0A
98F0 LD BC,$0F11
98F3 DJNZ Game_Over_14
98F5 INC C
Game_Over_14 98F6 DEC C
98F7 DEC BC
98F8 LD BC,$0101
98FB LD BC,$0101
98FE LD BC,$0405
9901 LD BC,$0602
9904 RLCA
9905 LD BC,$0903
9908 EX AF,AF'
9909 LD BC,$0101
990C LD BC,$0101
990F LD C,$0A
9911 LD BC,$0D0C
9914 DEC BC
9915 LD BC,$0F11
9918 DJNZ $991B
991A LD BC,$0101
991D LD BC,$0001
Game_Over_15 9920 LD A,E
9921 CP $03
9923 JR NZ,Game_Over_18
9925 LD A,D
9926 CP $13
9928 JR Z,Game_Over_16
992A CP $14
992C JR NZ,Game_Over_17
Game_Over_16 992E LD E,D
992F RET
Game_Over_17 9930 LD HL,$AA16
9933 LD A,($9C29)
9936 ADD A,L
9937 LD L,A
9938 LD A,(HL)
9939 AND A
993A RET NZ
993B LD HL,$AA09
993E LD A,($9C29)
9941 ADD A,L
9942 LD L,A
9943 LD A,(HL)
9944 AND A
9945 RET NZ
9946 LD HL,$AA04
9949 LD A,($9C29)
994C ADD A,L
994D LD L,A
994E LD A,(HL)
994F CP $10
9951 RET Z
9952 CP $0A
9954 RET Z
9955 LD HL,$A90D
9958 ADD A,L
9959 LD L,A
995A LD A,(HL)
995B AND A
995C RET Z
995D PUSH DE
995E CALL Game_Over_49
9961 POP DE
9962 AND A
9963 RET Z
9964 LD HL,$AA04
9967 LD A,($9C29)
996A ADD A,L
996B LD L,A
996C LD A,(HL)
996D LD HL,$A926
9970 ADD A,L
9971 LD L,A
9972 LD E,(HL)
9973 LD HL,$AA09
9976 LD A,C
9977 ADD A,L
9978 LD L,A
9979 LD (HL),$00
997B LD HL,$AA16
997E LD A,($9C29)
9981 ADD A,L
9982 LD L,A
9983 LD (HL),$00
9985 RET
Game_Over_18 9986 LD A,E
9987 CP $07
9989 RET NZ
998A LD A,D
998B CP $04
998D RET Z
998E CP $07
9990 RET Z
9991 LD E,$18
9993 RET
Game_Over_19 9994 LD A,E
9995 CP $1A
9997 JR Z,Game_Over_20
9999 CP $1B
999B JR Z,Game_Over_20
999D CP $16
999F JR NZ,Game_Over_22
Game_Over_20 99A1 LD D,E
99A2 LD HL,$AA18
99A5 LD A,C
99A6 ADD A,L
99A7 LD L,A
99A8 LD (HL),$7A
99AA DEC HL
99AB DEC HL
99AC LD (HL),$00
99AE LD HL,$AA09
99B1 LD A,C
99B2 ADD A,L
99B3 LD L,A
99B4 LD (HL),$00
99B6 LD HL,$AA13
99B9 LD A,C
99BA ADD A,L
99BB LD L,A
99BC LD A,(HL)
99BD AND A
99BE RET Z
99BF LD HL,$AA12
99C2 LD A,C
99C3 ADD A,L
99C4 LD L,A
99C5 LD A,(HL)
99C6 CP $2C
99C8 JR Z,Game_Over_21
99CA CP $28
99CC RET NZ
Game_Over_21 99CD LD A,($9CA7)
99D0 AND A
99D1 RET NZ
99D2 LD A,$01
99D4 LD ($9CA7),A
99D7 LD A,$05
99D9 LD ($B150),A
99DC RET
Game_Over_22 99DD LD A,D
99DE CP E
99DF RET Z
99E0 CP $01
99E2 JR NZ,Game_Over_26
99E4 LD A,E
99E5 CP $11
99E7 JR NZ,Game_Over_23
99E9 LD D,$12
99EB RET
Game_Over_23 99EC CP $07
99EE JR Z,Game_Over_24
99F0 CP $10
99F2 JR Z,Game_Over_24
99F4 CP $0A
99F6 JR NZ,Game_Over_25
Game_Over_24 99F8 LD D,$04
99FA RET
Game_Over_25 99FB LD D,E
99FC RET
Game_Over_26 99FD LD A,E
99FE CP $07
9A00 JR Z,Game_Over_27
9A02 CP $10
9A04 JR Z,Game_Over_27
9A06 CP $0A
9A08 JR NZ,Game_Over_30
Game_Over_27 9A0A LD A,D
9A0B CP $04
9A0D JR NZ,Game_Over_29
9A0F LD HL,$AA09
9A12 LD A,C
9A13 ADD A,L
9A14 LD L,A
9A15 LD A,(HL)
9A16 CP $01
9A18 RET NZ
9A19 LD D,E
This entry point is used by the routine at B2FB.
Game_Over_28 9A1A RET
Game_Over_29 9A1B CP $12
9A1D RET NZ
9A1E LD HL,$AA16
9A21 LD A,C
9A22 ADD A,L
9A23 LD L,A
9A24 LD (HL),$01
9A26 RET
Game_Over_30 9A27 LD A,D
9A28 CP $12
9A2A JR NZ,Game_Over_31
9A2C LD A,E
9A2D CP $11
9A2F JR NZ,Game_Over_31
9A31 LD HL,$AA09
9A34 LD A,C
9A35 ADD A,L
9A36 LD L,A
9A37 LD A,(HL)
9A38 CP $01
9A3A RET NZ
9A3B LD D,E
9A3C RET
Game_Over_31 9A3D LD A,D
9A3E CP $11
9A40 JR NZ,Game_Over_32
9A42 LD HL,$AA09
9A45 LD A,C
9A46 ADD A,L
9A47 LD L,A
9A48 LD A,(HL)
9A49 CP $01
9A4B JR NZ,Game_Over_32
9A4D LD D,$15
9A4F LD HL,$AA16
9A52 LD A,C
9A53 ADD A,L
9A54 LD L,A
9A55 LD (HL),$01
9A57 LD HL,$AA07
9A5A LD A,C
9A5B ADD A,L
9A5C LD L,A
9A5D LD (HL),$00
9A5F LD HL,$AA0B
9A62 LD A,C
9A63 ADD A,L
9A64 LD L,A
9A65 LD (HL),$00
9A67 LD HL,$AA09
9A6A LD A,C
9A6B ADD A,L
9A6C LD L,A
9A6D LD (HL),$00
9A6F RET
Game_Over_32 9A70 LD A,D
9A71 LD HL,$B462
9A74 ADD A,L
9A75 LD L,A
9A76 LD A,(HL)
9A77 CP $80
9A79 JR NZ,Game_Over_34
9A7B LD HL,$AA09
9A7E LD A,C
9A7F ADD A,L
9A80 LD L,A
9A81 LD (HL),$00
9A83 LD A,E
9A84 CP $11
9A86 JR NZ,Game_Over_33
9A88 LD D,$12
9A8A RET
Game_Over_33 9A8B LD D,E
9A8C RET
Game_Over_34 9A8D AND A
9A8E JR NZ,Game_Over_35
9A90 LD HL,$AA16
9A93 LD A,C
9A94 ADD A,L
9A95 LD L,A
9A96 LD (HL),$01
Game_Over_35 9A98 LD HL,$AA09
9A9B LD A,C
9A9C ADD A,L
9A9D LD L,A
9A9E LD (HL),$00
9AA0 RET
Game_Over_36 9AA1 LD HL,$AA0B
9AA4 LD A,C
9AA5 ADD A,L
9AA6 LD L,A
9AA7 LD A,(HL)
9AA8 CP D
9AA9 JR Z,Game_Over_37
9AAB INC HL
9AAC LD (HL),D
9AAD DEC HL
9AAE LD (HL),$00
9AB0 LD HL,$AA09
9AB3 LD A,C
9AB4 ADD A,L
9AB5 LD L,A
9AB6 LD (HL),$00
9AB8 RET
Game_Over_37 9AB9 LD HL,$AA09
9ABC LD A,C
9ABD ADD A,L
9ABE LD L,A
9ABF LD A,(HL)
9AC0 CP $01
9AC2 JR NZ,Game_Over_38
9AC4 LD HL,$AA0C
9AC7 LD A,C
9AC8 ADD A,L
9AC9 LD L,A
9ACA LD (HL),$00
9ACC RET
Game_Over_38 9ACD LD HL,$AA0B
9AD0 LD A,C
9AD1 ADD A,L
9AD2 LD L,A
9AD3 LD B,(HL)
9AD4 INC HL
9AD5 LD (HL),B
9AD6 RET
Game_Over_39 9AD7 CALL Game_Over_47
9ADA LD A,D
9ADB CP $03
9ADD JR Z,Game_Over_40
9ADF CP $02
9AE1 JR NZ,Game_Over_41
Game_Over_40 9AE3 LD HL,$AA19
9AE6 LD A,C
9AE7 ADD A,L
9AE8 LD L,A
9AE9 LD B,(HL)
9AEA LD HL,$AA36
9AED LD A,C
9AEE ADD A,L
9AEF LD L,A
9AF0 LD A,(HL)
9AF1 SUB B
9AF2 JR Z,Game_Over_41
Game_Over_41 9AF4 LD HL,$AA0D
9AF7 LD A,C
9AF8 ADD A,L
9AF9 LD L,A
9AFA LD A,(HL)
9AFB AND A
9AFC RET Z
9AFD LD (HL),$00
9AFF LD HL,$AA03
9B02 LD A,C
9B03 ADD A,L
9B04 LD L,A
9B05 LD A,(HL)
9B06 AND A
9B07 JR Z,Game_Over_42
9B09 LD E,A
9B0A LD ($9C28),A
9B0D RET
Game_Over_42 9B0E LD HL,$AA16
9B11 LD A,C
9B12 ADD A,L
9B13 LD L,A
9B14 LD A,(HL)
9B15 AND A
9B16 JP Z,Game_Over_45
9B19 LD A,D
9B1A CP $11
9B1C JR NZ,Game_Over_43
9B1E INC HL
9B1F LD A,(HL)
9B20 XOR $01
9B22 LD (HL),A
Game_Over_43 9B23 LD HL,$AA07
9B26 LD A,C
9B27 ADD A,L
9B28 LD L,A
9B29 LD (HL),$00
9B2B INC HL
9B2C INC HL
9B2D LD (HL),$00
9B2F INC HL
9B30 INC HL
9B31 LD (HL),$00
9B33 LD D,$01
9B35 INC HL
9B36 LD (HL),$01
9B38 LD HL,$AA16
9B3B LD A,C
9B3C ADD A,L
9B3D LD L,A
9B3E LD (HL),$00
9B40 RET
9B41 LD A,D
9B42 CP $0A
9B44 JR Z,Game_Over_44
9B46 CP $10
9B48 JR Z,Game_Over_44
9B4A CP $07
9B4C JR Z,Game_Over_44
9B4E LD D,$01
9B50 RET
Game_Over_44 9B51 LD D,$04
9B53 LD HL,$AA16
9B56 LD A,C
9B57 ADD A,L
9B58 LD L,A
9B59 LD (HL),$01
9B5B LD HL,$AA0C
9B5E LD A,C
9B5F ADD A,L
9B60 LD L,A
9B61 LD (HL),$04
9B63 DEC HL
9B64 LD (HL),$00
9B66 RET
Game_Over_45 9B67 LD A,D
9B68 LD HL,$B462
9B6B ADD A,L
9B6C LD L,A
9B6D LD A,(HL)
9B6E AND A
9B6F JR Z,Game_Over_46
9B71 LD A,$01
9B73 LD D,A
9B74 LD HL,$AA00
9B77 LD A,C
9B78 ADD A,L
9B79 LD L,A
9B7A LD (HL),D
9B7B LD HL,$AA07
9B7E LD A,C
9B7F ADD A,L
9B80 LD L,A
9B81 LD (HL),$00
9B83 INC HL
9B84 INC HL
9B85 INC HL
9B86 INC HL
9B87 LD (HL),$00
9B89 RET
Game_Over_46 9B8A LD HL,$AA09
9B8D LD A,C
9B8E ADD A,L
9B8F LD L,A
9B90 LD (HL),$01
9B92 RET
Game_Over_47 9B93 LD HL,$AA05
9B96 LD A,C
9B97 ADD A,L
9B98 LD L,A
9B99 LD E,(HL)
9B9A DEC HL
9B9B LD D,(HL)
9B9C RET
Game_Over_48 9B9D LD HL,$AA04
9BA0 LD A,C
9BA1 ADD A,L
9BA2 LD L,A
9BA3 LD (HL),D
9BA4 INC HL
9BA5 LD (HL),E
9BA6 RET
Game_Over_49 9BA7 LD HL,$AA19
9BAA LD A,C
9BAB ADD A,L
9BAC LD L,A
9BAD LD D,(HL)
9BAE LD HL,$AA19
9BB1 LD A,($9C29)
9BB4 ADD A,L
9BB5 LD L,A
9BB6 LD E,(HL)
9BB7 LD HL,$AA17
9BBA LD A,($AA57)
9BBD CP (HL)
9BBE JR Z,Game_Over_54
9BC0 LD HL,$AA17
9BC3 LD A,C
9BC4 ADD A,L
9BC5 LD L,A
9BC6 LD A,(HL)
9BC7 AND A
9BC8 JR NZ,Game_Over_50
9BCA LD A,E
9BCB SUB D
9BCC JR Game_Over_51
Game_Over_50 9BCE LD A,D
9BCF SUB E
Game_Over_51 9BD0 LD ($9C2D),A
9BD3 LD HL,$AA04
9BD6 LD A,($9C29)
9BD9 ADD A,L
9BDA LD L,A
9BDB LD A,(HL)
9BDC LD HL,$B47E
9BDF ADD A,L
9BE0 LD L,A
9BE1 LD A,(HL)
9BE2 AND A
9BE3 JR NZ,Game_Over_52
9BE5 LD A,($9C2D)
9BE8 CP $EF
9BEA JR NC,Game_Over_53
9BEC CP $16
9BEE JR C,Game_Over_53
Game_Over_52 9BF0 XOR A
9BF1 RET
Game_Over_53 9BF2 LD A,$01
9BF4 RET
Game_Over_54 9BF5 LD HL,$AA17
9BF8 LD A,C
9BF9 ADD A,L
9BFA LD L,A
9BFB LD A,(HL)
9BFC AND A
9BFD JR Z,Game_Over_55
9BFF LD A,D
9C00 SUB E
9C01 JR Game_Over_56
Game_Over_55 9C03 LD A,E
9C04 SUB D
Game_Over_56 9C05 LD ($9C2D),A
9C08 LD HL,$AA04
9C0B LD A,($9C29)
9C0E ADD A,L
9C0F LD L,A
9C10 LD A,(HL)
9C11 LD HL,$B47E
9C14 ADD A,L
9C15 LD L,A
9C16 LD A,(HL)
9C17 AND A
9C18 JR Z,Game_Over_52
9C1A LD A,($9C2D)
9C1D CP $03
9C1F JR C,Game_Over_52
9C21 CP $10
9C23 JR NC,Game_Over_52
9C25 LD A,$01
9C27 RET
Prev: 95D4 Up: Map Next: 9C28