From 74a0b2feae814c41b56cc69c601c56cd1812d1ea Mon Sep 17 00:00:00 2001 From: panicbit Date: Mon, 16 Apr 2018 01:28:11 +0200 Subject: [PATCH] Simplify color LUT writes --- sysmodules/rosalina/source/menus/screen_filters.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sysmodules/rosalina/source/menus/screen_filters.c b/sysmodules/rosalina/source/menus/screen_filters.c index a2265d6..121d8e8 100644 --- a/sysmodules/rosalina/source/menus/screen_filters.c +++ b/sysmodules/rosalina/source/menus/screen_filters.c @@ -38,17 +38,14 @@ int screenFiltersCurrentTemperature = TEMP_DEFAULT; void writeLut(u32* lut) { - u8 idx = 0; - do { - u32 pos = idx & 0xFF; + GPU_FB_TOP_COL_LUT_INDEX = 0; + GPU_FB_BOTTOM_COL_LUT_INDEX = 0; - GPU_FB_TOP_COL_LUT_INDEX = pos; + for (int i = 0; i <= 255; i++) { GPU_FB_TOP_COL_LUT_ELEM = *lut; - GPU_FB_BOTTOM_COL_LUT_INDEX = pos; GPU_FB_BOTTOM_COL_LUT_ELEM = *lut; - lut++; - } while(++idx); + } } typedef struct {