Prev: 25636 Up: Map Next: 25764
25664: Initialise Game Objects
Used by the routine at InitialiseLevel.
InitialiseGameObjects 25664 LD A,10 Set the number of game objects to process (10).
25666 NOP No operation.
25667 LD C,A Set a counter in C of the number of game objects.
25668 INC B Increment B by one.
25669 INC C Increment C by one.
25670 LD HL,40990 HL=40990.
InitialiseGameObjects_0 25673 PUSH HL Stash HL on the stack.
25674 LD DE,46080 DE=46080.
25677 DEC (HL) Decrease *HL by one.
25678 JR Z,InitialiseGameObjects_1 Jump to InitialiseGameObjects_1 if *HL is zero.
25680 LD E,36 E=36.
25682 INC H Increment H by one.
25683 DEC (HL) Decrease *HL by one.
25684 JR Z,InitialiseGameObjects_1 Jump to InitialiseGameObjects_1 if *HL is zero.
25686 LD E,72 E=72.
InitialiseGameObjects_1 25688 POP HL Restore HL from the stack.
25689 PUSH HL Stash HL on the stack.
25690 INC L Increment L by two.
25691 INC L
25692 JR NZ,InitialiseGameObjects_2 Jump to InitialiseGameObjects_2 if L is not zero.
25694 LD A,H H+=5.
25695 ADD A,5
25697 LD H,A
InitialiseGameObjects_2 25698 INC L Increment L by one.
25699 LD A,(HL) A=*HL.
25700 DEC A Decrease A by one.
25701 JR Z,InitialiseGameObjects_3 Jump to InitialiseGameObjects_3 if A is zero.
25703 INC H Increment H by one.
25704 LD A,(HL) A=*HL.
25705 DEC A Decrease A by one.
25706 LD A,12 A=12.
25708 JR Z,InitialiseGameObjects_3 Jump to InitialiseGameObjects_3 if A was zero on line 25705.
25710 LD A,24 E+=24.
InitialiseGameObjects_3 25712 ADD A,E
25713 LD E,A
25714 POP HL Restore HL from the stack.
25715 DEC H Decrease H by one.
25716 LD B,4 B=4.
InitialiseGameObjects_4 25718 LD A,(DE) A=*DE.
25719 LD (HL),A Write A to *HL.
25720 INC H Increment H by one.
25721 INC E Increment E by one.
25722 DJNZ InitialiseGameObjects_4 Decrease counter by one and loop back to InitialiseGameObjects_4 until counter is zero.
25724 DEC H Decrease H by four.
25725 DEC H
25726 DEC H
25727 DEC H
25728 INC L Increment L by one.
25729 LD B,4 B=4.
InitialiseGameObjects_5 25731 LD A,(DE) A=*DE.
25732 LD (HL),A Write A to *HL.
25733 INC H Increment H by one.
25734 INC E Increment E by one.
25735 DJNZ InitialiseGameObjects_5 Decrease counter by one and loop back to InitialiseGameObjects_5 until counter is zero.
25737 INC H Increment H by one.
25738 INC L Increment L by one.
25739 JR Z,InitialiseGameObjects_6 Jump to InitialiseGameObjects_6 if L is zero.
25741 LD A,H H-=5.
25742 SUB 5
25744 LD H,A
InitialiseGameObjects_6 25745 LD B,4 B=4.
InitialiseGameObjects_7 25747 LD A,(DE) A=*DE.
25748 LD (HL),A Write A to *HL.
25749 INC H Increment H by one.
25750 INC E Increment E by one.
25751 DJNZ InitialiseGameObjects_7 Decrease counter by one and loop back to InitialiseGameObjects_7 until counter is zero.
25753 DEC H Decrease H by three.
25754 DEC H
25755 DEC H
25756 LD A,L L+=30.
25757 ADD A,30
25759 LD L,A
25760 DEC C Decrease C by one.
25761 JR NZ,InitialiseGameObjects_0 Jump to InitialiseGameObjects_0 until C is zero.
25763 RET Return.
Prev: 25636 Up: Map Next: 25764