Skip to content

Commit

Permalink
Remove some unnesesary code,added warninw on freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Jan 2, 2020
1 parent 653858f commit dede3b5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 71 deletions.
3 changes: 2 additions & 1 deletion Hakupayload/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void ipl_main()

//Blank ,0xFF00FF22,0xFFCCCCCC verde
//gfx_render_splash(&g_gfx_ctxt, (u8*)sd_file_read("StarDust/background.bmp"));
gfx_printf(&g_gfx_con, "%k*%k Haku33 v2.1 Kronos2308, Hard Reset\n\n",0xFF00FF22,0xFFCCCCCC);
gfx_printf(&g_gfx_con, "%k*%k Haku33 v2.2 Kronos2308, Hard Reset\n\n",0xFF00FF22,0xFFCCCCCC);
gfx_printf(&g_gfx_con, "%k TU CONSOLA SERA COMPLETAMENTE LIMPADA: SAVES, JUEGOS, ETC\n\n",0xFF828282);
gfx_printf(&g_gfx_con, "%k SE REALIZARA UN HARD RESET LUEGO SE APAGARA LA CONSOLA\n\n",0xFF828282);
gfx_printf(&g_gfx_con, "%k SI NO SABES LO QUE HACES, PRESIONA B PARA ABORTAR \n\n",0xFF828282);
Expand Down Expand Up @@ -219,6 +219,7 @@ void ipl_main()
}

gfx_printf(&g_gfx_con, "\n\n%k*%k Cleaning finished ...\n",0xFF00FF22,0xFFCCCCCC);
gfx_printf(&g_gfx_con, "\n\n%k*%k All Green ...\n",0xFF00FF22,0xFFCCCCCC);

gfx_swap_buffer(&g_gfx_ctxt);
btn_wait_timeout(15000, BTN_POWER);
Expand Down
76 changes: 13 additions & 63 deletions Hakupayload/src/utils/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,55 +203,21 @@ void BootStrapNX()
{
gfx_clear_buffer(&g_gfx_ctxt);
sd_unmount();
u32 battPercent = 0;
u32 letX = 20;
u32 letY = 380;

u32 burntFuses = 0;
for (u32 i = 0; i < 32; i++)
while (true)
{
if ((fuse_read_odm(7) >> i) & 1)
burntFuses++;
}
char *mindowngrade = "unknow";
if(burntFuses == 1){mindowngrade = "1.0.0";}
if(burntFuses == 2){mindowngrade = "2.0.0";}
if(burntFuses == 3){mindowngrade = "3.0.0";}
if(burntFuses == 4){mindowngrade = "3.0.1";}
if(burntFuses == 5){mindowngrade = "4.0.0";}
if(burntFuses == 6){mindowngrade = "5.0.0";}
if(burntFuses == 7){mindowngrade = "6.0.0";}
if(burntFuses == 8){mindowngrade = "6.2.0";}
if(burntFuses == 9){mindowngrade = "7.0.0";}
if(burntFuses == 10){mindowngrade = "8.1.0";}
if(burntFuses == 11){mindowngrade = "9.0.0";}
display_backlight_brightness(0, 1000);
while (true) {
max17050_get_property(MAX17050_RepSOC, (int *)&battPercent);
gfx_swap_buffer(&g_gfx_ctxt);
g_gfx_con.mute = 0;
g_gfx_con.scale = 3;
gfx_con_setpos(&g_gfx_con, 10, 10);
gfx_con_setcol(&g_gfx_con, 0xFF008F39, 0xFF726F68, 0xFF191414);
gfx_printf(&g_gfx_con, "BootStrapNX\n Haku33 has finish the Clean\n");
gfx_con_setcol(&g_gfx_con, 0xFFF9F9F9, 0, 0xFF191414);
gfx_con_setpos(&g_gfx_con, 950, 10);
gfx_printf(&g_gfx_con, "Battery: -%d%-", (battPercent >> 8) & 0xFF, (battPercent & 0xFF));
g_gfx_con.scale = 2;
gfx_con_setpos(&g_gfx_con, 600, 130);
gfx_printf(&g_gfx_con,"Burnt fuses:%k %d%k Minimum Downgrade:%k %s%k \n\n", 0xFF00FF22, burntFuses ,0xFFCCCCCC ,0xFF00FF22 ,mindowngrade ,0xFFCCCCCC);
g_gfx_con.scale = 3;
gfx_con_setpos(&g_gfx_con, letX, letY+250);
gfx_printf(&g_gfx_con, "Press %kPOWER%k To Boot %kpayload.bin%k\n",0xFF331ad8,0xFFF9F9F9,0xFF008F39,0xFFF9F9F9);
gfx_con_setpos(&g_gfx_con, letX, letY+280);
gfx_printf(&g_gfx_con, "Hold %kVol+ POWER%k To Reboot RCM\n",0xFF331ad8,0xFFF9F9F9);
gfx_con_setpos(&g_gfx_con, letX, letY+310);
gfx_printf(&g_gfx_con, "Hold %kPOWER%k To Full Power Off\n",0xFF331ad8,0xFFF9F9F9);
g_gfx_con.mute = 1;
display_backlight_brightness(0, 1000);
btn_wait();
if (btn_read() & BTN_POWER)

if (btn_read() & BTN_POWER)
{
msleep(500);
if (btn_read() & BTN_VOL_UP) reboot_rcm();
power_off();
}

if (btn_read() & BTN_VOL_UP)
{
if (btn_read() & BTN_VOL_UP){reboot_rcm();}
if (sd_mount())
{
g_gfx_con.mute = 0;
Expand All @@ -262,8 +228,7 @@ display_backlight_brightness(0, 1000);
gfx_printf(&g_gfx_con, "%kpayload.bin%k missing%k\n",0xFF008F39,0xFFea2f1e,0xFFF9F9F9);
gfx_swap_buffer(&g_gfx_ctxt);
btn_wait_timeout(7000, BTN_POWER);

}else{
}else{
g_gfx_con.mute = 0;
display_backlight_brightness(100, 1000);
gfx_con_setpos(&g_gfx_con, 250, 230);
Expand All @@ -272,21 +237,6 @@ display_backlight_brightness(0, 1000);
gfx_swap_buffer(&g_gfx_ctxt);
btn_wait_timeout(7000, BTN_POWER);
}
//if hold power buton then power off
if (btn_read() & BTN_POWER){
display_backlight_brightness(0, 1000);
msleep(1000);
if (btn_read() & BTN_POWER)
power_off();}

}

if (btn_read() & BTN_VOL_DOWN)
{
display_backlight_brightness(100, 1000);
gfx_swap_buffer(&g_gfx_ctxt);
btn_wait_timeout(7000, BTN_VOL_DOWN);
}
display_backlight_brightness(0, 1000);
}
}
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ INCLUDES := include
EXEFS_SRC := exefs_src
APP_TITLE := Haku33
APP_AUTHOR := Kronos2308
APP_VERSION := 2.1
APP_VERSION := 2.2
ROMFS := romfs

