diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-06-15 19:24:16 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-06-15 19:24:16 -0700 |
commit | b2aa71fd6a80bd5aff029c4591c4bc5c8642698a (patch) | |
tree | 578fce362e5a017f72e4c7cfbf6b01cb740f00b7 /blastem.c | |
parent | dee43c24fbd5f0ee0b81cc325164903c8b25ea1d (diff) |
Allow height to be specified in the config file and properly calculate from the aspect setting if it is not specified
Diffstat (limited to 'blastem.c')
-rw-r--r-- | blastem.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -357,7 +357,7 @@ int main(int argc, char ** argv) loaded = 1; } - int def_width = 0; + int def_width = 0, def_height = 0; char *config_width = tern_find_path(config, "video\0width\0", TVAL_PTR).ptrval; if (config_width) { def_width = atoi(config_width); @@ -365,8 +365,15 @@ int main(int argc, char ** argv) if (!def_width) { def_width = 640; } - width = width < 320 ? def_width : width; - height = height < 240 ? (width/320) * 240 : height; + char *config_height = tern_find_path(config, "video\0height\0", TVAL_PTR).ptrval; + if (config_height) { + def_height = atoi(config_height); + } + if (!def_height) { + def_height = -1; + } + width = width < 1 ? def_width : width; + height = height < 1 ? def_height : height; char *config_fullscreen = tern_find_path(config, "video\0fullscreen\0", TVAL_PTR).ptrval; if (config_fullscreen && !strcmp("on", config_fullscreen)) { |