From 34e79ef1890dab7ec48ecabaf34c2032aaad0c71 Mon Sep 17 00:00:00 2001 From: profi200 Date: Wed, 27 Mar 2024 16:25:56 +0100 Subject: [PATCH] Load GBA scaler matrix from SD if found. --- source/arm11/open_agb_firm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index 5034de8..d6ea66c 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -468,10 +468,10 @@ Result oafParseConfigEarly(void) return res; } -KHandle setupFrameCapture(const u8 scaler) +static KHandle setupFrameCapture(const u8 scaler) { const bool is240x160 = scaler < 2; - static const s16 matrix[12 * 8] = + static s16 matrix[12 * 8] = { // Vertical. 0, 0, 0, 0, 0, 0, 0, 0, @@ -490,6 +490,12 @@ KHandle setupFrameCapture(const u8 scaler) 0, 0, 0, 0, 0, 0, 0, 0 }; + const Result res = fsQuickRead("gba_scaler_matrix.bin", matrix, sizeof(matrix)); + if(res != RES_OK && res != RES_FR_NO_FILE) + { + ee_printf("Failed to load hardware scaling matrix: %s\n", result2String(res)); + } + LgyCapCfg gbaCfg; gbaCfg.cnt = LGYCAP_OUT_SWIZZLE | LGYCAP_ROT_NONE | LGYCAP_OUT_FMT_A1BGR5 | (is240x160 ? 0 : LGYCAP_HSCALE_EN | LGYCAP_VSCALE_EN); gbaCfg.w = (is240x160 ? 240 : 360);