Wednesday, 30 May 2018

the Atari colours

; simple static colours
; colours.spudge
proc spudge() {
    repeat {
        colbk = vcount <<< 1
    }
}

or make it move...

; moving colours with a VBI
; coloursMove.spudge
proc spudge() {
    ; install interrupt to scroll the rainbow
    replaceDeferredVBI(rainbowVBI)

    repeat {
        wsync = 0
        colbk = rainbow + (vcount <<< 1)
    }

    ; flip the VBI back to where it was
    restoreDeferredVBI()
}
; a simple VBI to scroll the rainbow
byte rainbow
proc rainbowVBI() vbi {
    if !(%11 & jiffy) { ; scroll every 4th frame
        rainbow += 1
    }
    exitVerticalBlank   ; special VBI exit
}



No comments:

Post a Comment