<commit_before>#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
#include "MainMenu.h"
#include "crypto.h"
#include "fs.h"
#include "console.h"
#include "draw.h"
#include "hid.h"
#include "screenshot.h"
#include "filepack.h"
#include "cfw.h"
#include "configuration.h"

bool bootGUI;

void LoadSettings(){
	char settings[]="00"; 
	char str[100];
	File MyFile;
	if (FileOpen(&MyFile, "/rxTools/data/system.txt", 0)){
		FileRead(&MyFile, settings, 2, 0);
		if (settings[0] == '1')bootGUI = true;
		sprintf(str, "/rxTools/Theme/%c/menu0.bin", settings[1]);
		if (FileOpen(&MyFile, str, 0)) Theme = settings[1]; //check if the theme exists, else load theme 0 (default)
		else Theme = '0';
		FileClose(&MyFile);
	}
	else
	{
		FileOpen(&MyFile, "/rxTools/data/system.txt", 1);
		FileWrite(&MyFile, "00" , 2, 0);
		Theme = '0';
		FileClose(&MyFile);
	}
}

void Initialize(){
	char str[100];
	

	DrawString(BOT_SCREEN,  " INITIALIZE... ", 0, SCREEN_HEIGHT-FONT_SIZE, WHITE, BLACK);
	if(FSInit()){
		DrawString(BOT_SCREEN,  " LOADING...    ", 0, SCREEN_HEIGHT-FONT_SIZE, WHITE, BLACK);
	}else{
		DrawString(BOT_SCREEN,  " ERROR!        ", 0, SCREEN_HEIGHT-FONT_SIZE, RED, BLACK);
	}
	LoadPack();

	//Console Stuff
	ConsoleSetXY(15, 20);
	ConsoleSetWH(SCREEN_WIDTH-30, SCREEN_HEIGHT-80);
	ConsoleSetBorderColor(BLUE);
	ConsoleSetTextColor(RGB(0, 141, 197));
	ConsoleSetBackgroundColor(TRANSPARENT);
	ConsoleSetSpecialColor(BLUE);
	ConsoleSetSpacing(2);
	ConsoleSetBorderWidth(3);
	//Check that the data is installed
	f_mkdir ("rxTools");
	f_mkdir ("rxTools/nand");
	InstallConfigData();
	LoadSettings();

	if (!bootGUI)
	{
		for (int i = 0; i < 0x333333 * 6; i++){
			u32 pad = GetInput();
			if (pad & BUTTON_R1 && i > 0x333333) goto rxTools_boot;
		}
		rxModeQuickBoot();
	}
rxTools_boot:

	sprintf(str, "/rxTools/Theme/%c/TOP.bin", Theme);
	DrawTopSplash(str);
}

int main(){
	Initialize();
	//7.X Keys stuff
	File KeyFile;
	if(FileOpen(&KeyFile, "/slot0x25KeyX.bin", 0)){
		u8 keyX[16];
		FileRead(&KeyFile, keyX, 16, 0);
		FileClose(&KeyFile);
		setup_aeskeyX(0x25, keyX);
	}else{
		if(GetSystemVersion() < 3){
			ConsoleInit();
			ConsoleSetTitle("          WARNING");
			print("WARNING:\n\nCannot find slot0x25KeyX.bin.\nSome titles decryption will fail,\nand some EmuNANDs will not boot.\n\nPress A to continue...\n");
			ConsoleShow();<commit_msg>Changed warning message.<commit_after>#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
#include "MainMenu.h"
#include "crypto.h"
#include "fs.h"
#include "console.h"
#include "draw.h"
#include "hid.h"
#include "screenshot.h"
#include "filepack.h"
#include "cfw.h"
#include "configuration.h"

bool bootGUI;

void LoadSettings(){
	char settings[]="00";
	char str[100];
	File MyFile;
	if (FileOpen(&MyFile, "/rxTools/data/system.txt", 0)){
		FileRead(&MyFile, settings, 2, 0);
		if (settings[0] == '1')bootGUI = true;
		sprintf(str, "/rxTools/Theme/%c/menu0.bin", settings[1]);
		if (FileOpen(&MyFile, str, 0)) Theme = settings[1]; //check if the theme exists, else load theme 0 (default)
		else Theme = '0';
		FileClose(&MyFile);
	}
	else
	{
		FileOpen(&MyFile, "/rxTools/data/system.txt", 1);
		FileWrite(&MyFile, "00" , 2, 0);
		Theme = '0';
		FileClose(&MyFile);
	}
}

void Initialize(){
	char str[100];


	DrawString(BOT_SCREEN,  " INITIALIZE... ", 0, SCREEN_HEIGHT-FONT_SIZE, WHITE, BLACK);
	if(FSInit()){
		DrawString(BOT_SCREEN,  " LOADING...    ", 0, SCREEN_HEIGHT-FONT_SIZE, WHITE, BLACK);
	}else{
		DrawString(BOT_SCREEN,  " ERROR!        ", 0, SCREEN_HEIGHT-FONT_SIZE, RED, BLACK);
	}
	LoadPack();

	//Console Stuff
	ConsoleSetXY(15, 20);
	ConsoleSetWH(SCREEN_WIDTH-30, SCREEN_HEIGHT-80);
	ConsoleSetBorderColor(BLUE);
	ConsoleSetTextColor(RGB(0, 141, 197));
	ConsoleSetBackgroundColor(TRANSPARENT);
	ConsoleSetSpecialColor(BLUE);
	ConsoleSetSpacing(2);
	ConsoleSetBorderWidth(3);
	//Check that the data is installed
	f_mkdir ("rxTools");
	f_mkdir ("rxTools/nand");
	InstallConfigData();
	LoadSettings();

	if (!bootGUI)
	{
		for (int i = 0; i < 0x333333 * 6; i++){
			u32 pad = GetInput();
			if (pad & BUTTON_R1 && i > 0x333333) goto rxTools_boot;
		}
		rxModeQuickBoot();
	}
rxTools_boot:

	sprintf(str, "/rxTools/Theme/%c/TOP.bin", Theme);
	DrawTopSplash(str);
}

int main(){
	Initialize();
	//7.X Keys stuff
	File KeyFile;
	if(FileOpen(&KeyFile, "/slot0x25KeyX.bin", 0)){
		u8 keyX[16];
		FileRead(&KeyFile, keyX, 16, 0);
		FileClose(&KeyFile);
		setup_aeskeyX(0x25, keyX);
	}else{
		if(GetSystemVersion() < 3){
			ConsoleInit();
			ConsoleSetTitle("          WARNING");
			print("WARNING:\n\nCannot find slot0x25KeyX.bin. If\nyour firmware version is less than\n7.X, some titles decryption will\nfail, and some EmuNANDs will not\nboot.\n\nPress A to continue...\n");
			ConsoleShow();
{'fraction_non_alphanumeric': 0.17298084929225646, 'fraction_numerical': 0.034346378018318066, 'mean_word_length': 4.542099192618224, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4587189', 'n_tokens_mistral': 2079, 'n_tokens_neox': 1890, 'n_words': 413}