MacFbSense *macfb_sense;
uint8_t sense;
- macfb_sense = &macfb_sense_table[MACFB_DISPLAY_VGA];
+ assert(s->type < ARRAY_SIZE(macfb_sense_table));
+ macfb_sense = &macfb_sense_table[s->type];
if (macfb_sense->sense == 0x7) {
/* Extended sense */
sense = 0;
DEFINE_PROP_UINT32("width", MacfbSysBusState, macfb.width, 640),
DEFINE_PROP_UINT32("height", MacfbSysBusState, macfb.height, 480),
DEFINE_PROP_UINT8("depth", MacfbSysBusState, macfb.depth, 8),
+ DEFINE_PROP_UINT8("display", MacfbSysBusState, macfb.type,
+ MACFB_DISPLAY_VGA),
DEFINE_PROP_END_OF_LIST(),
};
DEFINE_PROP_UINT32("width", MacfbNubusState, macfb.width, 640),
DEFINE_PROP_UINT32("height", MacfbNubusState, macfb.height, 480),
DEFINE_PROP_UINT8("depth", MacfbNubusState, macfb.depth, 8),
+ DEFINE_PROP_UINT8("display", MacfbNubusState, macfb.type,
+ MACFB_DISPLAY_VGA),
DEFINE_PROP_END_OF_LIST(),
};
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 && graphic_depth == 8) {
+ qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_APPLE_21_COLOR);
+ } else {
+ qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_VGA);
+ }
qdev_realize_and_unref(dev, BUS(nubus), &error_fatal);
cs = CPU(cpu);