PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.3KB

  1. ; "Rainbow with glitter" demo
  2. ; for "FastLED6502"
  3. ;
  4. ; Runs on an Apple ][, ][+, //e, or //gs
  5. ;
  6. ; Supports APA102, Adafruit DotStar,
  7. ; LPD8806, and WS2801 LED strips.
  8. ;
  9. ; LED strip connects to game port pins,
  10. ; see FastLED6502.s65 for details.
  11. ;
  12. ; Mark Kriegsman, February 2015
  13. #define NUM_LEDS 100
  14. #define BRIGHTNESS 64
  15. #define CHIPSET APA102
  16. #define DATA_PIN 14
  17. #define CLOCK_PIN 5
  18. * = $6000
  19. #include "FastLED6502.s65"
  20. #include "AppleII.s65"
  21. gHue .byt 0
  22. gHueDelta .byt 17
  23. gHueSpeed .byt 7
  24. Setup
  25. lda #0
  26. sta gHue
  27. Loop
  28. lda gHue
  29. clc
  30. adc gHueSpeed
  31. sta gHue
  32. ldx gHue
  33. ldy gHueDelta
  34. ; Fill RGB array with HSV rainbow
  35. jsr FastLED_FillRainbow_XY
  36. ; Use master brightness control
  37. lda #BRIGHTNESS
  38. sta FastLED_Brightness
  39. CheckOpenApple
  40. bit OpenApple
  41. bpl CheckSolidApple
  42. ; Add glitter if requested
  43. jsr AddGlitter
  44. CheckSolidApple
  45. bit SolidApple
  46. bpl DoDisplay
  47. ; Pulse brightness if requested
  48. jsr PulseBrightness
  49. DoDisplay
  50. ; This is where the magic happens
  51. jsr FastLED_Show
  52. jmp Loop
  53. AddGlitter
  54. ldy #3
  55. MaybeAdd1Glitter
  56. jsr FastLED_Random8
  57. cmp FastLED_NumPixels
  58. bcs SkipThis1Glitter
  59. tax
  60. lda #$FF
  61. sta ledsR,x
  62. sta ledsG,x
  63. sta ledsB,x
  64. SkipThis1Glitter
  65. dey
  66. bne MaybeAdd1Glitter
  67. rts
  68. PulseBrightness
  69. lda #13
  70. jsr FastLED_Beat8
  71. clc
  72. adc #12
  73. bcc PulseBright1
  74. lda #$FF
  75. PulseBright1
  76. sta FastLED_Brightness
  77. rts