Removed molecularShell related stuff

This commit is contained in:
TheFloW 2017-06-23 00:21:00 +02:00
parent 6835672a1e
commit 66bfdadfd5
9 changed files with 34 additions and 195 deletions

View File

@ -133,7 +133,6 @@ target_link_libraries(VitaShell
unrar
stdc++
taihen_stub
HENkaku_stub
VitaShellUser_stub_weak
SceAppMgr_stub
SceAppUtil_stub

View File

@ -108,6 +108,7 @@ Be sure you pull request your customized design or language file there.
### Changelog 1.63 ###
- Added ability to export video files.
- Added support for PSVSD uma0: mounting.
- Fixed bug where the right analog stick was simulated when the headphone was plugged in.
### Changelog 1.62 ###

View File

@ -1,36 +0,0 @@
/*
VitaShell
Copyright (C) 2015-2017, TheFloW
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HENKAKU_CONFIGURATION_H__
#define __HENKAKU_CONFIGURATION_H__
#define HENKAKU_CONFIG_MAGIC 0x4C434C4D
#define HENKAKU_VERSION 8
#define HENKAKU_DEFAULT_VERSION_STRING "3.63"
typedef struct {
int magic;
int version;
int use_psn_spoofing;
int allow_unsafe_hb;
int use_spoofed_version;
int spoofed_version;
} HENkakuConfig;
#endif

14
init.c
View File

@ -143,9 +143,8 @@ static DefaultFile default_files[] = {
};
char vitashell_titleid[12];
char henkaku_config_path[32];
int is_safe_mode = 0, is_molecular_shell = 0;
int is_safe_mode = 0;
SceUID kernel_modid = -1, user_modid = -1;
@ -335,17 +334,6 @@ void initVitaShell() {
// Allow writing to ux0:app/VITASHELL
sceAppMgrUmount("app0:");
// Is molecularShell
if (strcmp(vitashell_titleid, "MLCL00001") == 0) {
// HENkaku config path (ux0:temp/app_work/MLCL00001/rec/config.bin)
char mount_point[16];
memset(mount_point, 0, sizeof(mount_point));
sceAppMgrWorkDirMountById(207, vitashell_titleid, mount_point);
sprintf(henkaku_config_path, "%s/config.bin", mount_point);
is_molecular_shell = 1;
}
// Is safe mode
if (sceIoDevctl("ux0:", 0x3001, NULL, 0, NULL, 0) == 0x80010030)
is_safe_mode = 1;

3
init.h
View File

@ -24,9 +24,8 @@
#define NET_INIT_SIZE 1 * 1024 * 1024
extern char vitashell_titleid[12];
extern char henkaku_config_path[32];
extern int is_safe_mode, is_molecular_shell;
extern int is_safe_mode;
extern SceUID kernel_modid, user_modid;

2
main.c
View File

@ -379,7 +379,7 @@ void drawShellInfo(const char *path) {
if (version[3] == '0')
version[3] = '\0';
pgf_draw_textf(SHELL_MARGIN_X, SHELL_MARGIN_Y, TITLE_COLOR, FONT_SIZE, "%s %s", is_molecular_shell ? "molecularShell" : "VitaShell", version);
pgf_draw_textf(SHELL_MARGIN_X, SHELL_MARGIN_Y, TITLE_COLOR, FONT_SIZE, "VitaShell %s", version);
// Status bar
float x = SCREEN_WIDTH-SHELL_MARGIN_X;

View File

@ -26,14 +26,7 @@
#include "ime_dialog.h"
#include "utils.h"
#include "henkaku_config.h"
int taiReloadConfig();
int henkaku_reload_config();
static void restartShell();
static void taihenReloadConfig();
static void henkakuRestoreDefaultSettings();
static void rebootDevice();
static void shutdownDevice();
static void suspendDevice();
@ -41,8 +34,6 @@ static void suspendDevice();
static int changed = 0;
static int theme = 0;
static HENkakuConfig henkaku_config;
static char spoofed_version[6];
static SettingsMenuEntry *settings_menu_entries = NULL;
@ -65,15 +56,6 @@ static ConfigEntry theme_entries[] = {
{ "THEME_NAME", CONFIG_TYPE_STRING, (void *)&theme_name },
};
SettingsMenuOption henkaku_settings[] = {
{ HENKAKU_ENABLE_PSN_SPOOFING, SETTINGS_OPTION_TYPE_BOOLEAN, NULL, NULL, 0, NULL, 0, &henkaku_config.use_psn_spoofing },
{ HENKAKU_ENABLE_UNSAFE_HOMEBREW, SETTINGS_OPTION_TYPE_BOOLEAN, NULL, NULL, 0, NULL, 0, &henkaku_config.allow_unsafe_hb },
{ HENKAKU_ENABLE_VERSION_SPOOFING, SETTINGS_OPTION_TYPE_BOOLEAN, NULL, NULL, 0, NULL, 0, &henkaku_config.use_spoofed_version },
{ HENKAKU_SPOOFED_VERSION, SETTINGS_OPTION_TYPE_STRING, NULL, spoofed_version, sizeof(spoofed_version)-1, NULL, 0, NULL },
{ HENKAKU_RESTORE_DEFAULT_SETTINGS, SETTINGS_OPTION_TYPE_CALLBACK, (void *)henkakuRestoreDefaultSettings, NULL, 0, NULL, 0, NULL },
{ HENKAKU_RELOAD_CONFIG, SETTINGS_OPTION_TYPE_CALLBACK, (void *)taihenReloadConfig, NULL, 0, NULL, 0, NULL },
};
SettingsMenuOption main_settings[] = {
// { VITASHELL_SETTINGS_LANGUAGE, SETTINGS_OPTION_TYPE_BOOLEAN, NULL, NULL, 0, NULL, 0, &language },
{ VITASHELL_SETTINGS_THEME, SETTINGS_OPTION_TYPE_OPTIONS, NULL, NULL, 0, NULL, 0, NULL },
@ -95,12 +77,6 @@ SettingsMenuOption power_settings[] = {
{ VITASHELL_SETTINGS_STANDBY, SETTINGS_OPTION_TYPE_CALLBACK, (void *)suspendDevice, NULL, 0, NULL, 0, NULL },
};
SettingsMenuEntry molecularshell_settings_menu_entries[] = {
{ HENKAKU_SETTINGS, henkaku_settings, sizeof(henkaku_settings) / sizeof(SettingsMenuOption) },
{ VITASHELL_SETTINGS_MAIN, main_settings, sizeof(main_settings) / sizeof(SettingsMenuOption) },
{ VITASHELL_SETTINGS_POWER, power_settings, sizeof(power_settings) / sizeof(SettingsMenuOption) },
};
SettingsMenuEntry vitashell_settings_menu_entries[] = {
{ VITASHELL_SETTINGS_MAIN, main_settings, sizeof(main_settings) / sizeof(SettingsMenuOption) },
{ VITASHELL_SETTINGS_POWER, power_settings, sizeof(power_settings) / sizeof(SettingsMenuOption) },
@ -141,34 +117,14 @@ static void suspendDevice() {
scePowerRequestSuspend();
}
static void henkakuRestoreDefaultSettings() {
memset(&henkaku_config, 0, sizeof(HENkakuConfig));
henkaku_config.use_psn_spoofing = 1;
henkaku_config.use_spoofed_version = 1;
strcpy(spoofed_version, HENKAKU_DEFAULT_VERSION_STRING);
changed = 1;
infoDialog(language_container[HENKAKU_RESTORE_DEFAULT_MESSAGE]);
}
static void taihenReloadConfig() {
taiReloadConfig();
infoDialog(language_container[HENKAKU_RELOAD_CONFIG_MESSAGE]);
}
void initSettingsMenu() {
int i;
memset(&settings_menu, 0, sizeof(SettingsMenu));
settings_menu.status = SETTINGS_MENU_CLOSED;
if (is_molecular_shell) {
n_settings_entries = sizeof(molecularshell_settings_menu_entries) / sizeof(SettingsMenuEntry);
settings_menu_entries = molecularshell_settings_menu_entries;
} else {
n_settings_entries = sizeof(vitashell_settings_menu_entries) / sizeof(SettingsMenuEntry);
settings_menu_entries = vitashell_settings_menu_entries;
}
n_settings_entries = sizeof(vitashell_settings_menu_entries) / sizeof(SettingsMenuEntry);
settings_menu_entries = vitashell_settings_menu_entries;
for (i = 0; i < n_settings_entries; i++)
settings_menu.n_options += settings_menu_entries[i].n_options;
@ -190,39 +146,6 @@ void openSettingsMenu() {
settings_menu.entry_sel = 0;
settings_menu.option_sel = 0;
if (is_molecular_shell) {
memset(&henkaku_config, 0, sizeof(HENkakuConfig));
int res = ReadFile(henkaku_config_path, &henkaku_config, sizeof(HENkakuConfig));
if (res != sizeof(HENkakuConfig) || henkaku_config.magic != HENKAKU_CONFIG_MAGIC || henkaku_config.version != HENKAKU_VERSION) {
memset(&henkaku_config, 0, sizeof(HENkakuConfig));
henkaku_config.use_psn_spoofing = 1;
henkaku_config.use_spoofed_version = 1;
}
char a = (henkaku_config.spoofed_version >> 24) & 0xF;
char b = (henkaku_config.spoofed_version >> 20) & 0xF;
char c = (henkaku_config.spoofed_version >> 16) & 0xF;
char d = (henkaku_config.spoofed_version >> 12) & 0xF;
memset(spoofed_version, 0, sizeof(spoofed_version));
if (a || b || c || d) {
spoofed_version[0] = '0' + a;
spoofed_version[1] = '.';
spoofed_version[2] = '0' + b;
spoofed_version[3] = '0' + c;
spoofed_version[4] = '\0';
if (d) {
spoofed_version[4] = '0' + d;
spoofed_version[5] = '\0';
}
} else {
strcpy(spoofed_version, HENKAKU_DEFAULT_VERSION_STRING);
}
}
// Get current theme
if (theme_name)
free(theme_name);
@ -281,26 +204,6 @@ void closeSettingsMenu() {
// Save settings
if (changed) {
if (is_molecular_shell) {
if (IS_DIGIT(spoofed_version[0]) && spoofed_version[1] == '.' && IS_DIGIT(spoofed_version[2]) && IS_DIGIT(spoofed_version[3])) {
char a = spoofed_version[0] - '0';
char b = spoofed_version[2] - '0';
char c = spoofed_version[3] - '0';
char d = IS_DIGIT(spoofed_version[4]) ? spoofed_version[4] - '0' : '\0';
henkaku_config.spoofed_version = ((a << 24) | (b << 20) | (c << 16) | (d << 12));
} else {
henkaku_config.spoofed_version = 0;
}
henkaku_config.magic = HENKAKU_CONFIG_MAGIC;
henkaku_config.version = HENKAKU_VERSION;
WriteFile(henkaku_config_path, &henkaku_config, sizeof(HENkakuConfig));
henkaku_reload_config();
}
saveSettingsConfig();
// Save theme config file
@ -408,54 +311,41 @@ void settingsMenuCtrl() {
// Agreement
if (agreement != SETTINGS_AGREEMENT_NONE) {
agreement = SETTINGS_AGREEMENT_NONE;
if (option->name == HENKAKU_ENABLE_UNSAFE_HOMEBREW) {
*(option->value) = !*(option->value);
}
}
// Change options
if (pressed_buttons & (SCE_CTRL_ENTER | SCE_CTRL_LEFT | SCE_CTRL_RIGHT)) {
changed = 1;
if (option->name == HENKAKU_ENABLE_UNSAFE_HOMEBREW) {
if (*(option->value) == 0) {
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_OK, language_container[HENKAKU_UNSAFE_HOMEBREW_MESSAGE]);
setDialogStep(DIALOG_STEP_SETTINGS_AGREEMENT);
} else {
switch (option->type) {
case SETTINGS_OPTION_TYPE_BOOLEAN:
*(option->value) = !*(option->value);
}
} else {
switch (option->type) {
case SETTINGS_OPTION_TYPE_BOOLEAN:
*(option->value) = !*(option->value);
break;
break;
case SETTINGS_OPTION_TYPE_STRING:
initImeDialog(language_container[option->name], option->string, option->size_string, SCE_IME_TYPE_EXTENDED_NUMBER, 0);
setDialogStep(DIALOG_STEP_SETTINGS_STRING);
break;
case SETTINGS_OPTION_TYPE_STRING:
initImeDialog(language_container[option->name], option->string, option->size_string, SCE_IME_TYPE_EXTENDED_NUMBER, 0);
setDialogStep(DIALOG_STEP_SETTINGS_STRING);
break;
case SETTINGS_OPTION_TYPE_CALLBACK:
option->callback(&option);
break;
case SETTINGS_OPTION_TYPE_OPTIONS:
{
if (pressed_buttons & SCE_CTRL_LEFT) {
if (*(option->value) > 0)
(*(option->value))--;
else
*(option->value) = option->n_options-1;
} else if (pressed_buttons & (SCE_CTRL_ENTER | SCE_CTRL_RIGHT)) {
if (*(option->value) < option->n_options-1)
(*(option->value))++;
else
*(option->value) = 0;
}
break;
case SETTINGS_OPTION_TYPE_CALLBACK:
option->callback(&option);
break;
case SETTINGS_OPTION_TYPE_OPTIONS:
{
if (pressed_buttons & SCE_CTRL_LEFT) {
if (*(option->value) > 0)
(*(option->value))--;
else
*(option->value) = option->n_options-1;
} else if (pressed_buttons & (SCE_CTRL_ENTER | SCE_CTRL_RIGHT)) {
if (*(option->value) < option->n_options-1)
(*(option->value))++;
else
*(option->value) = 0;
}
break;
}
}
}

1
usb.c
View File

@ -22,6 +22,7 @@
#include "utils.h"
static int remount_thread(SceSize args, void *argp) {
sceKernelDelayThread(10 * 1000);
remount(0x800);
return sceKernelExitDeleteThread(0);
}

View File

@ -356,14 +356,11 @@ char *strcasestr(const char *haystack, const char *needle) {
}
int vshIoMount(int id, const char *path, int permission, int a4, int a5, int a6) {
uint32_t buf[6];
uint32_t buf[3];
buf[0] = a4;
buf[1] = a5;
buf[2] = a6;
buf[3] = 0;
buf[4] = 0;
buf[5] = 0;
return _vshIoMount(id, path, permission, buf);
}