|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
Rainbow Fade-In/Fade-Out Effect
Posted: Tue Apr 11, 2023 10:46 am
|
Maybe this is a silly question but is there a way to have sprites and background elements fade in and out by rapidly changing colors before turning black? I'm not aware of any officially licensed games on the SMS off the top of my head that did this, but I'm hoping it may be possible as I need to recreate this effect for a homebrew port of Final Fantasy I I'm working on. Attached is a gif of what I'm seeking to remake
|
|
|
Posted: Tue Apr 11, 2023 2:35 pm |
On the SMS you can change the palette(s) every time you want, so you probably just want to prepare a sequence of alternative palettes for each frame of your transition, and apply them in sequence with some good timing in between... | |
|
Posted: Tue Apr 11, 2023 5:11 pm |
You could also store the palette in ram and subtract x from each entry in the palette every y frames.
With how the palette is, you'll go through every colour and eventually end up at 0 which is black. ; this only modifies the palette in ram, you still have to write it to the vdp ; and use counters so it only runs every x frames ; ; hl: address of palette in ram ; b: number of palette entries to modify fade_palette_rainbow: ; loop through each palette entry -: ; get palette value ld a, (hl) ; don't do anything if this entry is already 0 or a, a jr z, fade_rainbow_check_done ; decrement palette entry sub a, 3 ; if carry is set, we went below 0 so set a = 0 jr nc, + ld a, 0 +: ; update palette record in memory ld (hl), a fade_rainbow_check_done: inc hl djnz - ret The attached videos are of 3 being subtracted from each palette entry every 4 frames, and 1 being subtracted from each palette entry every 2 frames. You could obviously mess about with this to see what different rates and amounts look like! You can just have another counter to say you need to run it so many times, if you subtract 1 per fade_palette_rainbow you'll need to run it 64 times to make sure white (63) has become black (0) and if you subtract 2 you'll need to run it 32 times etc |
|
|
Posted: Tue Apr 11, 2023 5:52 pm |
Holy smokes! Thank you for having such a clear example! This will be really helpful and I really appreciate it |
|
|
Posted: Tue Apr 11, 2023 7:22 pm |
This thread might be of interest to you as well: https://www.smspower.org/forums/16500-HelpWithAColorFadeOutTrick | |