Prev: DD72 Up: Map Next: DDBF
DD79: Look For Ground
Used by the routine at ScrollWorld.
Used while the world is scrolling in at the start of a life. If the flag at ScrollInFlag is 03 the scroll is finished (see FinishScrollIn). If not, the vertical scroll speed is set to 04. If the flag at ChequeredFloorFlag is zero the scroll lasts for the number of steps that are left in B. Otherwise it looks at the six bytes of the screen where the ship is, and at the row above them, and goes on scrolling until they are all blank. Then the flag is set to 03, the playfield is coloured and the tiles are made again.
LookForGround DD79 LD A,($5C3C) The scroll-in flag.
DD7C CP $03 Jump to FinishScrollIn if A is 03.
DD7E JP Z,FinishScrollIn
DD81 LD A,$04 A=04.
DD83 LD ($CCBA),A Update the vertical scroll speed.
DD86 LD A,($DDF2) The chequered floor flag.
DD89 AND A Jump to LookForGround_Count if A is zero.
DD8A JR Z,LookForGround_Count
DD8C LD B,$06 B=06.
DD8E LD HL,($C902) Fetch the word at C902 into HL.
DD91 CALL GetScreenAddress Call GetScreenAddress.
LookForGround_Loop DD94 LD A,(HL) Read HL.
DD95 AND A Jump to LookForGround_Restore if A is not zero.
DD96 JR NZ,LookForGround_Restore
DD98 DEC H Step H back.
DD99 LD A,(HL) Read HL.
DD9A AND A Jump to LookForGround_Restore if A is not zero.
DD9B JR NZ,LookForGround_Restore
DD9D INC H Advance H.
DD9E INC L Advance L.
DD9F DJNZ LookForGround_Loop Decrease B and jump to LookForGround_Loop until none remain.
DDA1 POP BC Bring BC back off the stack.
DDA2 JR LookForGround_Found Jump to LookForGround_Found.
LookForGround_Restore DDA4 POP BC Bring BC back off the stack.
DDA5 JR ScrollInWorld Jump to ScrollInWorld.
LookForGround_Count DDA7 POP BC Bring BC back off the stack.
DDA8 DJNZ ScrollInWorld Decrease B and jump to ScrollInWorld until none remain.
LookForGround_Found DDAA CALL ColourPlayfield Call ColourPlayfield.
DDAD XOR A Clear A.
DDAE LD ($CCBA),A Update the vertical scroll speed.
DDB1 LD A,$03 A=03.
DDB3 LD ($5C3C),A Update the scroll-in flag.
DDB6 LD HL,($CE57) Fetch the word at MapPosition into HL.
DDB9 CALL MakeTiles Call MakeTiles.
DDBC JP ScrollInWorld Jump to ScrollInWorld.
Prev: DD72 Up: Map Next: DDBF