MCPcopy Create free account
hub / github.com/NetHack/NetHack / vga_HideCursor

Function vga_HideCursor

sys/msdos/vidvga.c:1563–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1561}
1562
1563void
1564vga_HideCursor(void)
1565{
1566 int i, pixx, pixy, x, y;
1567 char __far *tmp1;
1568 char __far *tmp2;
1569 boolean isrogue = Is_rogue_level(&u.uz);
1570 boolean singlebyte =
1571 (isrogue || iflags.over_view || iflags.traditional_view || !inmap);
1572 int curtyp;
1573
1574 if (inmap && !cursor_type)
1575 return; /* CURSOR_INVIS - nothing to do */
1576 /* protection from callers */
1577 x = min(curcol, (CO - 1));
1578 y = min(currow, (LI - 1));
1579 if (!singlebyte && ((x < clipx) || (x > clipxmax)))
1580 return;
1581
1582 pixy = row2y(y); /* convert to pixels */
1583 if (singlebyte)
1584 pixx = x;
1585 else
1586 pixx = col2x((x - clipx));
1587
1588 if (inmap)
1589 curtyp = cursor_type;
1590 else
1591 curtyp = CURSOR_UNDERLINE;
1592
1593 if (curtyp == CURSOR_UNDERLINE) /* optimization for uline */
1594 i = ROWS_PER_CELL - 1;
1595 else
1596 i = 0;
1597
1598 for (; i < ROWS_PER_CELL; ++i) {
1599 tmp1 = screentable[i + pixy];
1600 tmp1 += pixx;
1601 tmp2 = tmp1 + 1;
1602 egawriteplane(8);
1603 /* memcpy(tmp,undercursor.plane[3].image[i],BYTES_PER_CELL); */
1604 WRITE_ABSOLUTE(tmp1, undercursor.plane[3].image[i][0]);
1605 if (!singlebyte)
1606 WRITE_ABSOLUTE(tmp2, undercursor.plane[3].image[i][1]);
1607
1608 egawriteplane(4);
1609 /* memcpy(tmp,undercursor.plane[2].image[i],BYTES_PER_CELL); */
1610 WRITE_ABSOLUTE(tmp1, undercursor.plane[2].image[i][0]);
1611 if (!singlebyte)
1612 WRITE_ABSOLUTE(tmp2, undercursor.plane[2].image[i][1]);
1613
1614 egawriteplane(2);
1615 /* memcpy(tmp,undercursor.plane[1].image[i],BYTES_PER_CELL); */
1616 WRITE_ABSOLUTE(tmp1, undercursor.plane[1].image[i][0]);
1617 if (!singlebyte)
1618 WRITE_ABSOLUTE(tmp2, undercursor.plane[1].image[i][1]);
1619
1620 egawriteplane(1);

Callers 1

HideCursorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected