If a dimension is not set, have the machine init code (q800_machine_init) set the default values.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> Reviewed-by: Mark Cave-Ayland <[email protected]> --- hw/m68k/q800.c | 6 +++--- system/globals-target.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index ba32da2fa45..ded531394e6 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -560,9 +560,9 @@ static void q800_machine_init(MachineState *machine) TYPE_NUBUS_MACFB); dev = DEVICE(&m->macfb); qdev_prop_set_uint32(dev, "slot", 9); - qdev_prop_set_uint32(dev, "width", graphic_width); - qdev_prop_set_uint32(dev, "height", graphic_height); - qdev_prop_set_uint8(dev, "depth", graphic_depth); + qdev_prop_set_uint32(dev, "width", graphic_width ?: 800); + qdev_prop_set_uint32(dev, "height", graphic_height ?: 600); + qdev_prop_set_uint8(dev, "depth", graphic_depth ?: 8); qdev_realize(dev, BUS(nubus), &error_fatal); macfb_mode = (NUBUS_MACFB(dev)->macfb).mode; diff --git a/system/globals-target.c b/system/globals-target.c index 989720591e7..e3f7d846ac0 100644 --- a/system/globals-target.c +++ b/system/globals-target.c @@ -14,9 +14,9 @@ int graphic_width = 1024; int graphic_height = 768; int graphic_depth = 8; #elif defined(TARGET_M68K) -int graphic_width = 800; -int graphic_height = 600; -int graphic_depth = 8; +int graphic_width; +int graphic_height; +int graphic_depth; #else int graphic_width = 800; int graphic_height = 600; -- 2.52.0
