From nobody Tue Nov 4 15:28:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530142891919176.65979376484324; Wed, 27 Jun 2018 16:41:31 -0700 (PDT) Received: from localhost ([::1]:33676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYK43-0007Gy-3N for importer@patchew.org; Wed, 27 Jun 2018 19:41:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYJtQ-0007y3-Bz for qemu-devel@nongnu.org; Wed, 27 Jun 2018 19:30:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYJtN-0003jf-0w for qemu-devel@nongnu.org; Wed, 27 Jun 2018 19:30:32 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:51426) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYJtM-0003ij-Ft; Wed, 27 Jun 2018 19:30:28 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MUxAq-1fdtMU2fG8-00YCUo; Thu, 28 Jun 2018 01:30:03 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 01:29:45 +0200 Message-Id: <20180627232951.14725-5-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180627232951.14725-1-laurent@vivier.eu> References: <20180627232951.14725-1-laurent@vivier.eu> X-Provags-ID: V03:K1:U4wDYfEBpRGtdHDGzIZ2iK2iCCc9xpLxRCUpe9x9XCAKQYo86de /WSJ50RNYMmdCSBR7Rnh7g0o0VTeE44G+QTEuremWPoAt2F9EAsz8tHdeVUNZKQheZHaX69 3GW63JWwGwkfZmAaZci6V/LzAsckgIgHCoD6b7MRSm8eo6bPgFr0o3o5pKd/LreVZnCWNB+ e2x4/i3+mCZ0Cu4pLXVsA== X-UI-Out-Filterresults: notjunk:1;V01:K0:PHj0KqzdyCc=:lobXDWfJa1xjSu3zxbS2T9 j/GVuy8Fm/XRQW1fGjBDweyl2sAkWHyKLDxrfryxFi8Ax/izowAQuDNtos2KDtfx9imewhAS1 Ab7zb289lz1QWcENwB7tkSpLFz1BGq9gojLDfbrozY7HrujtM54D6s7uKs4772JrSg6amzH3g fHh4clmrloytnDmWJcKpCms9ADcI8sPcMFAgPtyRgMBP2u2/0IgymQFu2yenOQoTN3gbBNMU3 cTgZj06D05XoCYyO9TcE89GXIxX/9OUyWzKlr6X38/Jx+VuIDNzCq9jFJZ/wW/wc+DXPaNqBM FZ2lDaghbDSFO/OKZReJj6CeGokIHp373UBln7wMoQh+QWwAu8UyUfsHa0ojRllYoQvKX0UDs bR15LM0INoeUCE/DKfXzgTp7yeUYUQjmIjoLEvznB3Pt4MnHNDj2gP8jby6natHTAx5cyCoyE 8ULZbBiWqAh7QqgX/qWJTE0ddLSVra7oO0WiIuQGnS1kgPvffecvOU7S88XdGHuoXZ0NLxIrr oeFuXh5mOAVB9NEHCJWyDHTZE4Gj5dOY1z7EV3pkv+qZuFCkPVbpHiRZJchArdPieR654AoqM /glstLt8GIZJmEd74TdRW1B8FvPXNTPpadJ/Guupa8Iu6WUnkiR101iW5cCBvEjsRLQUKK0F0 r9RsHRIiWsRf1WnBLahyXtGDoboz8G1HKzScDnjyUzufEskQNn9hSUTj+vTO+Ba7PGWQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [RFC v3 04/10] hw/m68k: add video card X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Jason Wang , Mark Cave-Ayland , "Dr. David Alan Gilbert" , Laurent Vivier , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann , Paolo Bonzini , Max Reitz , Yongbok Kim , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Co-developed-by: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Signed-off-by: Laurent Vivier --- arch_init.c | 4 + hw/display/Makefile.objs | 1 + hw/display/macfb-template.h | 158 +++++++++++++++++++++++++++ hw/display/macfb.c | 252 ++++++++++++++++++++++++++++++++++++++++= ++++ include/hw/display/macfb.h | 42 ++++++++ qemu-options.hx | 2 +- vl.c | 3 +- 7 files changed, 460 insertions(+), 2 deletions(-) create mode 100644 hw/display/macfb-template.h create mode 100644 hw/display/macfb.c create mode 100644 include/hw/display/macfb.h diff --git a/arch_init.c b/arch_init.c index f4f3f610c8..5a71b48dc5 100644 --- a/arch_init.c +++ b/arch_init.c @@ -39,6 +39,10 @@ int graphic_width =3D 1024; int graphic_height =3D 768; int graphic_depth =3D 8; +#elif defined(TARGET_M68K) +int graphic_width =3D 800; +int graphic_height =3D 600; +int graphic_depth =3D 8; #else int graphic_width =3D 800; int graphic_height =3D 600; diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index fb8408c6d0..bb9f509e4f 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -22,6 +22,7 @@ common-obj-$(CONFIG_EXYNOS4) +=3D exynos4210_fimd.o common-obj-$(CONFIG_FRAMEBUFFER) +=3D framebuffer.o common-obj-$(CONFIG_MILKYMIST) +=3D milkymist-vgafb.o common-obj-$(CONFIG_ZAURUS) +=3D tc6393xb.o +common-obj-$(CONFIG_MACFB) +=3D macfb.o =20 common-obj-$(CONFIG_MILKYMIST_TMU2) +=3D milkymist-tmu2.o milkymist-tmu2.o-cflags :=3D $(X11_CFLAGS) diff --git a/hw/display/macfb-template.h b/hw/display/macfb-template.h new file mode 100644 index 0000000000..b6ae5d728f --- /dev/null +++ b/hw/display/macfb-template.h @@ -0,0 +1,158 @@ +#if defined(READ_BITS) +#define PALETTE(i, r, g, b) \ + do { \ + r =3D s->color_palette[i * 3]; \ + g =3D s->color_palette[i * 3 + 1]; \ + b =3D s->color_palette[i * 3 + 2]; \ + } while (0) + +#if READ_BITS =3D=3D 1 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + int bit =3D x & 7; \ + int idx =3D (*from >> (7 - bit)) & 1; \ + r =3D g =3D b =3D ((1 - idx) << 7); \ + from +=3D (bit =3D=3D 7); \ + } while (0) +#elif READ_BITS =3D=3D 2 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + int bit =3D (x & 3); \ + int idx =3D (*from >> ((3 - bit) << 1)) & 3; \ + PALETTE(idx, r, g, b); \ + from +=3D (bit =3D=3D 3); \ + } while (0) +#elif READ_BITS =3D=3D 4 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + int bit =3D x & 1; \ + int idx =3D (*from >> ((1 - bit) << 2)) & 15; \ + PALETTE(idx, r, g, b); \ + from +=3D (bit =3D=3D 1); \ + } while (0) +#elif READ_BITS =3D=3D 8 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + PALETTE(*from, r, g, b); \ + from++; \ + } while (0) +#elif READ_BITS =3D=3D 16 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + uint16_t pixel; \ + pixel =3D (from[0] << 8) | from[1]; \ + r =3D ((pixel >> 10) & 0x1f) << 3; \ + g =3D ((pixel >> 5) & 0x1f) << 3; \ + b =3D (pixel & 0x1f) << 3; \ + from +=3D 2; \ + } while (0) +#elif READ_BITS =3D=3D 24 +#define READ_PIXEL(from, x, r, g, b) \ + do { \ + r =3D *from++; \ + g =3D *from++; \ + b =3D *from++; \ + } while (0) +#else +#error unknown bit depth +#endif + +#if WRITE_BITS =3D=3D 8 +#define WRITE_PIXEL(to, r, g, b) \ + do { \ + *to =3D rgb_to_pixel8(r, g, b); \ + to +=3D 1; \ + } while (0) +#elif WRITE_BITS =3D=3D 15 +#define WRITE_PIXEL(to, r, g, b) \ + do { \ + *(uint16_t *)to =3D rgb_to_pixel15(r, g, b); \ + to +=3D 2; \ + } while (0) +#elif WRITE_BITS =3D=3D 16 +#define WRITE_PIXEL(to, r, g, b) \ + do { \ + *(uint16_t *)to =3D rgb_to_pixel16(r, g, b); \ + to +=3D 2; \ + } while (0) +#elif WRITE_BITS =3D=3D 24 +#define WRITE_PIXEL(to, r, g, b) \ + do { \ + uint32_t tmp =3D rgb_to_pixel24(r, g, b); \ + *(to++) =3D tmp & 0xff; \ + *(to++) =3D (tmp >> 8) & 0xff; \ + *(to++) =3D (tmp >> 16) & 0xff; \ + } while (0) +#elif WRITE_BITS =3D=3D 32 +#define WRITE_PIXEL(to, r, g, b) \ + do { \ + *(uint32_t *)to =3D rgb_to_pixel32(r, g, b); \ + to +=3D 4; \ + } while (0) +#else +#error unknown bit depth +#endif + +static void glue(glue(glue(draw_line, READ_BITS), _), WRITE_BITS) + (MacfbState *s, uint8_t *to, uint8_t *from, int = width) +{ + uint8_t r, g, b; + int x; + for (x =3D 0; x < width; x++) { + READ_PIXEL(from, x, r, g, b); + WRITE_PIXEL(to, r, g, b); + } +} +#undef READ_BITS +#undef READ_PIXEL +#undef WRITE_PIXEL + +#elif defined(WRITE_BITS) + +#undef MACFB_RECLEVEL +#define MACFB_RECLEVEL 2 +#define READ_BITS 1 +#include "macfb-template.h" +#define READ_BITS 2 +#include "macfb-template.h" +#define READ_BITS 4 +#include "macfb-template.h" +#define READ_BITS 8 +#include "macfb-template.h" +#define READ_BITS 16 +#include "macfb-template.h" +#define READ_BITS 24 +#include "macfb-template.h" +#undef WRITE_BITS + +#else + +#define WRITE_BITS 8 +#include "macfb-template.h" + +#define WRITE_BITS 16 +#include "macfb-template.h" + +#define WRITE_BITS 24 +#include "macfb-template.h" + +#define WRITE_BITS 32 +#include "macfb-template.h" + +typedef void (*macfb_draw_line_func_t)(MacfbState *, uint8_t *, uint8_t *,= int); + +static macfb_draw_line_func_t macfb_draw_line[24][32] =3D { + [0] =3D { [7] =3D draw_line1_8, [15] =3D draw_line1_16, + [23] =3D draw_line1_24, [31] =3D draw_line1_32 }, + [1] =3D { [7] =3D draw_line2_8, [15] =3D draw_line2_16, + [23] =3D draw_line2_24, [31] =3D draw_line2_32 }, + [3] =3D { [7] =3D draw_line4_8, [15] =3D draw_line4_16, + [23] =3D draw_line4_24, [31] =3D draw_line4_32 }, + [7] =3D { [7] =3D draw_line8_8, [15] =3D draw_line8_16, + [23] =3D draw_line8_24, [31] =3D draw_line8_32 }, + [15] =3D { [7] =3D draw_line16_8, [15] =3D draw_line16_16, + [23] =3D draw_line16_24, [31] =3D draw_line16_32 }, + [23] =3D { [7] =3D draw_line24_8, [15] =3D draw_line24_16, + [23] =3D draw_line24_24, [31] =3D draw_line24_32 }, +}; +#endif diff --git a/hw/display/macfb.c b/hw/display/macfb.c new file mode 100644 index 0000000000..05841f4483 --- /dev/null +++ b/hw/display/macfb.c @@ -0,0 +1,252 @@ +/* + * QEMU Motorola 680x0 Macintosh Video Card Emulation + * Copyright (c) 2012-2018 Laurent Vivier + * + * some parts from QEMU G364 framebuffer Emulator. + * Copyright (c) 2007-2011 Herve Poussineau + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include "hw/sysbus.h" +#include "ui/console.h" +#include "ui/pixel_ops.h" +#include "hw/display/macfb.h" + +#define VIDEO_BASE 0x00001000 +#define DAFB_BASE 0x00800000 + +#define MACFB_PAGE_SIZE 4096 +#define MACFB_VRAM_SIZE (4 * 1024 * 1024) + +#define DAFB_RESET 0x200 +#define DAFB_LUT 0x213 + +#include "macfb-template.h" + +static int macfb_check_dirty(MacfbState *s, DirtyBitmapSnapshot *snap, + ram_addr_t addr, int len) +{ + return memory_region_snapshot_get_dirty(&s->mem_vram, snap, addr, len); +} + +static void macfb_draw_graphic(MacfbState *s) +{ + DisplaySurface *surface =3D qemu_console_surface(s->con); + DirtyBitmapSnapshot *snap =3D NULL; + ram_addr_t page; + int y, ymin; + int macfb_stride =3D (s->depth * s->width + 7) / 8; + macfb_draw_line_func_t draw_line; + + if (s->depth > 24) { + hw_error("macfb: unknown guest depth %d", s->depth); + return; + } + if (surface_bits_per_pixel(surface) > 32) { + hw_error("macfb: unknown host depth %d", + surface_bits_per_pixel(surface)); + return; + } + draw_line =3D macfb_draw_line[s->depth - 1][surface_bits_per_pixel(sur= face) + - 1]; + + if (draw_line =3D=3D NULL) { + hw_error("macfb: unknown guest/host depth combination %d/%d", s->d= epth, + surface_bits_per_pixel(surface)); + return; + } + + snap =3D memory_region_snapshot_and_clear_dirty(&s->mem_vram, 0x0, + memory_region_size(&s->mem_vr= am), + DIRTY_MEMORY_VGA); + + ymin =3D -1; + page =3D 0; + for (y =3D 0; y < s->height; y++, page +=3D macfb_stride) { + if (macfb_check_dirty(s, snap, page, macfb_stride)) { + uint8_t *data_display; + + data_display =3D surface_data(surface) + y * surface_stride(su= rface); + draw_line(s, data_display, s->vram + page, s->width); + + if (ymin < 0) { + ymin =3D y; + } + } else { + if (ymin >=3D 0) { + dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin); + ymin =3D -1; + } + } + } + + if (ymin >=3D 0) { + dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin); + } + + g_free(snap); +} + +static void macfb_invalidate_display(void *opaque) +{ + MacfbState *s =3D opaque; + + memory_region_set_dirty(&s->mem_vram, 0, MACFB_VRAM_SIZE); +} + +static void macfb_update_display(void *opaque) +{ + MacfbState *s =3D opaque; + DisplaySurface *surface =3D qemu_console_surface(s->con); + + qemu_flush_coalesced_mmio_buffer(); + + if (s->width =3D=3D 0 || s->height =3D=3D 0) { + return; + } + + if (s->width !=3D surface_width(surface) || + s->height !=3D surface_height(surface)) { + qemu_console_resize(s->con, s->width, s->height); + } + + macfb_draw_graphic(s); +} + +static void macfb_reset(MacfbState *s) +{ + int i; + + s->palette_current =3D 0; + for (i =3D 0; i < 256; i++) { + s->color_palette[i * 3] =3D 255 - i; + s->color_palette[i * 3 + 1] =3D 255 - i; + s->color_palette[i * 3 + 2] =3D 255 - i; + } + memset(s->vram, 0, MACFB_VRAM_SIZE); + macfb_invalidate_display(s); +} + +static uint64_t macfb_ctrl_read(void *opaque, + hwaddr addr, + unsigned int size) +{ + return 0; +} + +static void macfb_ctrl_write(void *opaque, + hwaddr addr, + uint64_t val, + unsigned int size) +{ + MacfbState *s =3D opaque; + switch (addr) { + case DAFB_RESET: + s->palette_current =3D 0; + break; + case DAFB_LUT: + s->color_palette[s->palette_current++] =3D val; + if (s->palette_current % 3) { + macfb_invalidate_display(s); + } + break; + } +} + +static const MemoryRegionOps macfb_ctrl_ops =3D { + .read =3D macfb_ctrl_read, + .write =3D macfb_ctrl_write, + .endianness =3D DEVICE_BIG_ENDIAN, + .impl.min_access_size =3D 1, + .impl.max_access_size =3D 4, +}; + +static int macfb_post_load(void *opaque, int version_id) +{ + macfb_invalidate_display(opaque); + return 0; +} + +static const VMStateDescription vmstate_macfb =3D { + .name =3D "macfb", + .version_id =3D 1, + .minimum_version_id =3D 1, + .minimum_version_id_old =3D 1, + .post_load =3D macfb_post_load, + .fields =3D (VMStateField[]) { + VMSTATE_BUFFER_UNSAFE(color_palette, MacfbState, 0, 256 * 3), + VMSTATE_UINT32(palette_current, MacfbState), + VMSTATE_END_OF_LIST() + } +}; + +static const GraphicHwOps macfb_ops =3D { + .invalidate =3D macfb_invalidate_display, + .gfx_update =3D macfb_update_display, +}; + +static void macfb_common_realize(DeviceState *dev, MacfbState *s) +{ + s->vram =3D g_malloc0(MACFB_VRAM_SIZE); + + s->con =3D graphic_console_init(dev, 0, &macfb_ops, s); + + memory_region_init_io(&s->mem_ctrl, NULL, &macfb_ctrl_ops, s, "macfb-c= trl", + 0x1000); + memory_region_init_ram_ptr(&s->mem_vram, NULL, "macfb-vram", + MACFB_VRAM_SIZE, s->vram); + vmstate_register_ram(&s->mem_vram, dev); + memory_region_set_coalescing(&s->mem_vram); +} + +static void macfb_sysbus_realize(DeviceState *dev, Error **errp) +{ + MacfbSysBusState *s =3D MACFB(dev); + MacfbState *ms =3D &s->macfb; + + macfb_common_realize(dev, ms); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_ctrl); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram); +} + +static void macfb_sysbus_reset(DeviceState *d) +{ + MacfbSysBusState *s =3D MACFB(d); + macfb_reset(&s->macfb); +} + +static Property macfb_sysbus_properties[] =3D { + 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_END_OF_LIST(), +}; + +static void macfb_sysbus_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->realize =3D macfb_sysbus_realize; + dc->desc =3D "SysBus Macintosh framebuffer"; + dc->reset =3D macfb_sysbus_reset; + dc->vmsd =3D &vmstate_macfb; + dc->props =3D macfb_sysbus_properties; +} + +static TypeInfo macfb_sysbus_info =3D { + .name =3D TYPE_MACFB, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(MacfbSysBusState), + .class_init =3D macfb_sysbus_class_init, +}; + +static void macfb_register_types(void) +{ + type_register_static(&macfb_sysbus_info); +} + +type_init(macfb_register_types) diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h new file mode 100644 index 0000000000..70ea5480fe --- /dev/null +++ b/include/hw/display/macfb.h @@ -0,0 +1,42 @@ +/* + * QEMU Motorola 680x0 Macintosh Video Card Emulation + * Copyright (c) 2012-2018 Laurent Vivier + * + * some parts from QEMU G364 framebuffer Emulator. + * Copyright (c) 2007-2011 Herve Poussineau + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef MACFB_H +#define MACFB_H + +#include "qemu/osdep.h" +#include "exec/memory.h" +#include "ui/console.h" + +typedef struct MacfbState { + MemoryRegion mem_vram; + MemoryRegion mem_ctrl; + QemuConsole *con; + + uint8_t *vram; + uint32_t palette_current; + uint8_t color_palette[256 * 3]; + uint32_t width, height; /* in pixels */ + uint8_t depth; +} MacfbState; + +#define TYPE_MACFB "sysbus-macfb" +#define MACFB(obj) \ + OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB) + +typedef struct { + SysBusDevice busdev; + + MacfbState macfb; +} MacfbSysBusState; + +#endif diff --git a/qemu-options.hx b/qemu-options.hx index d5b0c26e8e..b48f925128 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1539,7 +1539,7 @@ ETEXI =20 DEF("g", 1, QEMU_OPTION_g , "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n", - QEMU_ARCH_PPC | QEMU_ARCH_SPARC) + QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K) STEXI @item -g @var{width}x@var{height}[x@var{depth}] @findex -g diff --git a/vl.c b/vl.c index d26f19b06d..87ba3859eb 100644 --- a/vl.c +++ b/vl.c @@ -3310,7 +3310,8 @@ int main(int argc, char **argv, char **envp) if (*p =3D=3D 'x') { p++; depth =3D strtol(p, (char **)&p, 10); - if (depth !=3D 8 && depth !=3D 15 && depth !=3D 16= && + if (depth !=3D 1 && depth !=3D 2 && depth !=3D 4 && + depth !=3D 8 && depth !=3D 15 && depth !=3D 16= && depth !=3D 24 && depth !=3D 32) goto graphic_error; } else if (*p =3D=3D '\0') { --=20 2.14.4