logoalt Hacker News

C64: Putting Sprite Multiplexing to Work

54 pointsby ibobevyesterday at 12:35 PM4 commentsview on HN

Comments

boomlindetoday at 4:57 PM

You can chain handlers by simply rewriting the interrupt vector. Something like this (for a sequence of two handlers):

    handler1
        ; ...
        lda #<handler2
        sta $fffe
        lda #>handler2
        sta $ffff
        lda #line2
        sta $d012
        rti

    handler2
        ; ...
        lda #<handler1
        sta $fffe
        lda #>handler1
        sta $ffff
        lda #line1
        sta $d012
        rti
To my intuition it seems it would be quicker, though slightly larger.

I've only skimmed through the article so maybe there's a reason the author considered this and opted not to. Running out of memory maybe?

schlauerfoxtoday at 5:17 PM

I'm ignorant of most C64 stuff being an Atari kid, but I did find this pretty impressive (it's a cheat) with seemingly 9 sprites at once. https://www.youtube.com/watch?v=Ws4twUyt-MY

show 1 reply
kickahatoday at 3:09 PM

I have been waiting forty years to learn how to do this.