1 /* 2 * QEMU Motorola 680x0 Macintosh Video Card Emulation 3 * Copyright (c) 2012-2018 Laurent Vivier 4 * 5 * some parts from QEMU G364 framebuffer Emulator. 6 * Copyright (c) 2007-2011 Herve Poussineau 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or later. 9 * See the COPYING file in the top-level directory. 10 * 11 */ 12 13 #ifndef MACFB_H 14 #define MACFB_H 15 16 #include "qemu/osdep.h" 17 #include "exec/memory.h" 18 #include "ui/console.h" 19 #include "qom/object.h" 20 21 typedef struct MacfbState { 22 MemoryRegion mem_vram; 23 MemoryRegion mem_ctrl; 24 QemuConsole *con; 25 26 uint8_t *vram; 27 uint32_t vram_bit_mask; 28 uint32_t palette_current; 29 uint8_t color_palette[256 * 3]; 30 uint32_t width, height; /* in pixels */ 31 uint8_t depth; 32 } MacfbState; 33 34 #define TYPE_MACFB "sysbus-macfb" 35 typedef struct MacfbSysBusState MacfbSysBusState; 36 #define MACFB(obj) \ 37 OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB) 38 39 struct MacfbSysBusState { 40 SysBusDevice busdev; 41 42 MacfbState macfb; 43 }; 44 45 #define TYPE_NUBUS_MACFB "nubus-macfb" 46 typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass; 47 typedef struct MacfbNubusState MacfbNubusState; 48 #define NUBUS_MACFB_CLASS(class) \ 49 OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB) 50 #define NUBUS_MACFB_GET_CLASS(obj) \ 51 OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB) 52 53 struct MacfbNubusDeviceClass { 54 DeviceClass parent_class; 55 56 DeviceRealize parent_realize; 57 }; 58 59 #define NUBUS_MACFB(obj) \ 60 OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB) 61 62 struct MacfbNubusState { 63 NubusDevice busdev; 64 65 MacfbState macfb; 66 }; 67 68 #endif 69