SPOFS sprite# OUT SX, SY IF SX > 319 THEN SPOFS sprite#, 0, SY <insert your switching code here> ENDIF