| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Logo fade in/out
I have a logo in chars multicolor format for c64 intro. I would to fade it in/out but never coded a fader routine before.
What is the best method to do it in assemby? Is possible to fade in/out colors all at the same time? |
|
| |
ready.
Registered: Feb 2003 Posts: 441 |
if it is a 4 color multicolor logo you could easily fade it in/out by changing the multicolor registers of VIC and the color RAM ($d800) for each char.
Otherwise you could delete it pixel by pixel using a pseudo random code (check last part of Aurora 100%) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: I have a logo in chars multicolor format for c64 intro. I would to fade it in/out but never coded a fader routine before.
What is the best method to do it in assemby? Is possible to fade in/out colors all at the same time?
An easy trick is to swap the %00 and %11 colors so that $d021 becomes $d8xx-colors. Setup $d8xx once with the former bg color. Then you can fade the whole logo by POKEing to $d021/22/23.
|
| |
Elder0010
Registered: Apr 2011 Posts: 7 |
You can fade on the colours by using an indexed fade table, like
$0,$b,$c,$a (use a cool sequence, non this random one :D)
in one frame:
for each color in $d800 put the current indexed colour (read from the table):
$0 (frame 1)
$b (frame 2)
$c (frame 3)
$a (frame 4)
also, fade the multicolour registers with the same technique.
after 4 frames, you have to put the real colour value in $d800 / MC registers.
Of course you have to deal with colour clashes, but it's just to find the correct values to put in the table!
You can also use 3 separate tables for $d800 / MC1 / MC2!
|
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
ok. But for the colors i need some table with ordered values or can i put right color at the right place doing some maths? I tought about a fast fade because i would use it with another effect at same time... |
| |
Conjuror
Registered: Aug 2004 Posts: 168 |
Create 3 tables for your colour data using the luma values from this article:
http://www.pepto.de/projects/colorvic/
0
6, 9
2, B
4, 8
C, E
5, A
3, F
7, D
1
So using colour values which look right for the other colours in the picture, create a range using colours which get brighter (or darker). I like to set up a continuos fade in and out and adjust colours until I'm happy.
You can then go a step further and use a sine curve to create values which get lighter/darker slowly then faster as it gets close to the final colours.
|
| |
Digger
Registered: Mar 2005 Posts: 437 |
Have a look how it's done in Color Fade Editor
source: https://gist.github.com/628387 |
| |
ready.
Registered: Feb 2003 Posts: 441 |
also the guide AAY64 can help you out:
VIC's 16 Colors:
0/$0 = Black 8/$8 = Orange
1/$1 = White 9/$9 = Brown
2/$2 = Red 10/$A = Light Red
3/$3 = Cyan 11/$B = Dark Grey
4/$4 = Purple 12/$C = Grey
5/$5 = Green 13/$D = Light Green
6/$6 = Blue 14/$E = Light Blue
7/$7 = Yellow 15/$F = Light Grey
sorted by Brightness:
White
Yellow Light Green
Cyan Light Grey
Green Light Red
Grey Light Blue
Purple Orange
Red Dark Grey
Blue Brown
Black
but that's the same thing as Conjuror said. |
| |
STE'86
Registered: Jul 2009 Posts: 274 |
also please bear in mind that when using characters in MC format, the char colours available to d800 colour RAM are only the lower 8 so just be aware your colour fades for character colour can only use these 8 and not the whole 16 which the MC registers can use.
which, if the logo is only 3 colours and background points right back at Jackassers suggestion of how to do it simply and efficiently.
Steve |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: also please bear in mind that when using characters in MC format, the char colours available to d800 colour RAM are only the lower 8 so just be aware your colour fades for character colour can only use these 8 and not the whole 16 which the MC registers can use.
which, if the logo is only 3 colours and background points right back at Jackassers suggestion of how to do it simply and efficiently.
Steve
Or if you want fancy pansy fading per char, simply convert to MC-bitmap first and manipulate screen and color ram. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
As a side note, it's actually possible to fade even a fullsize bitmap picture in full framerate, if you pregenerate the color fading code so that it doesn't contain any superflous LDAs. I.e. iterate over the color and screen RAM and group together all positions that contain the same value, and then generate code like this (pseudocode):
lda #values[0]
sta positions[0][0]
sta positions[0][1]
...
lda #values[1]
sta positions[1][0]
sta positions[1][1]
EDIT: And of course you need to add a fade table lookup based on the original value and the fade sequence, after the LDA. |