Simplify color LUT writes

This commit is contained in:
panicbit 2018-04-16 01:28:11 +02:00
parent 71039fc248
commit 74a0b2feae

View File

@ -38,17 +38,14 @@ int screenFiltersCurrentTemperature = TEMP_DEFAULT;
void writeLut(u32* lut) void writeLut(u32* lut)
{ {
u8 idx = 0; GPU_FB_TOP_COL_LUT_INDEX = 0;
do { GPU_FB_BOTTOM_COL_LUT_INDEX = 0;
u32 pos = idx & 0xFF;
GPU_FB_TOP_COL_LUT_INDEX = pos; for (int i = 0; i <= 255; i++) {
GPU_FB_TOP_COL_LUT_ELEM = *lut; GPU_FB_TOP_COL_LUT_ELEM = *lut;
GPU_FB_BOTTOM_COL_LUT_INDEX = pos;
GPU_FB_BOTTOM_COL_LUT_ELEM = *lut; GPU_FB_BOTTOM_COL_LUT_ELEM = *lut;
lut++; lut++;
} while(++idx); }
} }
typedef struct { typedef struct {