Fixed compatibility with udcd_uvc.skprx thanks to @xerpi

This commit is contained in:
TheFloW 2018-08-27 17:34:44 +02:00
parent f067de203a
commit 90a6fafdf1
56 changed files with 84 additions and 64 deletions

View File

@ -4,6 +4,7 @@
- Fixed bug in USB connection, where your Memory Card could be corrupted.
- Fixed line breaks in SFO files and long names will now scroll.
- Fixed compatibility with `udcd_uvc.skprx ` thanks to xerpi.
### Changelog 1.94

View File

@ -66,6 +66,8 @@ file(GLOB res_files RELATIVE
resources/*.txt
resources/*.bin
)
# ugly hack
add_resources(vitashell_res
${res_files}
build/modules/kernel/kernel.skprx
@ -207,6 +209,7 @@ vita_create_vpk(VitaShell.vpk ${VITA_TITLEID} eboot.bin
pkg/sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
)
# for network update
add_custom_target(release
COMMAND cp eboot.bin ../release/eboot.bin
COMMAND cp VitaShell.vpk_param.sfo ../release/param.sfo

View File

@ -560,7 +560,8 @@ int fileListGetArchiveEntries(FileList *list, const char *path, int sort) {
return 0;
}
int getArchivePathInfo(const char *path, uint64_t *size, uint32_t *folders, uint32_t *files, int (* handler)(const char *path)) {
int getArchivePathInfo(const char *path, uint64_t *size, uint32_t *folders,
uint32_t *files, int (* handler)(const char *path)) {
if (is_psarc)
return getPsarcPathInfo(path, size, folders, files, handler);

3
file.c
View File

@ -178,7 +178,8 @@ int getFileSha1(const char *file, uint8_t *pSha1Out, FileProcessParam *param) {
return 1;
}
int getPathInfo(const char *path, uint64_t *size, uint32_t *folders, uint32_t *files, int (* handler)(const char *path)) {
int getPathInfo(const char *path, uint64_t *size, uint32_t *folders,
uint32_t *files, int (* handler)(const char *path)) {
SceUID dfd = sceIoDopen(path);
if (dfd >= 0) {
int res = 0;

9
hex.c
View File

@ -332,14 +332,17 @@ int hexViewer(const char *file) {
// Character hex
uint8_t high_nibble = (ch >> 4) & 0xF;
uint8_t low_nibble = ch & 0xF;
int w = pgf_draw_textf(HEX_OFFSET_X + (x * HEX_OFFSET_SPACE), START_Y + ((y + 1) * FONT_Y_SPACE), (on_line && nibble_x == nibble_pos) ? HEX_NIBBLE_COLOR : color, "%01X", high_nibble);
pgf_draw_textf(HEX_OFFSET_X + (x * HEX_OFFSET_SPACE) + w, START_Y + ((y + 1) * FONT_Y_SPACE), (on_line && (nibble_x + 1) == nibble_pos) ? HEX_NIBBLE_COLOR : color, "%01X", low_nibble);
int w = pgf_draw_textf(HEX_OFFSET_X + (x * HEX_OFFSET_SPACE), START_Y + ((y + 1) * FONT_Y_SPACE),
(on_line && nibble_x == nibble_pos) ? HEX_NIBBLE_COLOR : color, "%01X", high_nibble);
pgf_draw_textf(HEX_OFFSET_X + (x * HEX_OFFSET_SPACE) + w, START_Y + ((y + 1) * FONT_Y_SPACE),
(on_line && (nibble_x + 1) == nibble_pos) ? HEX_NIBBLE_COLOR : color, "%01X", low_nibble);
// Character
ch = (ch >= 0x20) ? ch : '.';
int width = font_size_cache[(int)ch];
uint8_t byte_nibble_pos = nibble_pos - (nibble_pos % 2);
pgf_draw_textf(HEX_CHAR_X + (x * FONT_X_SPACE) + (FONT_X_SPACE - width) / 2.0f, START_Y + ((y + 1) * FONT_Y_SPACE), (on_line && nibble_x == byte_nibble_pos) ? HEX_NIBBLE_COLOR : color, "%c", ch);
pgf_draw_textf(HEX_CHAR_X + (x * FONT_X_SPACE) + (FONT_X_SPACE - width) / 2.0f, START_Y + ((y + 1) * FONT_Y_SPACE),
(on_line && nibble_x == byte_nibble_pos) ? HEX_NIBBLE_COLOR : color, "%c", ch);
}
// Offset y

View File

@ -381,7 +381,8 @@ static int exportMedia(char *path, uint32_t *songs, uint32_t *videos, uint32_t *
PhotoExportParam param;
memset(&param, 0, sizeof(PhotoExportParam));
param.version = 0x03150021;
res = scePhotoExportFromFile(path, &param, buf, process_param ? process_param->cancelHandler : NULL, NULL, out, MAX_PATH_LENGTH);
res = scePhotoExportFromFile(path, &param, buf, process_param ? process_param->cancelHandler : NULL,
NULL, out, MAX_PATH_LENGTH);
if (res < 0)
return (res == 0x80101A0B) ? 0 : res;
@ -404,7 +405,8 @@ static int exportMedia(char *path, uint32_t *songs, uint32_t *videos, uint32_t *
MusicExportParam param;
memset(&param, 0, sizeof(MusicExportParam));
res = sceMusicExportFromFile(path, &param, buf, process_param ? process_param->cancelHandler : NULL, musicExportProgress, &args, out, MAX_PATH_LENGTH);
res = sceMusicExportFromFile(path, &param, buf, process_param ? process_param->cancelHandler : NULL,
musicExportProgress, &args, out, MAX_PATH_LENGTH);
if (res < 0)
return (res == 0x8010530A) ? 0 : res;
@ -417,7 +419,8 @@ static int exportMedia(char *path, uint32_t *songs, uint32_t *videos, uint32_t *
VideoExportOutputParam out_param;
memset(&out_param, 0, sizeof(VideoExportOutputParam));
res = sceVideoExportFromFile(&in_param, 1, buf, process_param ? process_param->cancelHandler : NULL, NULL, NULL, 0, &out_param);
res = sceVideoExportFromFile(&in_param, 1, buf, process_param ? process_param->cancelHandler : NULL,
NULL, NULL, 0, &out_param);
if (res < 0)
return (res == 0x8010540A) ? 0 : res;

View File

@ -278,7 +278,8 @@ void loadLanguage(int id) {
};
// Load default config file
readConfigBuffer(&_binary_resources_english_us_txt_start, (int)&_binary_resources_english_us_txt_size, language_entries, sizeof(language_entries) / sizeof(ConfigEntry));
readConfigBuffer(&_binary_resources_english_us_txt_start, (int)&_binary_resources_english_us_txt_size,
language_entries, sizeof(language_entries) / sizeof(ConfigEntry));
// Load custom config file
if (use_custom_config) {

2
main.c
View File

@ -1970,7 +1970,7 @@ int main(int argc, const char *argv[]) {
// Automatic network update
if (!vitashell_config.disable_autoupdate) {
SceUID thid = sceKernelCreateThread("network_update_thread", (SceKernelThreadEntry)network_update_thread, 0x10000100, 0x100000, 0, 0, NULL);
SceUID thid = sceKernelCreateThread("network_update_thread", network_update_thread, 0x10000100, 0x100000, 0, 0, NULL);
if (thid >= 0)
sceKernelStartThread(thid, 0, NULL);
}

View File

@ -1230,4 +1230,3 @@ static int contextMenuNewEnterCallback(int sel, void *context) {
return CONTEXT_MENU_CLOSING;
}

View File

@ -19,6 +19,7 @@ add_executable(usbdevice
)
target_link_libraries(usbdevice
SceUdcdForDriver_stub
SceIofilemgrForDriver_stub
SceSysclibForDriver_stub
taihenForKernel_stub

View File

@ -80,6 +80,8 @@ int module_start(SceSize args, void *argp) {
hooks[2] = taiHookFunctionImportForKernel(KERNEL_PID, &ksceIoReadRef, "SceUsbstorVStorDriver",
0x40FD29C7, 0xE17EFC03, ksceIoReadPatched);
ksceUdcdStopCurrentInternal(2);
return SCE_KERNEL_START_SUCCESS;
}

View File

@ -225,7 +225,8 @@ void loadTheme() {
int i;
// Load default config file
readConfigBuffer(&_binary_resources_default_colors_txt_start, (int)&_binary_resources_default_colors_txt_size, colors_entries, sizeof(colors_entries) / sizeof(ConfigEntry));
readConfigBuffer(&_binary_resources_default_colors_txt_start, (int)&_binary_resources_default_colors_txt_size,
colors_entries, sizeof(colors_entries) / sizeof(ConfigEntry));
// Load custom config file
if (use_custom_config) {

View File

@ -281,8 +281,8 @@ int drawUncommonDialog() {
// Dialog background
vita2d_draw_texture_scale_rotate_hotspot(dialog_image, uncommon_dialog.x + uncommon_dialog.width / 2.0f,
uncommon_dialog.y + uncommon_dialog.height / 2.0f,
uncommon_dialog.scale * (uncommon_dialog.width/vita2d_texture_get_width(dialog_image)),
uncommon_dialog.scale * (uncommon_dialog.height/vita2d_texture_get_height(dialog_image)),
uncommon_dialog.scale * (uncommon_dialog.width / vita2d_texture_get_width(dialog_image)),
uncommon_dialog.scale * (uncommon_dialog.height / vita2d_texture_get_height(dialog_image)),
0.0f, vita2d_texture_get_width(dialog_image) / 2.0f, vita2d_texture_get_height(dialog_image) / 2.0f);
// Easing out

2
usb.c
View File

@ -162,7 +162,7 @@ SceUID startUsb(const char *usbDevicePath, const char *imgFilePath, int type) {
// Stop MTP driver
res = sceMtpIfStopDriver(1);
if (res < 0)
if (res < 0 && res != 0x8054360C)
goto ERROR_STOP_DRIVER;
// Set device information

View File

@ -370,8 +370,12 @@ void getTimeString(char string[16], int time_format, SceDateTime *time) {
switch(time_format) {
case SCE_SYSTEM_PARAM_TIME_FORMAT_12HR:
snprintf(string, 16, "%02d:%02d %s", (time_local.hour > 12) ? (time_local.hour - 12) : ((time_local.hour == 0) ? 12 : time_local.hour), time_local.minute, time_local.hour >= 12 ? "PM" : "AM");
{
int hour = ((time_local.hour == 0) ? 12 : time_local.hour);
snprintf(string, 16, "%02d:%02d %s", (time_local.hour > 12) ? (time_local.hour - 12) : hour,
time_local.minute, time_local.hour >= 12 ? "PM" : "AM");
break;
}
case SCE_SYSTEM_PARAM_TIME_FORMAT_24HR:
snprintf(string, 16, "%02d:%02d", time_local.hour, time_local.minute);