Prev: 56690 Up: Map Next: 56767
56697: 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 3 the scroll is finished (see FinishScrollIn). If not, the vertical scroll speed is set to 4. 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 3, the playfield is coloured and the tiles are made again.
LookForGround 56697 LD A,(23612) The scroll-in flag.
56700 CP 3 Jump to FinishScrollIn if A is 3.
56702 JP Z,FinishScrollIn
56705 LD A,4 A=4.
56707 LD (52410),A Update the vertical scroll speed.
56710 LD A,(56818) The chequered floor flag.
56713 AND A Jump to LookForGround_Count if A is zero.
56714 JR Z,LookForGround_Count
56716 LD B,6 B=6.
56718 LD HL,(51458) Fetch the word at 51458 into HL.
56721 CALL GetScreenAddress Call GetScreenAddress.
LookForGround_Loop 56724 LD A,(HL) Read HL.
56725 AND A Jump to LookForGround_Restore if A is not zero.
56726 JR NZ,LookForGround_Restore
56728 DEC H Step H back.
56729 LD A,(HL) Read HL.
56730 AND A Jump to LookForGround_Restore if A is not zero.
56731 JR NZ,LookForGround_Restore
56733 INC H Advance H.
56734 INC L Advance L.
56735 DJNZ LookForGround_Loop Decrease B and jump to LookForGround_Loop until none remain.
56737 POP BC Bring BC back off the stack.
56738 JR LookForGround_Found Jump to LookForGround_Found.
LookForGround_Restore 56740 POP BC Bring BC back off the stack.
56741 JR ScrollInWorld Jump to ScrollInWorld.
LookForGround_Count 56743 POP BC Bring BC back off the stack.
56744 DJNZ ScrollInWorld Decrease B and jump to ScrollInWorld until none remain.
LookForGround_Found 56746 CALL ColourPlayfield Call ColourPlayfield.
56749 XOR A Clear A.
56750 LD (52410),A Update the vertical scroll speed.
56753 LD A,3 A=3.
56755 LD (23612),A Update the scroll-in flag.
56758 LD HL,(52823) Fetch the word at MapPosition into HL.
56761 CALL MakeTiles Call MakeTiles.
56764 JP ScrollInWorld Jump to ScrollInWorld.
Prev: 56690 Up: Map Next: 56767