//only 1st time at init memcpy((unsigned char *)temp_pal32out, (unsigned char *)0xDF80, 32); //can be any addr (ROM or RAM), just need 32 bytes full of {0} (=black), can also be done with memset() or if ram is fully cleared (depend on CRT0) no need to add this line memcpy((unsigned char *)temp_pal32in, (unsigned char *)my_pal, 32); //copy your pal data in ram var before calling the function SMS_displayOn(); //screen must be "on" fade_function_ASM(); //call the function ...rest of your stuff here...