Prev: A95A Up: Map Next: A9B1
A971: Handle Ending Robot Bottom
The update routine for the bottom half of the robot in the game completed scene (object 5C). The counter in IX+11 waits for 40 passes, then the robot goes down three pixels a pass into the pot of oil at row 28. After 80 it comes back up, bright white. At row 80 the end tune is played and a new game is started.
Input
IX The address of the object
Wait, go down, or come back up.
HandleEndingRobotBottom A971 LD A,(IX+$11) Fetch the counter.
A974 CP $40 Jump to HandleEndingRobotBottom_CountPass if it is less than 40.
A976 JR C,HandleEndingRobotBottom_CountPass
A978 CP $80 Jump to HandleEndingRobotBottom_ComingUp if it is 80 or more.
A97A JR NC,HandleEndingRobotBottom_ComingUp
The robot is going down into the pot of oil.
A97C LD A,(IX+$1B) Fetch the pixel y position.
A97F CP $28 Jump to HandleEndingRobotBottom_CountPass if it has reached row 28.
A981 JR C,HandleEndingRobotBottom_CountPass
A983 SUB $03 Take 03 off it.
A985 LD (IX+$1B),A Store the pixel y position.
Play a sound and redraw the robot.
HandleEndingRobotBottom_SoundAndRedraw A988 CALL PlaySoundFromHeight_PlaySoundFromValue Call PlaySoundFromHeight_PlaySoundFromValue.
A98B CALL SetWipeAndDrawFlags Call SetWipeAndDrawFlags.
HandleEndingRobotBottom_ColourCells A98E JP ColourCells Jump to ColourCells.
Count another pass.
HandleEndingRobotBottom_CountPass A991 INC (IX+$11) Increment the counter.
A994 JR HandleEndingRobotBottom_ColourCells Jump to HandleEndingRobotBottom_ColourCells.
The robot is coming back up.
HandleEndingRobotBottom_ComingUp A996 LD A,(IX+$1B) Fetch the pixel y position.
A999 CP $80 Jump to HandleEndingRobotBottom_Landed if it has reached row 80.
A99B JR NC,HandleEndingRobotBottom_Landed
A99D ADD A,$03 Add 03.
A99F LD (IX+$1B),A Store the pixel y position.
A9A2 LD (IX+$10),$47 Set the colour to bright white.
A9A6 JR HandleEndingRobotBottom_SoundAndRedraw Jump to HandleEndingRobotBottom_SoundAndRedraw.
The robot has come out of the oil.
HandleEndingRobotBottom_Landed A9A8 LD DE,$B3D7 Point DE at RobotTune.
A9AB CALL PlayMusic Call PlayMusic.
A9AE JP RestartGame Jump to RestartGame.
Prev: A95A Up: Map Next: A9B1