Load GBA scaler matrix from SD if found.

This commit is contained in:
profi200 2024-03-27 16:25:56 +01:00 committed by profi200
parent 6cf6059023
commit 7c8c3d6fe8
1 changed files with 8 additions and 2 deletions

View File

@ -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);