diff options
author | Mark Cave-Ayland | 2021-10-08 00:12:47 +0200 |
---|---|---|
committer | Laurent Vivier | 2021-10-08 13:31:03 +0200 |
commit | e6108b96363bda0704ca69e5dfdb4b07dc589336 (patch) | |
tree | 2009220bd32b19b97ce4950567586a506dd05b69 /include/hw | |
parent | macfb: add trace events for reading and writing the control registers (diff) | |
download | qemu-e6108b96363bda0704ca69e5dfdb4b07dc589336.tar.gz qemu-e6108b96363bda0704ca69e5dfdb4b07dc589336.tar.xz qemu-e6108b96363bda0704ca69e5dfdb4b07dc589336.zip |
macfb: implement mode sense to allow display type to be detected
The MacOS toolbox ROM uses the monitor sense to detect the display type and then
offer a fixed set of resolutions and colour depths accordingly. Implement the
monitor sense using information found in Apple Technical Note HW26: "Macintosh
Quadra Built-In Video" along with some local experiments.
Since the default configuration is 640 x 480 with 8-bit colour then hardcode
the sense register to return MACFB_DISPLAY_VGA for now.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20211007221253.29024-8-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/display/macfb.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 80806b0306..febf4ce0e8 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -17,6 +17,24 @@ #include "ui/console.h" #include "qom/object.h" +typedef enum { + MACFB_DISPLAY_APPLE_21_COLOR = 0, + MACFB_DISPLAY_APPLE_PORTRAIT = 1, + MACFB_DISPLAY_APPLE_12_RGB = 2, + MACFB_DISPLAY_APPLE_2PAGE_MONO = 3, + MACFB_DISPLAY_NTSC_UNDERSCAN = 4, + MACFB_DISPLAY_NTSC_OVERSCAN = 5, + MACFB_DISPLAY_APPLE_12_MONO = 6, + MACFB_DISPLAY_APPLE_13_RGB = 7, + MACFB_DISPLAY_16_COLOR = 8, + MACFB_DISPLAY_PAL1_UNDERSCAN = 9, + MACFB_DISPLAY_PAL1_OVERSCAN = 10, + MACFB_DISPLAY_PAL2_UNDERSCAN = 11, + MACFB_DISPLAY_PAL2_OVERSCAN = 12, + MACFB_DISPLAY_VGA = 13, + MACFB_DISPLAY_SVGA = 14, +} MacfbDisplayType; + typedef struct MacfbState { MemoryRegion mem_vram; MemoryRegion mem_ctrl; @@ -28,6 +46,8 @@ typedef struct MacfbState { uint8_t color_palette[256 * 3]; uint32_t width, height; /* in pixels */ uint8_t depth; + + uint32_t sense; } MacfbState; #define TYPE_MACFB "sysbus-macfb" |