Finally downloaded and had a look at the code. It looks like my code will work, it's just that NESmaker has a slightly different order in how it stores its palette buffer:
Code:
bckPal .dsb 16 ;
bckPalFade .dsb 16
spriteSubPal_0 .dsb 4 ;playerPal
spriteSubPal_1 .dsb 4 ;magicPal
spriteSubPal_2 .dsb 4 ;objPal1
spriteSubPal_3 .dsb 4 ;objPal2
spritePalFade .dsb 16
(from line 120 in routines\variables\ZP_and_vars.asm, v.4.0.0)
So here's a table what happens if you feed my routine different values:
0-3 is directly affecting one of the background palettes
4-7 is directly affecting one of the background "fade" palettes
8-11 is directly affecting one of the sprite palettes
12-15 is directly affecting one of the sprite "fade" palettes.
So valid entries are not 0-7, but rather 0-15. I kind of assume "fade palettes" are generated from the normal palettes somehwhere in the code, but i haven't had a look.
Here's the routine with updated labels:
Code:
PickPaletteToCycle:
;notice -- this routine will clobber anything that is in registers a, x and y. If something in a,x or y needs to be stored for later use, do so before calling this routine.
lda #0 ; you can replace this with another literal, or a variable if you wish (expected values 0-15. Don't go higher or you'll run into some other RAM section)
asl a
asl a ;these multiply your literal or variable with 4 so we can get the right offset for each palette in increments of 4.
tax
CyclePaletteRightOnce:
ldy bckPal+3,x ;pocket colour 3 in reg y
lda bckPal+2,x
sta bckPal+3,x ;move colour 2 to 3
lda bckPal+1,x
sta bckPal+2,x ;move colour 1 to 2
sty bckPal+1,x ;move pocket (y) to 1
rts
That's all you need to upcycle any subpalette one tick. Call this routine every x:th frame and you have animation. All you need to figure out is how to either hook up a timer to trig the routine, or write a new timer on your own. If you don't want to hook it up to preexisting timers and triggers in NESmaker, you can add variables to routines\variables\UserVariables.asm and define them there like so:
for example. NESmaker conveniently allows for 256 user variables like this in RAM. Now you can use that label for your own purposes, like writing a small timer routine.
Note that I'm looking for ready-made solutions, if I'd know how to make it myself, I'd just go and make it instead of making this thread and one for flicker routine.
Well that's the thing. There are no ready made solutions - except the ones people are willing to write up and distribute for free in their spare time. Which is generally kind of a lot to ask. Most people rather work on their own projects. I just happened to be building my own library of code right when you asked, so it came at a convenient point and gave me a good reason to write such a feature, which is a win-win. But the typical customary thing over at NesDev.com, which has a pretty healthy community economy regarding this, is when you ask for for help, you're also expected show that you've taken the time to do some research (usually by reading up on 6502.org, the nesdev wiki, and/or search the forums for similar threads where the question might already have been answered in part or in full) - so you trade time for time, get more confident, and get to a point where you'll start to contribute to other people in need of help and advise. It's a pass this on economy. There's also the "give a man a fish/teach a man to fish" proverb.
Honestly IMO NESmaker should probably drop the "no coding required" subslogan. It is technically true, but sets too high expectations. If i understand it right, Joe is basically drowning in PM:s about peoples' feature requests, reasonable or not. Had there been any economy in it, he ought to have a technically informed secretary, haha. A lot of users will want to do more than is possible out of the box out of sheer creative drive, and to do that, coding is required.
All that said, please ask questions if something in my proposed solution is unclear.