Code format

This commit is contained in:
icex2
2023-03-02 19:16:06 +01:00
parent eb47c7400f
commit f8df2564a6
26 changed files with 166 additions and 143 deletions
+2 -2
View File
@@ -34,10 +34,10 @@ exchook_lockchip_dec_chunk(uint8_t len, const uint8_t *src, uint8_t *dest)
for (size_t i = 1; i < len; i++) {
uint8_t result = sec_lockchip_step(src[i] ^ 0xFF);
dest[i - 1] = (uint8_t)((last_res >> 3) ^ (result << 5));
dest[i - 1] = (uint8_t) ((last_res >> 3) ^ (result << 5));
last_res = result;
}
uint8_t last_byte = sec_lockchip_step(0);
dest[len - 1] = (uint8_t)((last_res >> 3) ^ (last_byte << 5));
dest[len - 1] = (uint8_t) ((last_res >> 3) ^ (last_byte << 5));
}
+4 -1
View File
@@ -45,7 +45,10 @@ static const struct util_options_def exchook_options_def[] = {
},
{
.name = EXCHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -36,7 +36,10 @@ const struct util_options_def f2hook_options_def[] = {
},
{
.name = F2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -36,7 +36,10 @@ const struct util_options_def fexhook_options_def[] = {
},
{
.name = FEXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -36,7 +36,10 @@ const struct util_options_def fsthook_options_def[] = {
},
{
.name = FSTHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -35,7 +35,10 @@ static const struct util_options_def nxhook_options_def[] = {
},
{
.name = NXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -40,7 +40,10 @@ const struct util_options_def nx2hook_options_def[] = {
},
{
.name = NX2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -40,7 +40,10 @@ const struct util_options_def nxahook_options_def[] = {
},
{
.name = NXAHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+6 -3
View File
@@ -1,8 +1,8 @@
#define LOG_MODULE "patch-gfx"
#include <GL/gl.h>
#include <X11/Xutil.h>
#include <stdbool.h>
#include <GL/gl.h>
// OpenGL 3.x+
#include <GL/glx.h>
@@ -165,8 +165,11 @@ void patch_gfx_init()
log_info("Initialized");
}
// Note, consider improving scaling, see http://www.david-amador.com/2013/04/opengl-2d-independent-resolution-rendering/
// Note, consider improving scaling, see
// http://www.david-amador.com/2013/04/opengl-2d-independent-resolution-rendering/
void patch_gfx_scale(enum patch_gfx_scale_mode scale_mode)
{
log_error("GFX scaling enabled but will not work. Temporarily removed due to issues with loading libGL.so");
log_error(
"GFX scaling enabled but will not work. Temporarily removed due to "
"issues with loading libGL.so");
}
+5 -5
View File
@@ -5,11 +5,11 @@
* resolutions including keeping the aspect ratio
*/
enum patch_gfx_scale_mode {
PATCH_GFX_SCALE_MODE_INVALID = 0,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_720 = 1,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_1080 = 2,
PATCH_GFX_SCALE_MODE_SD_480_TO_SD_960 = 3,
PATCH_GFX_SCALE_MODE_HD_720_TO_HD_1080 = 4,
PATCH_GFX_SCALE_MODE_INVALID = 0,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_720 = 1,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_1080 = 2,
PATCH_GFX_SCALE_MODE_SD_480_TO_SD_960 = 3,
PATCH_GFX_SCALE_MODE_HD_720_TO_HD_1080 = 4,
};
/**
+4 -13
View File
@@ -468,9 +468,7 @@ static bool _patch_net_profile_download_profile_file(
virtual_file->buffer,
virtual_file->file_info->file_size)) {
log_error(
"Downloading file player %d, file_type %d, failed",
player,
file_type);
"Downloading file player %d, file_type %d, failed", player, file_type);
return false;
}
@@ -536,16 +534,12 @@ static bool _patch_net_profile_upload_profile_file(
virtual_file->buffer,
virtual_file->file_info->file_size)) {
log_error(
"Uploading file player %d, file_type %d, failed",
player,
file_type);
"Uploading file player %d, file_type %d, failed", player, file_type);
return false;
}
log_info(
"Uploading file player %d, file_type %d, successful",
player,
file_type);
"Uploading file player %d, file_type %d, successful", player, file_type);
return true;
}
@@ -641,10 +635,7 @@ void patch_net_profile_init(
pthread_mutex_init(&_patch_net_profile_mutex, NULL);
log_info(
"Initialized: game %d, server %s",
game,
pumpnet_server_addr);
log_info("Initialized: game %d, server %s", game, pumpnet_server_addr);
}
void patch_net_profile_shutdown()
+4 -1
View File
@@ -34,7 +34,10 @@ const struct util_options_def prihook_options_def[] = {
},
{
.name = PRIHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -43,7 +43,10 @@ static const struct util_options_def x2hook_options_def[] = {
},
{
.name = X2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,
+4 -1
View File
@@ -43,7 +43,10 @@ static const struct util_options_def zerohook_options_def[] = {
},
{
.name = ZEROHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE,
.description = "Set a scaling mode for the rendered output. Available modes: 0 = disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.description =
"Set a scaling mode for the rendered output. Available modes: 0 = "
"disabled, 1 = SD 480 to pillarbox HD 720, 2 = SD 480 to pillarbox "
"HD 1080, 3 = SD 480 to SD 960, 4 = HD 720 to HD 1080",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.is_secret_data = false,