Hi Sven,
On 12/20/19 10:15 PM, Sven Schnelle wrote:
This adds emulation of Artist graphics good enough
to get a Text console on both Linux and HP-UX. The
X11 server from HP-UX also works.
Signed-off-by: Sven Schnelle <sv...@stackframe.org>
---
hw/display/Kconfig | 4 +
hw/display/Makefile.objs | 1 +
hw/display/artist.c | 1450 ++++++++++++++++++++++++++++++++++++++
hw/display/trace-events | 9 +
hw/hppa/Kconfig | 1 +
hw/hppa/hppa_hardware.h | 1 +
hw/hppa/machine.c | 9 +
7 files changed, 1475 insertions(+)
create mode 100644 hw/display/artist.c
diff --git a/hw/display/Kconfig b/hw/display/Kconfig
index c500d1fc6d..15d59e10dc 100644
--- a/hw/display/Kconfig
+++ b/hw/display/Kconfig
@@ -91,6 +91,10 @@ config TCX
config CG3
bool
+config ARTIST
+ bool
+ select FRAMEBUFFER
+
config VGA
bool
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index f2182e3bef..5f03dfdcc4 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -40,6 +40,7 @@ common-obj-$(CONFIG_SM501) += sm501.o
common-obj-$(CONFIG_TCX) += tcx.o
common-obj-$(CONFIG_CG3) += cg3.o
common-obj-$(CONFIG_NEXTCUBE) += next-fb.o
+common-obj-$(CONFIG_ARTIST) += artist.o
obj-$(CONFIG_VGA) += vga.o
diff --git a/hw/display/artist.c b/hw/display/artist.c
[...]
+static void draw_line_size(ARTISTState *s, bool update_start)
+{
+
+ int startx = artist_get_x(s->vram_start);
+ int starty = artist_get_y(s->vram_start);
+ int endx = artist_get_x(s->line_size);
+ int endy = artist_get_y(s->line_size);
+
+ trace_artist_draw_line(startx, starty, endx, endy);
+ draw_line(s, startx, starty, endx, endy, update_start, -1, -1);
+}
+
+static void draw_line_xy(ARTISTState *s, bool update_start)
+{
+
+ int startx = artist_get_x(s->vram_start);
+ int starty = artist_get_y(s->vram_start);
+ int sizex = artist_get_x(s->blockmove_size);
+ int sizey = artist_get_y(s->blockmove_size);
+ int linexy = s->line_xy >> 16;
+ int endx, endy;
+
+ endx = startx;
+ endy = starty;
+
+ if (sizex > 0) {
+ endx = startx + linexy;
+ }
+
+ if (sizex < 0) {
+ endx = startx;
+ startx -= linexy;
+ }
+
+ if (sizey > 0) {
+ endy = starty + linexy;
+ }
+
+ if (sizey < 0) {
+ endy = starty;
+ starty -= linexy;
+ }
+
+ if (startx < 0) {
+ startx = 0;
+ }
+
+ if (endx < 0) {
+ endx = 0;
If negative, set to zero.
+ }
+
+ if (starty < 0) {
+ starty = 0;
+ }
+
+ if (endy < 0) {
+ endy = 0;
Ditto.
+ }
+
+
+ if (endx < 0) {
+ return;
Here Coverity points:
>>> CID 1419388: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "return;".
+ }
+
+ if (endy < 0) {
+ return;
Here again.
+ }
+
+ trace_artist_draw_line(startx, starty, endx, endy);
+ draw_line(s, startx, starty, endx, endy, false, -1, -1);
+}
+
+static void draw_line_end(ARTISTState *s, bool update_start)
+{
+
+ int startx = artist_get_x(s->vram_start);
+ int starty = artist_get_y(s->vram_start);
+ int endx = artist_get_x(s->line_end);
+ int endy = artist_get_y(s->line_end);
+
+ trace_artist_draw_line(startx, starty, endx, endy);
+ draw_line(s, startx, starty, endx, endy, update_start, -1, -1);
+}