head 1.1; branch 1.1.1; access ; symbols start:1.1.1.1 PAlibDoc:1.1.1; locks ; strict; comment @# @; 1.1 date 2005.11.02.08.30.32; author jandujar; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.11.02.08.30.32; author jandujar; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @
00001 #ifndef _PA_Palette 00002 #define _PA_Palette 00003 00004 00011 //#include "../PA.h" 00012 00013 00015 // Système pour les palettes 00017 #define PAL_BG0 0x05000000 00018 #define PAL_SPRITE0 0x05000200 00019 #define PAL_BG1 0x05000400 00020 #define PAL_SPRITE1 0x05000600 00021 00022 #define REG_BRIGHT 0x0400006C // Brightness 00023 00024 00025 00043 #define PA_LoadPal(palette, source) DMA_Copy((void*)source, (void*)palette, 256, DMA_16NOW); 00044 00060 #define PA_LoadPal16(palette, n_palette, source) DMA_Copy((void*)source, (void*)(palette + (n_palette << 5)), 16, DMA_16NOW); 00061 00062 00078 #define PA_RGB(r,g,b) ((1 << 15) + (r) + ((g)<<5) + ((b)<<10)) 00079 00093 void PA_SetBrightness(bool screen, s8 bright); 00094 00095 00096 00105 extern inline void PA_SetPalNeg(u32 palette) { 00106 u16* pal = (u16*)palette; 00107 u16 i; 00108 00109 for (i = 0; i < 256; i++) pal[i] = ~pal[i]; // On fout le négatif... 00110 } 00111 00112 00113 00114 00126 extern inline void PA_SetPal16Neg(u32 palette, u8 n_palette) { 00127 u16* pal = (u16*)palette; 00128 u16 i; 00129 00130 for (i = (n_palette << 4); i < ((n_palette + 1) << 4); i++) pal[i] = ~pal[i]; // On fout le négatif... 00131 } 00132 00133 00139 void PA_InitSpriteExtPal(void); 00140 00141 00142 00148 void PA_InitBgExtPal(void); 00149 00150 00151 00166 void PA_LoadSpriteExtPal(bool screen, u16 palette_number, void* palette); 00167 00168 00183 void PA_LoadBgExtPal(bool screen, u16 palette_number, void* palette); 00184 00185 00200 #define PA_SetBgPalCol(screen, color_number, colorRGB) BG_PALETTE[color_number + (screen << 9)] = colorRGB 00201 00216 #define PA_SetSpritePalCol(screen, color_number, colorRGB) BG_PALETTE[256 + color_number + (screen << 9)] = colorRGB 00217 00218 // end of Palette 00221 00222 00223 00224 00225 00226 #endif 00227 00228