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

Function vga_scrollmap

sys/msdos/vidvga.c:593–653  ·  view source on GitHub ↗
(left)

Source from the content-addressed store, hash-verified

591
592#ifdef SCROLLMAP
593static void
594vga_scrollmap(left)
595boolean left;
596{
597 int j, x, y, t;
598 int i, pixx, pixy, x1, y1, x2, y2;
599 int byteoffset, vplane;
600 char __far *tmp1;
601 char __far *tmp2;
602 unsigned char source[SCREENPLANES][80];
603 unsigned char first, second;
604
605 pixy = row2y(TOP_MAP_ROW); /* convert to pixels */
606 pixx = col2x(x1);
607 if (left) {
608 x1 = 20;
609 x2 = 0;
610 } else {
611 x1 = 0;
612 x2 = 20;
613 }
614 /* read each row, all columns but the one to be replaced */
615 for (i = 0; i < (ROWNO - 1) * ROWS_PER_CELL; ++i) {
616 tmp1 = screentable[i + pixy];
617 tmp1 += x1;
618 for (vplane = 0; vplane < SCREENPLANES; ++vplane) {
619 egareadplane(vplane);
620 for (byteoffset = 0; byteoffset < 20; ++byteoffset) {
621 tmp2 = tmp1 + byteoffset;
622 source[vplane][byteoffset] = READ_ABSOLUTE(tmp2);
623 }
624 }
625 tmp1 = screentable[i + pixy];
626 tmp1 += x2;
627 for (vplane = 0; vplane < SCREENPLANES; ++vplane) {
628 egawriteplane(vp2[vplane]);
629 for (byteoffset = 0; byteoffset < 20; ++byteoffset) {
630 tmp2 = tmp1 + byteoffset;
631 WRITE_ABSOLUTE(tmp2, source[vplane][byteoffset]);
632 }
633 }
634 egawriteplane(15);
635 }
636
637 if (left) {
638 i = clipxmax - 1;
639 j = clipxmax;
640 } else {
641 i = clipx;
642 j = clipx + 1;
643 }
644 for (y = 0; y < ROWNO; ++y) {
645 for (x = i; x < j; x += 2) {
646 t = map[y][x].glyph;
647 read_planar_tile(t, &planecell);
648 if (map[y][x].special)
649 decal_planar(&planecell, map[y][x].special);
650 vga_DisplayCell(&planecell, x - clipx, y + TOP_MAP_ROW);

Callers

nothing calls this directly

Calls 3

read_planar_tileFunction · 0.85
decal_planarFunction · 0.85
vga_DisplayCellFunction · 0.85

Tested by

no test coverage detected