One actual detail of the computer door open code, is that there is a bias of getting digits 4-9 more often than any other codes.
This is because the actual code to derive the random door code is as follows.
;Ram is initialized as follows.
;C1F4: 00 01 02 03 04 05 06 07 08 09
;When a given digit is picked, its value is stored within C1F0-C1F3, then replaced with 0xFF, so that it doesn't get used again.
LD B, 4
LD DE, 0xC1F0
LD H, 0xC1
-: CALL get_random_byte
AND 0x0F
CP 0x0A
JR C, +
SUB 0x06 ;This is where the bias towards 4-9 comes from.
ADD A, 0xF4
LD L, A
LD A, (HL)
CP 0xFF ;If equal, value is already used. Fetch another random number.
JR Z, -
LD (HL), 0xFF ;Make sure this value is never used again.
LD (DE), A ;And store this value as one of the door code digits.
INC E
DJNZ -
RET ;End of random door code routine.
;Called Once per frame, and also called at least 4 times, when picking a new door unlock code.
get_random_number:
PUSH HL
LD HL (C108) ;PRNG Seed
LD A, H
RRCA ;\
RRCA ;|
XOR H ;|
RRCA ;|
XOR L ;|-- Get Carry Flag
RRCA ;|
RRCA ;|
RRCA ;|
RRCA ;|
XOR L ;|
RRCA ;/
ADC HL, HL ; Carry Flag is used here.
JR NZ, +
LD HL, 0x733C ; Very rarely, does the final HL == 0x0000.
+: LD A, R
XOR L
LD (C108), HL
LD (C10A), A ;Just in case this random byte will be used later.
POP HL
RET
Because randomness depends on register R, sometimes, when on the room to room elevators, picking what frame to stop going up/down does not result in a different code, since it is taking the same number of cycles. The only way to manipulate the code on those elevators, is to either stop for more than one frame, or to wobble left/right.