LDA ScreenFlags00 ; load screenflags 0-7
AND #%00000111 ; checks the screen flag 7 bit
BEQ +notChecked
JMP +checked
+notChecked:
JMP +finishPalletCycle
+checked:
;; Palette Color Rotation
;; NESMaker 4.5.6
;; Modified by Artix & the UltimateGilby (Hacked together from Dale Coop's code from 4.5.1...
;;
;; IMPORTANT!
;; Add these variables to your zero page RAM
;; palettesCycleTimer
;; tempArtix
;;
;_; It is so cruel not having Dale Coop Help X_X
;_; I feel like I am wandering in a desert, seeing code mirages of 6502 ASM....
;;
;; Add this code to your Handle_Game_Timer
;; It will rotate one of your sub palletes
;; The default is the first one (#$00)...
;;
;; I am terrible at this. It probably breaks something. You were warned! XD
;;
LDA palettesCycleTimer ;; Load the Timer
BNE PaletteCycleTimerCountDown ;; If it is not 0, we are still counting down. Hop down.
;;;;;; New Stuff
LDA updateScreenData
AND #%0000100
BEQ +doSwapper
JMP SeeYaLaterPalleteMallet
+doSwapper
;;;;;;
JSR CycleThyPalettes ;; It is time to cycle the palette!
LDA #19 ;; SPEED (This will cycle it every 29 frames)
STA palettesCycleTimer
PaletteCycleTimerCountDown:
DEC palettesCycleTimer ;; Decrease the Timer
JMP SeeYaLaterPalleteMallet ;; No updates on this round!
CycleThyPalettes:
;; ----------------------
;; Which Subpallete do you want to cycle?
;; #$00 = the 1st
;; #$01 = the 2nd
;; #$02 = the 3rd
;; #$03 = the 4th
LDA #$02
;; ------------------------
;; Palette Cycle
ASL ;; x2
ASL ;; x2
TAX ;; Transfer accumulator into X
LDA bckPal+1,x ;pocket colour 1 in reg y
STA tempArtix
LDA bckPal+2,x
STA bckPal+1,x ;move colour 2 to 1
LDA bckPal+3,x
STA bckPal+2,x ;move colour 3 to 2
LDA tempArtix
STA bckPal+3,x ;move pocket
to 3
LDA #$01
STA updateScreenData ;; Writing a 1 to this tells NESmaker it needs to update palettes.
;; Although, we might need to protect the other bits if something else is going on
;; But I do not know how to do that... Kasumi!? HELP!
RTS
SeeYaLaterPalleteMallet:
+finishPalletCycle