fyrstikkmannen1970

Border and background color circling on the C64

Oct 12th, 2024
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Here is a short mashine code program to change the colors of the border and the background with quite a decent delay
  2. I used this with CBM prg STUDIO.
  3.  
  4.  
  5. ;program start
  6. *=$0828
  7.         lda #0
  8.         sta colorStorage
  9. @loop
  10.         lda colorStorage
  11.         sta $d020
  12.         jsr waitSomeTime
  13.         sta $d021
  14.         jsr waitSomeTime
  15.         inc colorStorage
  16.         cmp #16
  17.         bne @loop
  18.         rts
  19.  
  20. colorStorage
  21.         byte 0,4 ;this is where the color value is stored
  22.  
  23. waitSomeTime
  24.         ldy #$7f ;127
  25.         ldx #$ff ;255
  26.  
  27. @loopCountdown
  28.         dex
  29.         cpx #0
  30.         beq @doYs
  31.         jmp @loopCountdown
  32.  
  33. @doYs
  34.         dey
  35.         cpy #0
  36.         beq back
  37.         ldx #$ff ;255
  38.         jmp @loopCountdown
  39. back
  40.         rts
  41.  
Advertisement
Add Comment
Please, Sign In to add comment