it looks like crap since the animation was just for testing that the code works.
but yeah, this allows (in the way it's done here) cycling the bckchr and hudtiles independently between 4 banks for a maximum of 4-frame animations.
it's completely free of lag or cpu stress, as is the beauty of the chrRAM as apposed to other tricks of reloading graphics, the 4 banks are loaded at the beginning of the stage (in my game, the stage decides the animations) and switching a bank takes literally one write to a register during vblank, it will not slowdown or cause any other issues. in this code, the animation speed is controllable ia vblanktimer, giving you per-frame control over how fast the animations are.
the downside is that for each frame of animation in your tileset, you will have to load a new bckchr to the chrRAM, meaning the more animations you use, the less overall tilesets you have to use (dublicates are used for animating) so there will be a balance of detail versus amount of content to deal with.
as for what comes to the hud tiles. As we already know, i dont use them for the hud, i use them for static background objects (that appear in every stage of my game) and i wanted to animate those too. The problem is that hud tiles cannot be reloaded, and even if they could, there's only one "hudtiles.bmp" in the data.
i made 3 more of them so now i have hudtiles, hudtiles2, hudtiles3 and hudtiles4 which is animating my static objects on every stage.