diff --git a/arm11/source/main.c b/arm11/source/main.c index 3c2441c..f1d79df 100644 --- a/arm11/source/main.c +++ b/arm11/source/main.c @@ -37,7 +37,7 @@ extern u32 prepareForFirmlaunchSize; extern volatile Arm11Operation operation; -static void initScreens(u32 brightnessLevel) +static void initScreens(u32 brightnessLevel, struct fb *fbs) { *(vu32 *)0x10141200 = 0x1007F; *(vu32 *)0x10202014 = 0x00000001; @@ -70,14 +70,14 @@ static void initScreens(u32 brightnessLevel) *(vu32 *)0x1040045C = 0x00f00190; *(vu32 *)0x10400460 = 0x01c100d1; *(vu32 *)0x10400464 = 0x01920002; - *(vu32 *)0x10400468 = 0x18300000; - *(vu32 *)0x1040046C = 0x18400000; + *(vu32 *)0x10400468 = (u32)fbs[0].top_left; + *(vu32 *)0x1040046C = (u32)fbs[1].top_left; *(vu32 *)0x10400470 = 0x80341; *(vu32 *)0x10400474 = 0x00010501; *(vu32 *)0x10400478 = 0; + *(vu32 *)0x10400494 = (u32)fbs[0].top_right; + *(vu32 *)0x10400498 = (u32)fbs[1].top_right; *(vu32 *)0x10400490 = 0x000002D0; - *(vu32 *)0x10400494 = 0x18300000; - *(vu32 *)0x10400498 = 0x18400000; *(vu32 *)0x1040049C = 0x00000000; //Disco register @@ -107,8 +107,8 @@ static void initScreens(u32 brightnessLevel) *(vu32 *)0x1040055C = 0x00f00140; *(vu32 *)0x10400560 = 0x01c100d1; *(vu32 *)0x10400564 = 0x01920052; - *(vu32 *)0x10400568 = 0x18346500; - *(vu32 *)0x1040056c = 0x18446500; + *(vu32 *)0x10400568 = (u32)fbs[0].bottom; + *(vu32 *)0x1040056C = (u32)fbs[1].bottom; *(vu32 *)0x10400570 = 0x80301; *(vu32 *)0x10400574 = 0x00010501; *(vu32 *)0x10400578 = 0; @@ -183,7 +183,7 @@ void main(void) case ARM11_READY: continue; case INIT_SCREENS: - initScreens(*(vu32 *)ARM11_PARAMETERS_ADDRESS); + initScreens(*(vu32 *)ARM11_PARAMETERS_ADDRESS, (struct fb *)(ARM11_PARAMETERS_ADDRESS + 4)); break; case SETUP_FRAMEBUFFERS: setupFramebuffers((struct fb *)ARM11_PARAMETERS_ADDRESS); diff --git a/source/screen.c b/source/screen.c index 86ab666..b55b5b4 100644 --- a/source/screen.c +++ b/source/screen.c @@ -99,15 +99,19 @@ void initScreens(void) if(!ARESCREENSINITIALIZED) { *(vu32 *)ARM11_PARAMETERS_ADDRESS = brightness[MULTICONFIG(BRIGHTNESS)]; + memcpy((void *)(ARM11_PARAMETERS_ADDRESS + 4), fbs, sizeof(fbs)); invokeArm11Function(INIT_SCREENS); //Turn on backlight i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A); } - else updateBrightness(MULTICONFIG(BRIGHTNESS)); + else + { + updateBrightness(MULTICONFIG(BRIGHTNESS)); + memcpy((void *)ARM11_PARAMETERS_ADDRESS, fbs, sizeof(fbs)); + invokeArm11Function(SETUP_FRAMEBUFFERS); + } - memcpy((void *)ARM11_PARAMETERS_ADDRESS, fbs, sizeof(fbs)); - invokeArm11Function(SETUP_FRAMEBUFFERS); clearScreens(true); needToSetup = false; }