Prev: 6424 Up: Map Next: 64A4
6440: Initialise Game Objects
Used by the routine at InitialiseLevel.
InitialiseGameObjects 6440 LD A,$0A Set the number of game objects to process (0A).
6442 NOP No operation.
6443 LD C,A Set a counter in C of the number of game objects.
6444 INC B Increment B by one.
6445 INC C Increment C by one.
6446 LD HL,$A01E HL=A01E.
InitialiseGameObjects_0 6449 PUSH HL Stash HL on the stack.
644A LD DE,$B400 DE=B400.
644D DEC (HL) Decrease *HL by one.
644E JR Z,InitialiseGameObjects_1 Jump to InitialiseGameObjects_1 if *HL is zero.
6450 LD E,$24 E=24.
6452 INC H Increment H by one.
6453 DEC (HL) Decrease *HL by one.
6454 JR Z,InitialiseGameObjects_1 Jump to InitialiseGameObjects_1 if *HL is zero.
6456 LD E,$48 E=48.
InitialiseGameObjects_1 6458 POP HL Restore HL from the stack.
6459 PUSH HL Stash HL on the stack.
645A INC L Increment L by two.
645B INC L
645C JR NZ,InitialiseGameObjects_2 Jump to InitialiseGameObjects_2 if L is not zero.
645E LD A,H H+=05.
645F ADD A,$05
6461 LD H,A
InitialiseGameObjects_2 6462 INC L Increment L by one.
6463 LD A,(HL) A=*HL.
6464 DEC A Decrease A by one.
6465 JR Z,InitialiseGameObjects_3 Jump to InitialiseGameObjects_3 if A is zero.
6467 INC H Increment H by one.
6468 LD A,(HL) A=*HL.
6469 DEC A Decrease A by one.
646A LD A,$0C A=0C.
646C JR Z,InitialiseGameObjects_3 Jump to InitialiseGameObjects_3 if A was zero on line 6469.
646E LD A,$18 E+=18.
InitialiseGameObjects_3 6470 ADD A,E
6471 LD E,A
6472 POP HL Restore HL from the stack.
6473 DEC H Decrease H by one.
6474 LD B,$04 B=04.
InitialiseGameObjects_4 6476 LD A,(DE) A=*DE.
6477 LD (HL),A Write A to *HL.
6478 INC H Increment H by one.
6479 INC E Increment E by one.
647A DJNZ InitialiseGameObjects_4 Decrease counter by one and loop back to InitialiseGameObjects_4 until counter is zero.
647C DEC H Decrease H by four.
647D DEC H
647E DEC H
647F DEC H
6480 INC L Increment L by one.
6481 LD B,$04 B=04.
InitialiseGameObjects_5 6483 LD A,(DE) A=*DE.
6484 LD (HL),A Write A to *HL.
6485 INC H Increment H by one.
6486 INC E Increment E by one.
6487 DJNZ InitialiseGameObjects_5 Decrease counter by one and loop back to InitialiseGameObjects_5 until counter is zero.
6489 INC H Increment H by one.
648A INC L Increment L by one.
648B JR Z,InitialiseGameObjects_6 Jump to InitialiseGameObjects_6 if L is zero.
648D LD A,H H-=05.
648E SUB $05
6490 LD H,A
InitialiseGameObjects_6 6491 LD B,$04 B=04.
InitialiseGameObjects_7 6493 LD A,(DE) A=*DE.
6494 LD (HL),A Write A to *HL.
6495 INC H Increment H by one.
6496 INC E Increment E by one.
6497 DJNZ InitialiseGameObjects_7 Decrease counter by one and loop back to InitialiseGameObjects_7 until counter is zero.
6499 DEC H Decrease H by three.
649A DEC H
649B DEC H
649C LD A,L L+=1E.
649D ADD A,$1E
649F LD L,A
64A0 DEC C Decrease C by one.
64A1 JR NZ,InitialiseGameObjects_0 Jump to InitialiseGameObjects_0 until C is zero.
64A3 RET Return.
Prev: 6424 Up: Map Next: 64A4