Prev: 9489 Up: Map Next: 94DD
94B6: Hide the three pieces of the A.C.G. key
Used by the routine at START_GAME.
Called once, by START_GAME, before the template is copied: (FRAMES + TICKS) AND 7 picks one of the eight sets in KEY_ROOM_SETS, and its three rooms are written into the room bytes of the three pieces' records. TICKS has just been cleared and interrupts have been off since the title screen, so the first game after loading always gets the same set (rooms $17, $10 and $2B from the build's snapshot, measured in the simulator).
PLACE_ACG_KEY 94B6 LD A,($5C78)
94B9 LD C,A
94BA LD A,($5E12)
94BD ADD A,C
94BE AND $07
94C0 LD C,A
94C1 ADD A,A
94C2 ADD A,C
94C3 LD L,A
94C4 LD H,$00
94C6 LD BC,KEY_ROOM_SETS
94C9 ADD HL,BC
94CA EX DE,HL
94CB LD HL,$6026 ACG_KEY_PARTS+1: the first piece's room
94CE LD BC,$0008
94D1 LD A,$03
PLACE_ACG_KEY_0 94D3 EX AF,AF'
94D4 LD A,(DE)
94D5 LD (HL),A
94D6 ADD HL,BC
94D7 INC DE
94D8 EX AF,AF'
94D9 DEC A
94DA JR NZ,PLACE_ACG_KEY_0
94DC RET
Prev: 9489 Up: Map Next: 94DD