comparison blastem.c @ 1402:458df351af06

Allow height to be specified in the config file and properly calculate from the aspect setting if it is not specified
author Michael Pavone <pavone@retrodev.com>
date Thu, 15 Jun 2017 19:24:16 -0700
parents 89eb967fed72
children 909c72c4e5a1
comparison
equal deleted inserted replaced
1401:b56c8c51ca5d 1402:458df351af06
355 cart.name = basename_no_extension(romfname); 355 cart.name = basename_no_extension(romfname);
356 cart.extension = path_extension(romfname); 356 cart.extension = path_extension(romfname);
357 loaded = 1; 357 loaded = 1;
358 } 358 }
359 359
360 int def_width = 0; 360 int def_width = 0, def_height = 0;
361 char *config_width = tern_find_path(config, "video\0width\0", TVAL_PTR).ptrval; 361 char *config_width = tern_find_path(config, "video\0width\0", TVAL_PTR).ptrval;
362 if (config_width) { 362 if (config_width) {
363 def_width = atoi(config_width); 363 def_width = atoi(config_width);
364 } 364 }
365 if (!def_width) { 365 if (!def_width) {
366 def_width = 640; 366 def_width = 640;
367 } 367 }
368 width = width < 320 ? def_width : width; 368 char *config_height = tern_find_path(config, "video\0height\0", TVAL_PTR).ptrval;
369 height = height < 240 ? (width/320) * 240 : height; 369 if (config_height) {
370 def_height = atoi(config_height);
371 }
372 if (!def_height) {
373 def_height = -1;
374 }
375 width = width < 1 ? def_width : width;
376 height = height < 1 ? def_height : height;
370 377
371 char *config_fullscreen = tern_find_path(config, "video\0fullscreen\0", TVAL_PTR).ptrval; 378 char *config_fullscreen = tern_find_path(config, "video\0fullscreen\0", TVAL_PTR).ptrval;
372 if (config_fullscreen && !strcmp("on", config_fullscreen)) { 379 if (config_fullscreen && !strcmp("on", config_fullscreen)) {
373 fullscreen = !fullscreen; 380 fullscreen = !fullscreen;
374 } 381 }