Prev: 63F0 Up: Map Next: 6428
6416: 1UP/ 2UP Swapper.
Used by the routines at PlayersInit and 68C4.
This routine "swaps" the data between DE and HL.
ChangePlayer 6416 LD HL,$5F2D HL=1UP_Level.
6419 LD DE,$5F31 DE=2UP_Level.
641C LD B,$04 B=04 (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 641E LD A,(DE) A=DE.
641F LD C,(HL) C=HL.
6420 LD (HL),A Store A at HL.
6421 LD A,C Store C at DE.
6422 LD (DE),A
6423 INC HL Increase both HL and DE by one.
6424 INC DE
6425 DJNZ ChangePlayer_Loop Decrease counter by one and loop back to ChangePlayer_Loop until counter is zero.
6427 RET Return.
View the equivalent code in;
Prev: 63F0 Up: Map Next: 6428