Prev: D13A Up: Map Next: D1A5
D16F: Set out the quest's things for a new game
Used by the routine at START.
Copies the eighteen records of QUEST_START to QUEST_RECORDS, and then puts the five collectables (records 4 to 8) in five consecutive places from SPOTS, the first chosen by the random number from the first sixteen: each gets its room, U, V and Z from its place. Called by START once the start tune has played.
NEW_QUEST D16F LD DE,QUEST_RECORDS the quest records as a game starts
D172 LD HL,QUEST_START
D175 LD BC,$0120
D178 LDIR
D17A LD A,(RANDOM) a random place, 0 to 15, four bytes each
D17D AND $3C
D17F LD E,A
D180 LD D,$00
D182 LD HL,SPOTS
D185 ADD HL,DE
D186 LD IY,QUEST_COLLECTABLES for the five collectables' records, from record 4
D18A LD C,$05
D18C LD DE,$000D
NEW_QUEST_0 D18F LD A,(HL) the room...
D190 LD (IY+$08),A
D193 LD B,$03 ...then U, V and Z
NEW_QUEST_1 D195 INC HL
D196 INC IY
D198 LD A,(HL)
D199 LD (IY+$00),A
D19C DJNZ NEW_QUEST_1
D19E INC HL the next place, the next record
D19F ADD IY,DE
D1A1 DEC C
D1A2 JR NZ,NEW_QUEST_0
D1A4 RET
Prev: D13A Up: Map Next: D1A5