@samitouri / QOSamiQemu / commits / 7207a9c3a9

hw/m68k: Set graphic display dimensions generically

If a dimension is not set, have the machine init code (q800_machine_init) set the default values. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20260216213121.47122-6-philmd@linaro.org>

Philippe Mathieu-Daudé committed Feb 11, 2026 at 14:47 UTC 7207a9c3a95a240585e21d08ecc88a6b6ce62faf
2 files changed +6 -6
hw/m68k/q800.c
+3 -3
@@ -560,9 +560,9 @@ static void q800_machine_init(MachineState *machine)
560 TYPE_NUBUS_MACFB);
561 dev = DEVICE(&m->macfb);
562 qdev_prop_set_uint32(dev, "slot", 9);
563 - qdev_prop_set_uint32(dev, "width", graphic_width);
564 - qdev_prop_set_uint32(dev, "height", graphic_height);
565 - qdev_prop_set_uint8(dev, "depth", graphic_depth);
563 + qdev_prop_set_uint32(dev, "width", graphic_width ?: 800);
564 + qdev_prop_set_uint32(dev, "height", graphic_height ?: 600);
565 + qdev_prop_set_uint8(dev, "depth", graphic_depth ?: 8);
566 qdev_realize(dev, BUS(nubus), &error_fatal);
567
568 macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;
system/globals-target.c
+3 -3
@@ -14,9 +14,9 @@ int graphic_width = 1024;
14 int graphic_height = 768;
15 int graphic_depth = 8;
16 #elif defined(TARGET_M68K)
17 -int graphic_width = 800;
18 -int graphic_height = 600;
19 -int graphic_depth = 8;
17 +int graphic_width;
18 +int graphic_height;
19 +int graphic_depth;
20 #else
21 int graphic_width = 800;
22 int graphic_height = 600;