On 14/02/2026 02:12, Philippe Mathieu-Daudé wrote:

The MACFB_DISPLAY_APPLE_21_COLOR mode is not specific to the Q800
machine. Check and set it once in the MacFB DeviceRealize handler.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  hw/display/macfb.c | 4 ++++
  hw/m68k/q800.c     | 5 -----
  2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 8ef174dc6df..b8115c2be13 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -645,6 +645,10 @@ static bool macfb_common_realize(DeviceState *dev, 
MacfbState *s, Error **errp)
  {
      DisplaySurface *surface;
+ if (s->width == 1152 && s->height == 870) {
+        s->type = MACFB_DISPLAY_APPLE_21_COLOR;
+    }
+
      s->mode = macfb_find_mode(s->type, s->width, s->height, s->depth);
      if (!s->mode) {
          gchar *list;
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index b55c03a90bf..ba32da2fa45 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -563,11 +563,6 @@ static void q800_machine_init(MachineState *machine)
      qdev_prop_set_uint32(dev, "width", graphic_width);
      qdev_prop_set_uint32(dev, "height", graphic_height);
      qdev_prop_set_uint8(dev, "depth", graphic_depth);
-    if (graphic_width == 1152 && graphic_height == 870) {
-        qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_APPLE_21_COLOR);
-    } else {
-        qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_VGA);

I was going to ask about what happened to MACFB_DISPLAY_VGA, but it seems to be the default for the macfb device so no problem there.

-    }
      qdev_realize(dev, BUS(nubus), &error_fatal);
macfb_mode = (NUBUS_MACFB(dev)->macfb).mode;

I'm not sure if 1152x870 is available on all macfb devices (as opposed to just that used on the Quadra), but still for now:

Reviewed-by: Mark Cave-Ayland <[email protected]>


ATB,

Mark.


Reply via email to