Prev: AE17 Up: Map Next: AE5D
AE33: Handle Valve Ghost Sparkle
The handler for the sparkles shown between appearances of the valve ghost (objects 6C to 6F). They hover over the socket in the same way as the ghost (see HandleValveGhost). The sparkle steps through the four shapes, and when it matches the socket it changes back into the ghost.
Input
IX The address of the object
Hover over the socket and step the shape.
HandleValveGhostSparkle AE33 CALL SetPixelAdjustments_Valve Call SetPixelAdjustments_Valve.
AE36 CALL TestValvesInPlay Call TestValvesInPlay.
AE39 JP NZ,RetireObject_Retire Jump to RetireObject_Retire if there are special objects in the room.
AE3C LD A,(IX-$1D) Fetch the height of the socket.
AE3F ADD A,$0D Add 0D.
AE41 LD (IX+$03),A Set the height of the sparkle.
AE44 CALL NextSpriteNumber Call NextSpriteNumber.
AE47 AND %00000011 Keep bits 0 and 1.
AE49 LD C,A Keep it in C.
AE4A LD A,(IX-$20) Fetch the sprite number of the socket.
AE4D AND %00000011 Keep bits 0 and 1.
AE4F CP C Jump to HandleValveGhostSparkle_Redraw if the shapes are different.
AE50 JR NZ,HandleValveGhostSparkle_Redraw
AE52 RES 2,(IX+$00) Reset bit 2 of the sprite number.
AE56 LD (IX+$10),$02 Write 02 to the frame count.
HandleValveGhostSparkle_Redraw AE5A JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags.
Prev: AE17 Up: Map Next: AE5D