From: chaoskagami Date: Mon, 18 Jul 2016 03:06:20 +0000 (-0400) Subject: Update screeninit to be a bit less messy (not much I can do about chainloading though) X-Git-Tag: v0.2.0~9 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=85507cd1c15781ab46d32c91414ecd8fefefa060;p=corbenik%2Fcorbenik.git Update screeninit to be a bit less messy (not much I can do about chainloading though) --- diff --git a/external/screeninit/source/main.c b/external/screeninit/source/main.c index 932cb7e..48f7696 100755 --- a/external/screeninit/source/main.c +++ b/external/screeninit/source/main.c @@ -41,10 +41,15 @@ void main(void) { *(vu32 *)0x10141200 = 0x1007F; *(vu32 *)0x10202014 = 0x00000001; *(vu32 *)0x1020200C &= 0xFFFEFFFE; + } + *(vu32 *)0x10202240 = brightnessLevel; // Alteration; directly read brightness. *(vu32 *)0x10202A40 = brightnessLevel; + + if (do_init == INIT_FULL) { *(vu32 *)0x10202244 = 0x1023E; *(vu32 *)0x10202A44 = 0x1023E; + } // Top screen *(vu32 *)0x10400400 = 0x000001c2; @@ -101,7 +106,6 @@ void main(void) { *(vu32 *)0x10400540 = 0x01980194; *(vu32 *)0x10400544 = 0x00000000; *(vu32 *)0x10400548 = 0x00000011; - *(vu32 *)0x1040055C = 0x00f00140; *(vu32 *)0x10400560 = 0x01c100d1; *(vu32 *)0x10400564 = 0x01920052; @@ -127,9 +131,6 @@ void main(void) { *((vu32 *)0x23FFFE00) = 0x18300000; *((vu32 *)0x23FFFE04) = 0x18300000; *((vu32 *)0x23FFFE08) = 0x18300000 + (yaw * 400); - } else if (do_init == INIT_DEINIT) { - - } //Clear ARM11 entry offset *arm11 = 0; diff --git a/source/main.c b/source/main.c index 172d1fc..524a750 100644 --- a/source/main.c +++ b/source/main.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #include "common.h" #include "firm/firm.h" @@ -23,13 +26,19 @@ main(int argc, char** argv) std_init(); int c = fmount(); - screen_mode(0); + + screen_mode(0); // Use RGBA8 mode. + clear_bg(); - load_bg_top(PATH_BITS "/top.bin"); + + load_bg_top (PATH_BITS "/top.bin"); load_bg_bottom(PATH_BITS "/bottom.bin"); // This is basically a menuhax splash (90deg rotated BGR8 pixel data) + clear_disp(TOP_SCREEN); clear_disp(BOTTOM_SCREEN); + ctr_screen_enable_backlight(CTR_SCREEN_BOTH); + set_font(PATH_BITS "/termfont.bin"); install_interrupts(); // Get some free debug info. diff --git a/source/screeninit.c b/source/screeninit.c index 1108ff1..87a83a7 100644 --- a/source/screeninit.c +++ b/source/screeninit.c @@ -27,19 +27,18 @@ screen_mode(uint32_t mode) // And no, 3dbrew didn't help. Partial init seems to be a superset of what // I was attempting. -// if (PDN_GPU_CNT == 1) { + screenInitAddress[2] = 1; // Do a partial init. + + if (PDN_GPU_CNT == 1) screenInitAddress[2] = 0; // Do a full init. - screenInitAddress[3] = 0xFF; // Brightness - screenInitAddress[4] = mode; // Mode - *a11_entry = (uint32_t)screenInitAddress; + screenInitAddress[3] = 0xFF; // Brightness + screenInitAddress[4] = mode; // Mode - while (*a11_entry); + *a11_entry = (uint32_t)screenInitAddress; - // Turn on backlight - i2cWriteRegister(I2C_DEV_MCU, 0x22, 1 << 1); + while (*a11_entry); - // FIXME - Time to yell at Gelex now. :| - ctr_screen_enable_backlight(CTR_SCREEN_BOTH); -// } + // Turn on backlight + i2cWriteRegister(I2C_DEV_MCU, 0x22, 1 << 1); }