![]() |
Routines |
A | 0 |
63573 | LD HL,32696 | Zero out the bytes in 32672-32696 (which clears the safe combination code, the teachers' combination letters, and the blackboard contents buffers) |
63576 | LD B,25 | |
63578 | LD (HL),A | |
63579 | DEC L | |
63580 | DJNZ 63578 | |
63582 | LD D,A | DE=0 |
63583 | LD E,A | |
63584 | LD C,4 | Four letters in the combination |
63586 | CALL 24993 | Get a random number in A |
63589 | AND 15 | 0<=A<=15 |
63591 | JR 63612 | Store MR WACKER's safe combination letter first |
63593 | LD L,159 | HL=32671 (first letter of safe combination code) |
63595 | ADD HL,BC | HL=32671+C (1<=C<=3) |
63596 | CALL 24993 | Get a random number in A |
63599 | LD E,B | E=0 |
63600 | RRCA | Get a random number between 0 and 3 in E |
63601 | RL E | |
63603 | RRCA | |
63604 | RL E | |
63606 | AND 31 | Is A between 0 and 25? |
63608 | CP 26 | |
63610 | JR NC,63596 | Jump back if not |
63612 | ADD A,65 | A=ASCII code of an upper case letter |
63614 | LD (HL),A | Store this in one of the slots at 32671-32674 |
63615 | LD L,163 | Point HL at a random teacher's safe combination letter (32675-32678) |
63617 | ADD HL,DE | |
63618 | BIT 6,(HL) | Has this letter already been decided? |
63620 | JR NZ,63593 | Jump if so |
63622 | LD (HL),A | Store the ASCII code in one of the slots at 32675-32678 |
63623 | DEC C | Next combination letter |
63624 | JR NZ,63593 | Jump back until all four combination letters are done |
63626 | LD L,154 | HL=32666 (which holds the identifier for CREAK's birth year battle) |
63628 | CALL 24993 | Get a random number between 0 and 20 in A |
63631 | CP 21 | |
63633 | JR NC,63628 | |
63635 | ADD A,A | A=random odd number between 213 and 253 |
63636 | ADD A,213 | |
63638 | LD (HL),A | Store this battle identifier at 32666 |
63639 | SUB 129 | Set HL to the address of the battle year message corresponding to this battle identifier |
63641 | LD E,A | |
63642 | LD H,D | |
63643 | LD L,D | |
63644 | ADD HL,DE | |
63645 | ADD HL,DE | |
63646 | ADD HL,DE | |
63647 | ADD HL,HL | |
63648 | ADD HL,HL | |
63649 | LD A,H | |
63650 | ADD A,223 | |
63652 | LD H,A | |
63653 | LD DE,32667 | 32667-32670 hold CREAK's year of birth |
63656 | LD C,4 | Copy the digits of CREAK's birth year into 32667-32670 |
63658 | LDIR | |
63660 | LD A,1 | Set the shield status at 32746 to 1, indicating that the shields need to be flashed |
63662 | LD (32746),A | |
63665 | RET |