
 1000  *---------------------------------
 1010  *      INCH-WORM SOUNDS
 1020  *---------------------------------
 1030  SPEAKER    .EQ $C030
 1040  PULSE.WIDTH .EQ $00
 1050  PULSE.STEP  .EQ $01
 1060  PULSE.LIMIT .EQ $02
 1070  *---------------------------------
 1080  INCH.WORM
 1090         LDA #1       SET STEP TO 1
 1100  *   (ALSO TRY 77, 129, 179)
 1110         STA PULSE.STEP
 1120         LDA #176     SET PULSE.WIDTH AND LIMIT TO 176
 1130  *   (ALSO TRY 88)
 1140         STA PULSE.WIDTH
 1150         STA PULSE.LIMIT
 1160  .1     LDA SPEAKER  TOGGLE SPEAKER
 1170         LDX PULSE.WIDTH  DELAY LOOP FOR PULSE WIDTH
 1180  .2     PHA          LONGER DELAY LOOP
 1190         PLA
 1200         DEX          END OF PULSE?
 1210         BNE .2       NO
 1220         CLC          CHANGE PULSE WIDTH BY STEP
 1230         LDA PULSE.WIDTH
 1240         ADC PULSE.STEP
 1250         STA PULSE.WIDTH
 1260         CMP PULSE.LIMIT  UNTIL IT REACHES THE LIMIT
 1270         BNE .1
 1280         RTS

