Prev: 65140 Up: Map
65177: Decryption
Used by the routine at GameEntryPoint.
Decryption 65177 POP BC Restore BC from the stack.
65178 LD HL,(23728) HL=*NMIADD.
65181 LD DE,(23670) DE=*SEED.
65185 ADD HL,DE HL+=DE.
65186 LD DE,28000 DE=28000.
65189 EX DE,HL Exchange the DE and HL registers.
65190 LD BC,36850 BC=36850.
Decryption_Loop 65193 LD A,(HL) A=*HL.
65194 XOR D D=0.
65195 ADD A,E A+=E.
65196 CPL Invert the bits in A.
65197 LD D,A D=A.
65198 LD (HL),A Write A to *HL.
65199 OUT (254),A Send A to the speaker.
65201 INC E Increment E by one.
65202 INC HL Increment HL by one.
65203 DEC BC Decrease BC by one.
65204 LD A,B Jump to Decryption_Loop until BC is zero.
65205 OR C
65206 JR NZ,Decryption_Loop
65208 OUT (254),A Send A to the speaker.
65210 POP BC Restore BC from the stack.
65211 LD A,C A=C.
65212 ADD A,50 A+=50.
65214 LD (65227),A Write A to *65227.
65217 EX (SP),IY Exchange the *SP and IY registers.
65219 LD IY,23610 IY=ERR_NR.
65223 LD SP,27998 SP=27998.
65226 EI Enable interrupts.
65227 JP MoveCode Jump to MoveCode.
Prev: 65140 Up: Map