1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2024-11-13 18:20:46 +01:00

hook/other classic piu: Add gfx scaling feature

Support every game except for mk3 ports and pro series. Pro series
can do scaling etc by game configuration and mk3 has a different
gfx backend setup
This commit is contained in:
icex2 2021-03-20 11:35:31 +01:00
parent e86742b03c
commit 083505abd9
36 changed files with 187 additions and 0 deletions

View File

@ -4,6 +4,9 @@ game.settings=./save
# [str]: Version of the game (format YYYYMMDD). Make sure this matches exactly the version you are running because the hook lib has to apply memory patches.
game.version=20040408
# 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

@ -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

@ -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

@ -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

@ -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

@ -4,6 +4,9 @@ game.force_unlock=0
# [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

@ -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

@ -4,6 +4,9 @@ game.force_unlock=0
# [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

@ -4,6 +4,9 @@ game.force_unlock=0
# [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

@ -129,6 +129,10 @@ static void exchook_patch_gfx_init(struct exchook_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 exchook_patch_main_loop_init(struct exchook_options *options)

View File

@ -4,6 +4,7 @@
#define EXCHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define EXCHOOK_OPTIONS_STR_GAME_VERSION "game.version"
#define EXCHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define EXCHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define EXCHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define EXCHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -40,6 +41,13 @@ static const struct util_options_def exchook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "20040408",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = EXCHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -165,6 +173,8 @@ bool exchook_options_init(
util_options_get_str(options_opt, EXCHOOK_OPTIONS_STR_GAME_SETTINGS);
options->game.version =
util_options_get_str(options_opt, EXCHOOK_OPTIONS_STR_GAME_VERSION);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, EXCHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, EXCHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

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

View File

@ -139,6 +139,10 @@ static void f2hook_patch_gfx_init(struct f2hook_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 f2hook_patch_main_loop_init(struct f2hook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define F2HOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define F2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define F2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define F2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define F2HOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -32,6 +33,13 @@ const struct util_options_def f2hook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = F2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -168,6 +176,8 @@ bool f2hook_options_init(int argc, char **argv, struct f2hook_options *options)
options->game.settings =
util_options_get_str(options_opt, F2HOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, F2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, F2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

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

View File

@ -137,6 +137,10 @@ static void fexhook_patch_gfx_init(struct fexhook_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 fexhook_patch_main_loop_init(struct fexhook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define FEXHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define FEXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define FEXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define FEXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define FEXHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -32,6 +33,13 @@ const struct util_options_def fexhook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = FEXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -170,6 +178,8 @@ bool fexhook_options_init(
options->game.settings =
util_options_get_str(options_opt, FEXHOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, FEXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, FEXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

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

View File

@ -137,6 +137,10 @@ static void fsthook_patch_gfx_init(struct fsthook_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 fsthook_patch_main_loop_init(struct fsthook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define FSTHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define FSTHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define FSTHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define FSTHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define FSTHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -32,6 +33,13 @@ const struct util_options_def fsthook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = FSTHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -170,6 +178,8 @@ bool fsthook_options_init(
options->game.settings =
util_options_get_str(options_opt, FSTHOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, FSTHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, FSTHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

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

View File

@ -161,6 +161,10 @@ static void nxhook_patch_gfx_init(struct nxhook_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 nxhook_patch_game_init(struct nxhook_options *options)

View File

@ -4,6 +4,7 @@
#define NXHOOK_OPTIONS_STR_GAME_FORCE_UNLOCK "game.force_unlock"
#define NXHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define NXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define NXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define NXHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define NXHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -31,6 +32,13 @@ static const struct util_options_def nxhook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_BOOL,
.default_value.b = false,
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = NXHOOK_OPTIONS_STR_GAME_SETTINGS,
.description = "Path to game settings (SETTINGS) folder",
@ -159,6 +167,8 @@ bool nxhook_options_init(int argc, char **argv, struct nxhook_options *options)
options->game.force_unlock =
util_options_get_bool(options_opt, NXHOOK_OPTIONS_STR_GAME_FORCE_UNLOCK);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, NXHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->game.settings =
util_options_get_str(options_opt, NXHOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.hook_mon.file = util_options_get_bool(

View File

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

View File

@ -203,6 +203,10 @@ static void nxahook_patch_gfx_init(struct nxahook_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 nxahook_patch_main_loop_init(struct nxahook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define NXAHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define NXAHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define NXAHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define NXAHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define NXAHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -32,6 +33,13 @@ const struct util_options_def nxahook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = NXAHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",

View File

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

View File

@ -145,6 +145,10 @@ static void prihook_patch_gfx_init(struct prihook_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 prihook_patch_main_loop_init(struct prihook_options *options)

View File

@ -3,6 +3,7 @@
#include "util/options.h"
#define PRIHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define PRIHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define PRIHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define PRIHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define PRIHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -30,6 +31,13 @@ const struct util_options_def prihook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = PRIHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -161,6 +169,8 @@ bool prihook_options_init(
options->game.settings =
util_options_get_str(options_opt, PRIHOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, PRIHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, PRIHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs =

View File

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

View File

@ -141,6 +141,10 @@ static void x2hook_patch_gfx_init(struct x2hook_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 x2hook_patch_game_init(struct x2hook_options *options)

View File

@ -4,6 +4,7 @@
#define X2HOOK_OPTIONS_STR_GAME_FORCE_UNLOCK "game.force_unlock"
#define X2HOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define X2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define X2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define X2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define X2HOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -38,6 +39,13 @@ static const struct util_options_def x2hook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = X2HOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -159,6 +167,8 @@ bool x2hook_options_init(int argc, char **argv, struct x2hook_options *options)
options->game.force_unlock =
util_options_get_bool(options_opt, X2HOOK_OPTIONS_STR_GAME_FORCE_UNLOCK);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, X2HOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->game.settings =
util_options_get_str(options_opt, X2HOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.hook_mon.file = util_options_get_bool(

View File

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

View File

@ -143,6 +143,10 @@ static void zerohook_patch_gfx_init(struct zerohook_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 zerohook_patch_game_init(struct zerohook_options *options)

View File

@ -4,6 +4,7 @@
#define ZEROHOOK_OPTIONS_STR_GAME_FORCE_UNLOCK "game.force_unlock"
#define ZEROHOOK_OPTIONS_STR_GAME_SETTINGS "game.settings"
#define ZEROHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE "gfx.scaling_mode"
#define ZEROHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE "patch.hook_mon.file"
#define ZEROHOOK_OPTIONS_STR_PATCH_HOOK_MON_FS "patch.hook_mon.fs"
#define ZEROHOOK_OPTIONS_STR_PATCH_HOOK_MON_IO "patch.hook_mon.io"
@ -38,6 +39,13 @@ static const struct util_options_def zerohook_options_def[] = {
.type = UTIL_OPTIONS_TYPE_STR,
.default_value.str = "./save",
},
{
.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",
.param = 'z',
.type = UTIL_OPTIONS_TYPE_INT,
.default_value.i = 0,
},
{
.name = ZEROHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE,
.description = "Enable file call monitoring",
@ -163,6 +171,8 @@ bool zerohook_options_init(
options_opt, ZEROHOOK_OPTIONS_STR_GAME_FORCE_UNLOCK);
options->game.settings =
util_options_get_str(options_opt, ZEROHOOK_OPTIONS_STR_GAME_SETTINGS);
options->patch.gfx.scaling_mode = util_options_get_int(
options_opt, ZEROHOOK_OPTIONS_STR_PATCH_GFX_SCALING_MODE);
options->patch.hook_mon.file = util_options_get_bool(
options_opt, ZEROHOOK_OPTIONS_STR_PATCH_HOOK_MON_FILE);
options->patch.hook_mon.fs = util_options_get_bool(

View File

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