Prev: 16384 Up: Map Next: 24064
23424: Decryption Routine
Runs "RRD" on each of the 31744 bytes that start at 24575 which decrypts the game, and then jumps to SecurityCheck.
Set up the address of the first byte to decrypt and the counters.
GameEntry 23424 LD HL,24575 HL=24575 (the address of the first byte to decrypt).
23427 LD BC,124 BC=0124 (B=0 so the inner loop runs 256 times, and C counts the 124 outer passes).
23430 XOR A A=0 (and reset the flags).
Rotate the nibbles of each byte, chaining the low nibble of one byte into the high nibble of the next.
Decryption_Loop 23431 RRD RRD operation on *HL.
23433 INC HL Move HL on to the next byte to decrypt.
23434 DJNZ Decryption_Loop Decrease the byte counter (B) by one and loop back to Decryption_Loop until all 256 bytes have been done.
23436 DEC C Decrease the pass counter (C) by one and loop back to Decryption_Loop until all 124 passes have been done.
23437 JR NZ,Decryption_Loop
23439 JP SecurityCheck Jump to SecurityCheck to run the security check.
View the equivalent code in Lunar Jetman.
Earlier Ultimate games use a much simpler mechanism;
Prev: 16384 Up: Map Next: 24064