Dude, how did you manage to get such a smooth fade in/out effect on the NES?
It's nothing special, you just have to decrease/increase each color in every palette by $10 in every frame until you reach $00 or $FF. The game is open source check out https://github.com/jrs0ul/nes_survival but it is pretty messy.