Prev: F268 Up: Map Next: F289
F274: Code sheet - pick a reference co-ordinate for the code that the player has to enter
Used by the routine at F296.
The code sheet is referenced with a letter (A-P) and a set number (0-41), but these are stored as two numbers, from 0-15 and 0-41 respectively.
F274 CALL $F21E Call hashing routine to obfuscate data at F216
F277 AND $0F The A register is returned with a hashed/randomized value - the 4th byte of the data set at F216.
Keep bits 0-3 (values 0-15)
F279 LD ($F261),A Store as first part of code from code sheet (this will signify the letter, A-P)
F27C CALL $F21E Call hashing routine again
Get the number in the range 0-41 as this is the number of code sheet rows:
F27F SUB $2A Subtract 42
F281 JR NC,$F27F Still positive (>=0)? If so, keep subtracting
F283 ADD A,$2A Add 42 to get the number in the range 0 to (+)41
F285 LD ($F260),A Store as second part of code from the code sheet (number)
F288 RET
Prev: F268 Up: Map Next: F289