diff --git a/hw/display/artist.c b/hw/display/artist.c index 65be9e3554..753dbb9a77 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -558,21 +558,17 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, bool update_start, int skip_pix, int max_pix) { struct vram_buffer *buf; - uint8_t color = artist_get_color(s); + uint8_t color; int dx, dy, t, e, x, y, incy, diago, horiz; bool c1; uint8_t *p; + trace_artist_draw_line(x1, y1, x2, y2); if (update_start) { s->vram_start = (x2 << 16) | y2; } - buf = &s->vram_buffer[ARTIST_BUFFER_AP]; - - c1 = false; - incy = 1; - if (x2 > x1) { dx = x2 - x1; } else { @@ -583,6 +579,11 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } else { dy = y1 - y2; } + if (!dx || !dy) { + return; + } + + c1 = false; if (dy > dx) { t = y2; y2 = x2; @@ -620,6 +621,8 @@ static void draw_line(ARTISTState *s, int x1, int y1, int x2, int y2, } x = x1; y = y1; + color = artist_get_color(s); + buf = &s->vram_buffer[ARTIST_BUFFER_AP]; do { if (c1) { @@ -654,7 +657,6 @@ static void draw_line_pattern_start(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int pstart = s->line_pattern_start >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, pstart); s->line_pattern_skip = pstart; } @@ -668,7 +670,6 @@ static void draw_line_pattern_next(ARTISTState *s) int endy = artist_get_y(s->blockmove_size); int line_xy = s->line_xy >> 16; - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, s->line_pattern_skip, s->line_pattern_skip + line_xy); s->line_pattern_skip += line_xy; @@ -683,7 +684,6 @@ static void draw_line_size(ARTISTState *s, bool update_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); } @@ -734,16 +734,6 @@ static void draw_line_xy(ARTISTState *s, bool update_start) endy = 0; } - - if (endx < 0) { - return; - } - - if (endy < 0) { - return; - } - - trace_artist_draw_line(startx, starty, endx, endy); draw_line(s, startx, starty, endx, endy, false, -1, -1); } @@ -755,7 +745,6 @@ static void draw_line_end(ARTISTState *s, bool update_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); } diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 9797a7f0d9..2b1b38c58a 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -83,20 +83,21 @@ #define DINO_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) -#define DINO800_REGS ((DINO_TLTIM - DINO_GMASK) / 4) +#define DINO800_REGS (1 + (DINO_TLTIM - DINO_GMASK) / 4) static const uint32_t reg800_keep_bits[DINO800_REGS] = { - MAKE_64BIT_MASK(0, 1), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 7), - MAKE_64BIT_MASK(0, 9), - MAKE_64BIT_MASK(0, 32), - MAKE_64BIT_MASK(0, 8), - MAKE_64BIT_MASK(0, 30), - MAKE_64BIT_MASK(0, 25), - MAKE_64BIT_MASK(0, 22), - MAKE_64BIT_MASK(0, 9), + MAKE_64BIT_MASK(0, 1), /* GMASK */ + MAKE_64BIT_MASK(0, 7), /* PAMR */ + MAKE_64BIT_MASK(0, 7), /* PAPR */ + MAKE_64BIT_MASK(0, 8), /* DAMODE */ + MAKE_64BIT_MASK(0, 7), /* PCICMD */ + MAKE_64BIT_MASK(0, 9), /* PCISTS */ + MAKE_64BIT_MASK(0, 32), /* Undefined */ + MAKE_64BIT_MASK(0, 8), /* MLTIM */ + MAKE_64BIT_MASK(0, 30), /* BRDG_FEAT */ + MAKE_64BIT_MASK(0, 24), /* PCIROR */ + MAKE_64BIT_MASK(0, 22), /* PCIWOR */ + MAKE_64BIT_MASK(0, 32), /* Undocumented */ + MAKE_64BIT_MASK(0, 9), /* TLTIM */ }; typedef struct DinoState { @@ -180,7 +181,9 @@ static bool dino_chip_mem_valid(void *opaque, hwaddr addr, case DINO_IO_ADDR_EN: case DINO_PCI_IO_DATA: case DINO_TOC_ADDR: - case DINO_GMASK ... DINO_TLTIM: + case DINO_GMASK ... DINO_PCISTS: + case DINO_MLTIM ... DINO_PCIWOR: + case DINO_TLTIM: ret = true; break; case DINO_PCI_IO_DATA + 2: