Prev: FE74 Up: Map
FE99: Decryption
Used by the routine at GameEntryPoint.
Decryption FE99 POP BC Restore BC from the stack.
FE9A LD HL,($5CB0) HL=*NMIADD.
FE9D LD DE,($5C76) DE=*SEED.
FEA1 ADD HL,DE HL+=DE.
FEA2 LD DE,$6D60 DE=6D60.
FEA5 EX DE,HL Exchange the DE and HL registers.
FEA6 LD BC,$8FF2 BC=8FF2.
Decryption_Loop FEA9 LD A,(HL) A=*HL.
FEAA XOR D D=00.
FEAB ADD A,E A+=E.
FEAC CPL Invert the bits in A.
FEAD LD D,A D=A.
FEAE LD (HL),A Write A to *HL.
FEAF OUT ($FE),A Send A to the speaker.
FEB1 INC E Increment E by one.
FEB2 INC HL Increment HL by one.
FEB3 DEC BC Decrease BC by one.
FEB4 LD A,B Jump to Decryption_Loop until BC is zero.
FEB5 OR C
FEB6 JR NZ,Decryption_Loop
FEB8 OUT ($FE),A Send A to the speaker.
FEBA POP BC Restore BC from the stack.
FEBB LD A,C A=C.
FEBC ADD A,$32 A+=32.
FEBE LD ($FECB),A Write A to *FECB.
FEC1 EX (SP),IY Exchange the *SP and IY registers.
FEC3 LD IY,$5C3A IY=ERR_NR.
FEC7 LD SP,$6D5E SP=6D5E.
FECA EI Enable interrupts.
FECB JP MoveCode Jump to MoveCode.
Prev: FE74 Up: Map