Prev: 25584 Up: Map Next: 25640
25622: 1UP/ 2UP Swapper
Used by the routines at PlayersInit and 26820.
This routine "swaps" the data between DE and HL.
ChangePlayer 25622 LD HL,24365 HL=1UP_Level.
25625 LD DE,24369 DE=2UP_Level.
25628 LD B,4 B=4 (counter).
This looks complicated but it's just grabbing the data from DE, grabbing the data from HL, and writing the others data to each one.
ChangePlayer_Loop 25630 LD A,(DE) A=DE.
25631 LD C,(HL) C=HL.
25632 LD (HL),A Store A at HL.
25633 LD A,C Store C at DE.
25634 LD (DE),A
25635 INC HL Increase both HL and DE by one.
25636 INC DE
25637 DJNZ ChangePlayer_Loop Decrease counter by one and loop back to ChangePlayer_Loop until counter is zero.
25639 RET Return.
View the equivalent code in;
Prev: 25584 Up: Map Next: 25640