  

         ; Fraidy Cat Controller
         ; Schema/AIC   SWRAP2005
     
            *= $2000
     
         ; safe userport
     
            lda #$ff
            sta $dd03    ; outputs
    safe
            lda #$00
            sta $dd01    ; all off
     
            jsr $1000    ; init song
     
    wait
            lda $d012
            cmp #$32
            bne wait
     
            jsr $1003
            lda $101f
            sta $d020
     
            cmp #$08
            beq ass
     
            cmp #$18
            beq eyes
     
            lda #$00
            sta $dd01
     
     
            jmp wait
     
    ass
            lda #$04
            sta $dd01
            sta $d020
            jmp wait
     
     
    eyes
            lda #$01
            sta $dd01
            sta $d020
     
            jmp wait
     
    ------------------------------------------
     
    The code plays a standard SID file at $1000. Pegasus used Elwix's nifty sid examiner tool to find out that register $101F changed to certain values depending on the drums ($08=bass, $18=snare). So I simply test for those values during the playback, and write the appropriate control bits to the user port.
     
    The effect is that the cat pulses its ass up when a bass drum is hit, and the natural slack in the mechanical system meant it sagged down partway before the next one. So I didn't have to explicitly command it to move down. Similarly, the cat's eyes flash in time to the snare drum.
     
    Writing all those colors to the border provided a light show as well as a crude bit of debugging: If some other color appeared, that meant there was an instrument value I wasn't handling.
     
    Obviously you could extend this to look at the other voices and make the cat's head and mouth move too...but this worked pretty well, and we didn't have time or energy to get into that (this was around 2 am).
     
    Jeri kept the cat, so hopefully it will appear at a future expo.
     
    Edit to add: The SID that Sean picked was one he wrote, called WOVIOT/PEGASUS.

 