#---------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion compile.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ if %a% equ 0 color 0a
echo -----------------------------------
"C:\devkitPro\tools\bin\nxlink.exe" -a %IP% %File%
%systemroot%\system32\timeout.exe 55
cmd /k

Binary file modified romfs/Haku33_payload.bin
Binary file not shown.
14 changes: 9 additions & 5 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ char *incognito(void) {

bool install()
{
if(isSpanish)
printf("\n\x1b[33;1m*\x1b[0m Si se congela mucho tiempo, Es que ha fallado. Pulsa POWER 15s \n\n");
else
printf("\n\x1b[33;1m*\x1b[0m If it freezes a long time, it has failed. Press POWER 15s\n\n");

//Initialize proc
printf("\x1b[32;1m*\x1b[0m Initialize proc\n");
consoleUpdate(NULL);
Expand All @@ -215,7 +220,7 @@ bool install()
pmshellTerminateProgram(0x0100000000000036);//creport
pmshellTerminateProgram(0x010000000000003A);//migration
pmshellTerminateProgram(0x010000000000003E);//olsc
pmshellTerminateProgram(0x0100000000001000);//qlaunch - make freeze?
pmshellTerminateProgram(0x0100000000001000);//qlaunch - make freeze? some times
pmshellTerminateProgram(0x0100000000001009);//miiEdit

//serv test may freeze
Expand Down Expand Up @@ -320,7 +325,7 @@ int main(int argc, char **argv)
{
//romfs
romfsInit();

set_LANG();
//keys
u32 minus = 0;
u32 more = 0;
Expand Down Expand Up @@ -361,18 +366,17 @@ if (kHeld & KEY_PLUS)
printf("\x1b[31;1m*\x1b[0m Desactiva el Modo Avion usar las 90DNS (Requerido)\n\n\x1b[33;1m*\x1b[0m DNS Primario: 163.172.141.219\n\n\x1b[33;1m*\x1b[0m DNS Secundario: 207.246.121.77\n\n");
if(fileExists("license.dat"))
printf("\x1b[33;1m*\x1b[0m Si lo tienes activo, Apaga el FTP de sxos\n\n");

}else{
printf("\n\x1b[30;1m YOUR CONSOLE WILL BE COMPLETELY CLEANED: SAVES, GAMES, ETC \x1b[0m\n");
printf("\n\x1b[30;1m A HARD RESET WILL BE PERFORMED AFTER THE CONSOLE WILL BE OFF \x1b[0m\n");
printf("\n\x1b[30;1m IF YOU DON'T KNOW WHAT YOU DO, PRESS B FOR ABORT \x1b[0m\n");
printf("\n\n\x1b[30;1m-------- I WILL CONSUME EVERYTHING --------\x1b[0m\n\n");
printf("PRESS - + ZR ZL TO CLEAN\n\n");
printf("PRESS \x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR\x1b[3%u;1m ZL \x1b[0m \x1b[30;1m TO CLEAN\n\n",minus,more,RT,LT);
if(strlen(incognito()) == 0)//detect incognito
printf("\x1b[31;1m*\x1b[0m Uninstall Incognito (Required)\n\n");
if(!HasConnection())//detect airplane mode for evoid freeze
printf("\x1b[31;1m*\x1b[0m Disable Airplane mode and use 90DNS(Required)\n\n\x1b[32;1m*\x1b[0m Primary DNS: 163.172.141.219\n\n\x1b[32;1m*\x1b[0m Secondary DNS: 207.246.121.77\n\n");
if(fileExists("license.dat"))
if(fileExists("license.dat"))
printf("\x1b[33;1m*\x1b[0m If you have it active, Turn off FTP sxos\n\n");

}
Expand Down

0 comments on commit dede3b5

Please sign in to comment.