Prev: 25853 Up: Map Next: 25955
25856: Initialise Level
Used by the routine at GameInitialisation.
InitialiseLevel 25856 LD DE,40448 DE=LevelBuffer.
25859 LD HL,35168 HL=Data_Level1.
25862 CALL CopyLevelDataToBuffer Call CopyLevelDataToBuffer.
25865 LD HL,41217 HL=41217.
25868 LD B,10 B=10.
InitialiseLevel_0 25870 LD (HL),0 Write 0 to *HL.
25872 DEC H Decrease H by one.
25873 LD (HL),0 Write 0 to *HL.
25875 INC H Increment H by one.
25876 INC L Increment L by one.
25877 DJNZ InitialiseLevel_0 Decrease counter by one and loop back to InitialiseLevel_0 until counter is zero.
25879 LD (HL),35 Write 35 to *HL.
25881 EXX Switch to the shadow registers.
25882 LD A,10 A=10.
25884 NOP No operation.
25885 LD B,A B=A.
InitialiseLevel_1 25886 EXX Switch to the shadow registers.
25887 CALL GetRandomNumber Call GetRandomNumber.
25890 AND %00011111 Keep only bits 0-4.
25892 LD B,A B=A.
25893 ADD A,A A+=A.
25894 ADD A,A A+=A.
25895 ADD A,B A+=B.
25896 RRCA RRCA.
25897 RRCA
25898 RRCA
25899 LD L,A L=A.
25900 AND %00011111 Keep only bits 0-4.
25902 ADD A,138 A+=138.
25904 LD H,A H=A.
25905 LD A,L A=L.
25906 AND %11100000 Keep only bits 5-7.
25908 LD L,A L=A.
25909 CALL CopyLevelDataToBuffer Call CopyLevelDataToBuffer.
25912 EXX Switch to the shadow registers.
25913 DJNZ InitialiseLevel_1 Decrease counter by one and loop back to InitialiseLevel_1 until counter is zero.
25915 EXX Switch to the shadow registers.
25916 LD HL,35168 HL=Data_Level1.
25919 CALL CopyLevelDataToBuffer Call CopyLevelDataToBuffer.
25922 LD A,E A=E.
25923 LD HL,756 HL=756.
25926 AND A Jump to InitialiseLevel_2 if A is not zero.
25927 JR NZ,InitialiseLevel_2
25929 LD H,254 H=254.
InitialiseLevel_2 25931 ADD HL,DE HL+=DE.
25932 LD (HL),34 Write 34 to *HL.
25934 LD B,10 B=10.
InitialiseLevel_3 25936 INC L Increment L by one.
25937 LD (HL),0 Write 0 to *HL.
25939 DEC H Decrease H by one.
25940 LD (HL),0 Write 0 to *HL.
25942 INC H Increment H by one.
25943 DJNZ InitialiseLevel_3 Decrease counter by one and loop back to InitialiseLevel_3 until counter is zero.
25945 CALL 25664 Call 25664.
25948 CALL 25770 Call 25770.
25951 CALL InitialiseNewLevel Call InitialiseNewLevel.
25954 RET Return.
Prev: 25853 Up: Map Next: 25955