1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2025-01-19 07:37:22 +01:00

hook/nx2: Add option to enable gfx scaling

This commit is contained in:
icex2 2021-03-19 23:43:10 +01:00
parent 260e64d9d9
commit e86742b03c
4 changed files with 21 additions and 0 deletions

View File

@ -1,6 +1,9 @@
# [str]: Path to game settings (SETTINGS) folder
game.settings=./save
# 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
gfx.scaling_mode=0
# [bool (0/1)]: Enable file call monitoring
patch.hook_mon.file=0

View File

@ -196,6 +196,10 @@ static void nx2hook_patch_gfx_init(struct nx2hook_options *options)
log_assert(options);
patch_gfx_init();
if (options->patch.gfx.scaling_mode != PATCH_GFX_SCALE_MODE_INVALID) {
patch_gfx_scale(options->patch.gfx.scaling_mode);
}
}
static void nx2hook_patch_main_loop_init(struct nx2hook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define NX2HOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define NX2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define NX2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define NX2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define NX2HOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -36,6 +37,13 @@ const struct util_options_def nx2hook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = NX2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -191,6 +199,8 @@ bool nx2hook_options_init(
options->game.settings =
util_options_get_str(options_opt, NX2HOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, NX2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, NX2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

@ -12,6 +12,10 @@ struct nx2hook_options {
} game;
struct patch {
struct gfx {
uint8_t scaling_mode;
} gfx;
struct hook_mon {
bool file;
bool fs;