ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/video_x.cpp
(Generate patch)

Comparing SheepShaver/src/Unix/video_x.cpp (file contents):
Revision 1.27 by gbeauche, 2004-06-11T22:09:27Z vs.
Revision 1.34 by gbeauche, 2004-12-18T18:34:56Z

# Line 46 | Line 46
46   #include "about_window.h"
47   #include "video.h"
48   #include "video_defs.h"
49 + #include "video_blit.h"
50  
51   #define DEBUG 0
52   #include "debug.h"
# Line 65 | Line 66 | static int16 mouse_wheel_mode;
66   static int16 mouse_wheel_lines;
67   static bool redraw_thread_active = false;       // Flag: Redraw thread installed
68   static pthread_attr_t redraw_thread_attr;       // Redraw thread attributes
69 + static volatile bool redraw_thread_cancel;      // Flag: Cancel Redraw thread
70   static pthread_t redraw_thread;                         // Redraw thread
71  
72   static bool local_X11;                                          // Flag: X server running on local machine?
# Line 100 | Line 102 | static int depth;                                                      // Depth of Mac
102   static Window rootwin, the_win;                         // Root window and our window
103   static int num_depths = 0;                                      // Number of available X depths
104   static int *avail_depths = NULL;                        // List of available X depths
105 + static VisualFormat visualFormat;
106   static XVisualInfo visualInfo;
107   static Visual *vis;
108   static int color_class;
# Line 500 | Line 503 | static bool open_window(int width, int h
503          the_buffer = (uint8 *)malloc((aligned_height + 2) * img->bytes_per_line);
504          D(bug("the_buffer = %p, the_buffer_copy = %p\n", the_buffer, the_buffer_copy));
505   #endif
506 <        screen_base = (uint32)the_buffer;
506 >        screen_base = Host2MacAddr(the_buffer);
507  
508          // Create GC
509          the_gc = XCreateGC(x_display, the_win, 0, 0);
# Line 539 | Line 542 | static bool open_window(int width, int h
542          native_byte_order = (XImageByteOrder(x_display) == LSBFirst);
543   #endif
544   #ifdef ENABLE_VOSF
545 <        Screen_blitter_init(&visualInfo, native_byte_order, depth);
545 >        Screen_blitter_init(visualFormat, native_byte_order, depth);
546   #endif
547  
548          // Set bytes per row
# Line 613 | Line 616 | static bool open_dga(int width, int heig
616   #if REAL_ADDRESSING || DIRECT_ADDRESSING
617          // Screen_blitter_init() returns TRUE if VOSF is mandatory
618          // i.e. the framebuffer update function is not Blit_Copy_Raw
619 <        use_vosf = Screen_blitter_init(&visualInfo, native_byte_order, depth);
619 >        use_vosf = Screen_blitter_init(visualFormat, native_byte_order, depth);
620          
621          if (use_vosf) {
622            // Allocate memory for frame buffer (SIZE is extended to page-boundary)
# Line 630 | Line 633 | static bool open_dga(int width, int heig
633  
634          // Set frame buffer base
635          D(bug("the_buffer = %p, use_vosf = %d\n", the_buffer, use_vosf));
636 <        screen_base = (uint32)the_buffer;
636 >        screen_base = Host2MacAddr(the_buffer);
637          VModes[cur_mode].viRowBytes = bytes_per_row;
638          return true;
639   #else
# Line 650 | Line 653 | static bool open_display(void)
653                  return false;
654          }
655  
656 +        // Build up visualFormat structure
657 +        visualFormat.depth = visualInfo.depth;
658 +        visualFormat.Rmask = visualInfo.red_mask;
659 +        visualFormat.Gmask = visualInfo.green_mask;
660 +        visualFormat.Bmask = visualInfo.blue_mask;
661 +
662          // Create color maps
663          if (color_class == PseudoColor || color_class == DirectColor) {
664                  cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocAll);
# Line 883 | Line 892 | static void keycode_init(void)
892  
893                  // Search for server vendor string, then read keycodes
894                  const char *vendor = ServerVendor(x_display);
895 +                // Force use of MacX mappings on MacOS X with Apple's X server
896 +                int dummy;
897 +                if (XQueryExtension(x_display, "Apple-DRI", &dummy, &dummy, &dummy))
898 +                        vendor = "MacX";
899                  bool vendor_found = false;
900                  char line[256];
901                  while (fgets(line, 255, f)) {
# Line 1193 | Line 1206 | bool VideoInit(void)
1206          // Start periodic thread
1207          XSync(x_display, false);
1208          Set_pthread_attr(&redraw_thread_attr, 0);
1209 +        redraw_thread_cancel = false;
1210          redraw_thread_active = (pthread_create(&redraw_thread, &redraw_thread_attr, redraw_func, NULL) == 0);
1211          D(bug("Redraw thread installed (%ld)\n", redraw_thread));
1212          return true;
# Line 1207 | Line 1221 | void VideoExit(void)
1221   {
1222          // Stop redraw thread
1223          if (redraw_thread_active) {
1224 +                redraw_thread_cancel = true;
1225                  pthread_cancel(redraw_thread);
1226                  pthread_join(redraw_thread, NULL);
1227                  redraw_thread_active = false;
# Line 1250 | Line 1265 | static void suspend_emul(void)
1265                  // Save frame buffer
1266                  fb_save = malloc(VModes[cur_mode].viYsize * VModes[cur_mode].viRowBytes);
1267                  if (fb_save)
1268 <                        memcpy(fb_save, (void *)screen_base, VModes[cur_mode].viYsize * VModes[cur_mode].viRowBytes);
1268 >                        Mac2Host_memcpy(fb_save, screen_base, VModes[cur_mode].viYsize * VModes[cur_mode].viRowBytes);
1269  
1270                  // Close full screen display
1271   #ifdef ENABLE_XF86_DGA
# Line 1312 | Line 1327 | static void resume_emul(void)
1327                  // Don't copy fb_save to the temporary frame buffer in VOSF mode
1328                  if (!use_vosf)
1329   #endif
1330 <                memcpy((void *)screen_base, fb_save, VModes[cur_mode].viYsize * VModes[cur_mode].viRowBytes);
1330 >                Host2Mac_memcpy(screen_base, fb_save, VModes[cur_mode].viYsize * VModes[cur_mode].viRowBytes);
1331                  free(fb_save);
1332                  fb_save = NULL;
1333          }
# Line 1644 | Line 1659 | void VideoVBL(void)
1659  
1660  
1661   /*
1647 *  Install graphics acceleration
1648 */
1649
1650 // Rectangle inversion
1651 template< int bpp >
1652 static inline void do_invrect(uint8 *dest, uint32 length)
1653 {
1654 #define INVERT_1(PTR, OFS) ((uint8  *)(PTR))[OFS] = ~((uint8  *)(PTR))[OFS]
1655 #define INVERT_2(PTR, OFS) ((uint16 *)(PTR))[OFS] = ~((uint16 *)(PTR))[OFS]
1656 #define INVERT_4(PTR, OFS) ((uint32 *)(PTR))[OFS] = ~((uint32 *)(PTR))[OFS]
1657 #define INVERT_8(PTR, OFS) ((uint64 *)(PTR))[OFS] = ~((uint64 *)(PTR))[OFS]
1658
1659 #ifndef UNALIGNED_PROFITABLE
1660        // Align on 16-bit boundaries
1661        if (bpp < 16 && (((uintptr)dest) & 1)) {
1662                INVERT_1(dest, 0);
1663                dest += 1; length -= 1;
1664        }
1665
1666        // Align on 32-bit boundaries
1667        if (bpp < 32 && (((uintptr)dest) & 2)) {
1668                INVERT_2(dest, 0);
1669                dest += 2; length -= 2;
1670        }
1671 #endif
1672
1673        // Invert 8-byte words
1674        if (length >= 8) {
1675                const int r = (length / 8) % 8;
1676                dest += r * 8;
1677
1678                int n = ((length / 8) + 7) / 8;
1679                switch (r) {
1680                case 0: do {
1681                                dest += 64;
1682                                INVERT_8(dest, -8);
1683                case 7: INVERT_8(dest, -7);
1684                case 6: INVERT_8(dest, -6);
1685                case 5: INVERT_8(dest, -5);
1686                case 4: INVERT_8(dest, -4);
1687                case 3: INVERT_8(dest, -3);
1688                case 2: INVERT_8(dest, -2);
1689                case 1: INVERT_8(dest, -1);
1690                                } while (--n > 0);
1691                }
1692        }
1693
1694        // 32-bit cell to invert?
1695        if (length & 4) {
1696                INVERT_4(dest, 0);
1697                if (bpp <= 16)
1698                        dest += 4;
1699        }
1700
1701        // 16-bit cell to invert?
1702        if (bpp <= 16 && (length & 2)) {
1703                INVERT_2(dest, 0);
1704                if (bpp <= 8)
1705                        dest += 2;
1706        }
1707
1708        // 8-bit cell to invert?
1709        if (bpp <= 8 && (length & 1))
1710                INVERT_1(dest, 0);
1711
1712 #undef INVERT_1
1713 #undef INVERT_2
1714 #undef INVERT_4
1715 #undef INVERT_8
1716 }
1717
1718 void NQD_invrect(uint32 p)
1719 {
1720        D(bug("accl_invrect %08x\n", p));
1721
1722        // Get inversion parameters
1723        int16 dest_X = (int16)ReadMacInt16(p + acclDestRect + 2) - (int16)ReadMacInt16(p + acclDestBoundsRect + 2);
1724        int16 dest_Y = (int16)ReadMacInt16(p + acclDestRect + 0) - (int16)ReadMacInt16(p + acclDestBoundsRect + 0);
1725        int16 width  = (int16)ReadMacInt16(p + acclDestRect + 6) - (int16)ReadMacInt16(p + acclDestRect + 2);
1726        int16 height = (int16)ReadMacInt16(p + acclDestRect + 4) - (int16)ReadMacInt16(p + acclDestRect + 0);
1727        D(bug(" dest X %d, dest Y %d\n", dest_X, dest_Y));
1728        D(bug(" width %d, height %d, bytes_per_row %d\n", width, height, (int32)ReadMacInt32(p + acclDestRowBytes)));
1729
1730        //!!?? pen_mode == 14
1731
1732        // And perform the inversion
1733        const int bpp = bytes_per_pixel(ReadMacInt32(p + acclDestPixelSize));
1734        const int dest_row_bytes = (int32)ReadMacInt32(p + acclDestRowBytes);
1735        uint8 *dest = Mac2HostAddr(ReadMacInt32(p + acclDestBaseAddr) + (dest_Y * dest_row_bytes) + (dest_X * bpp));
1736        width *= bpp;
1737        switch (bpp) {
1738        case 1:
1739                for (int i = 0; i < height; i++) {
1740                        do_invrect<8>(dest, width);
1741                        dest += dest_row_bytes;
1742                }
1743                break;
1744        case 2:
1745                for (int i = 0; i < height; i++) {
1746                        do_invrect<16>(dest, width);
1747                        dest += dest_row_bytes;
1748                }
1749                break;
1750        case 4:
1751                for (int i = 0; i < height; i++) {
1752                        do_invrect<32>(dest, width);
1753                        dest += dest_row_bytes;
1754                }
1755                break;
1756        }
1757 }
1758
1759 // Rectangle filling
1760 template< int bpp >
1761 static inline void do_fillrect(uint8 *dest, uint32 color, uint32 length)
1762 {
1763 #define FILL_1(PTR, OFS, VAL) ((uint8  *)(PTR))[OFS] = (VAL)
1764 #define FILL_2(PTR, OFS, VAL) ((uint16 *)(PTR))[OFS] = (VAL)
1765 #define FILL_4(PTR, OFS, VAL) ((uint32 *)(PTR))[OFS] = (VAL)
1766 #define FILL_8(PTR, OFS, VAL) ((uint64 *)(PTR))[OFS] = (VAL)
1767
1768 #ifndef UNALIGNED_PROFITABLE
1769        // Align on 16-bit boundaries
1770        if (bpp < 16 && (((uintptr)dest) & 1)) {
1771                FILL_1(dest, 0, color);
1772                dest += 1; length -= 1;
1773        }
1774
1775        // Align on 32-bit boundaries
1776        if (bpp < 32 && (((uintptr)dest) & 2)) {
1777                FILL_2(dest, 0, color);
1778                dest += 2; length -= 2;
1779        }
1780 #endif
1781
1782        // Fill 8-byte words
1783        if (length >= 8) {
1784                const uint64 c = (((uint64)color) << 32) | color;
1785                const int r = (length / 8) % 8;
1786                dest += r * 8;
1787
1788                int n = ((length / 8) + 7) / 8;
1789                switch (r) {
1790                case 0: do {
1791                                dest += 64;
1792                                FILL_8(dest, -8, c);
1793                case 7: FILL_8(dest, -7, c);
1794                case 6: FILL_8(dest, -6, c);
1795                case 5: FILL_8(dest, -5, c);
1796                case 4: FILL_8(dest, -4, c);
1797                case 3: FILL_8(dest, -3, c);
1798                case 2: FILL_8(dest, -2, c);
1799                case 1: FILL_8(dest, -1, c);
1800                                } while (--n > 0);
1801                }
1802        }
1803
1804        // 32-bit cell to fill?
1805        if (length & 4) {
1806                FILL_4(dest, 0, color);
1807                if (bpp <= 16)
1808                        dest += 4;
1809        }
1810
1811        // 16-bit cell to fill?
1812        if (bpp <= 16 && (length & 2)) {
1813                FILL_2(dest, 0, color);
1814                if (bpp <= 8)
1815                        dest += 2;
1816        }
1817
1818        // 8-bit cell to fill?
1819        if (bpp <= 8 && (length & 1))
1820                FILL_1(dest, 0, color);
1821
1822 #undef FILL_1
1823 #undef FILL_2
1824 #undef FILL_4
1825 #undef FILL_8
1826 }
1827
1828 void NQD_fillrect(uint32 p)
1829 {
1830        D(bug("accl_fillrect %08x\n", p));
1831
1832        // Get filling parameters
1833        int16 dest_X = (int16)ReadMacInt16(p + acclDestRect + 2) - (int16)ReadMacInt16(p + acclDestBoundsRect + 2);
1834        int16 dest_Y = (int16)ReadMacInt16(p + acclDestRect + 0) - (int16)ReadMacInt16(p + acclDestBoundsRect + 0);
1835        int16 width  = (int16)ReadMacInt16(p + acclDestRect + 6) - (int16)ReadMacInt16(p + acclDestRect + 2);
1836        int16 height = (int16)ReadMacInt16(p + acclDestRect + 4) - (int16)ReadMacInt16(p + acclDestRect + 0);
1837        uint32 color = htonl(ReadMacInt32(p + acclPenMode) == 8 ? ReadMacInt32(p + acclForePen) : ReadMacInt32(p + acclBackPen));
1838        D(bug(" dest X %d, dest Y %d\n", dest_X, dest_Y));
1839        D(bug(" width %d, height %d\n", width, height));
1840        D(bug(" bytes_per_row %d color %08x\n", (int32)ReadMacInt32(p + acclDestRowBytes), color));
1841
1842        // And perform the fill
1843        const int bpp = bytes_per_pixel(ReadMacInt32(p + acclDestPixelSize));
1844        const int dest_row_bytes = (int32)ReadMacInt32(p + acclDestRowBytes);
1845        uint8 *dest = Mac2HostAddr(ReadMacInt32(p + acclDestBaseAddr) + (dest_Y * dest_row_bytes) + (dest_X * bpp));
1846        width *= bpp;
1847        switch (bpp) {
1848        case 1:
1849                for (int i = 0; i < height; i++) {
1850                        memset(dest, color, width);
1851                        dest += dest_row_bytes;
1852                }
1853                break;
1854        case 2:
1855                for (int i = 0; i < height; i++) {
1856                        do_fillrect<16>(dest, color, width);
1857                        dest += dest_row_bytes;
1858                }
1859                break;
1860        case 4:
1861                for (int i = 0; i < height; i++) {
1862                        do_fillrect<32>(dest, color, width);
1863                        dest += dest_row_bytes;
1864                }
1865                break;
1866        }
1867 }
1868
1869 bool NQD_fillrect_hook(uint32 p)
1870 {
1871        D(bug("accl_fillrect_hook %08x\n", p));
1872
1873        // Check if we can accelerate this fillrect
1874        if (ReadMacInt32(p + 0x284) != 0 && ReadMacInt32(p + acclDestPixelSize) >= 8) {
1875                const int transfer_mode = ReadMacInt32(p + acclTransferMode);
1876                if (transfer_mode == 8) {
1877                        // Fill
1878                        WriteMacInt32(p + acclDrawProc, NativeTVECT(NATIVE_FILLRECT));
1879                        return true;
1880                }
1881                else if (transfer_mode == 10) {
1882                        // Invert
1883                        WriteMacInt32(p + acclDrawProc, NativeTVECT(NATIVE_INVRECT));
1884                        return true;
1885                }
1886        }
1887        return false;
1888 }
1889
1890 // Rectangle blitting
1891 // TODO: optimize for VOSF and target pixmap == screen
1892 void NQD_bitblt(uint32 p)
1893 {
1894        D(bug("accl_bitblt %08x\n", p));
1895
1896        // Get blitting parameters
1897        int16 src_X  = (int16)ReadMacInt16(p + acclSrcRect + 2) - (int16)ReadMacInt16(p + acclSrcBoundsRect + 2);
1898        int16 src_Y  = (int16)ReadMacInt16(p + acclSrcRect + 0) - (int16)ReadMacInt16(p + acclSrcBoundsRect + 0);
1899        int16 dest_X = (int16)ReadMacInt16(p + acclDestRect + 2) - (int16)ReadMacInt16(p + acclDestBoundsRect + 2);
1900        int16 dest_Y = (int16)ReadMacInt16(p + acclDestRect + 0) - (int16)ReadMacInt16(p + acclDestBoundsRect + 0);
1901        int16 width  = (int16)ReadMacInt16(p + acclDestRect + 6) - (int16)ReadMacInt16(p + acclDestRect + 2);
1902        int16 height = (int16)ReadMacInt16(p + acclDestRect + 4) - (int16)ReadMacInt16(p + acclDestRect + 0);
1903        D(bug(" src addr %08x, dest addr %08x\n", ReadMacInt32(p + acclSrcBaseAddr), ReadMacInt32(p + acclDestBaseAddr)));
1904        D(bug(" src X %d, src Y %d, dest X %d, dest Y %d\n", src_X, src_Y, dest_X, dest_Y));
1905        D(bug(" width %d, height %d\n", width, height));
1906
1907        // And perform the blit
1908        const int bpp = bytes_per_pixel(ReadMacInt32(p + acclSrcPixelSize));
1909        width *= bpp;
1910        if ((int32)ReadMacInt32(p + acclSrcRowBytes) > 0) {
1911                const int src_row_bytes = (int32)ReadMacInt32(p + acclSrcRowBytes);
1912                const int dst_row_bytes = (int32)ReadMacInt32(p + acclDestRowBytes);
1913                uint8 *src = Mac2HostAddr(ReadMacInt32(p + acclSrcBaseAddr) + (src_Y * src_row_bytes) + (src_X * bpp));
1914                uint8 *dst = Mac2HostAddr(ReadMacInt32(p + acclDestBaseAddr) + (dest_Y * dst_row_bytes) + (dest_X * bpp));
1915                for (int i = 0; i < height; i++) {
1916                        memmove(dst, src, width);
1917                        src += src_row_bytes;
1918                        dst += dst_row_bytes;
1919                }
1920        }
1921        else {
1922                const int src_row_bytes = -(int32)ReadMacInt32(p + acclSrcRowBytes);
1923                const int dst_row_bytes = -(int32)ReadMacInt32(p + acclDestRowBytes);
1924                uint8 *src = Mac2HostAddr(ReadMacInt32(p + acclSrcBaseAddr) + ((src_Y + height - 1) * src_row_bytes) + (src_X * bpp));
1925                uint8 *dst = Mac2HostAddr(ReadMacInt32(p + acclDestBaseAddr) + ((dest_Y + height - 1) * dst_row_bytes) + (dest_X * bpp));
1926                for (int i = height - 1; i >= 0; i--) {
1927                        memmove(dst, src, width);
1928                        src -= src_row_bytes;
1929                        dst -= dst_row_bytes;
1930                }
1931        }
1932 }
1933
1934 /*
1935  BitBlt transfer modes:
1936  0 : srcCopy
1937  1 : srcOr
1938  2 : srcXor
1939  3 : srcBic
1940  4 : notSrcCopy
1941  5 : notSrcOr
1942  6 : notSrcXor
1943  7 : notSrcBic
1944  32 : blend
1945  33 : addPin
1946  34 : addOver
1947  35 : subPin
1948  36 : transparent
1949  37 : adMax
1950  38 : subOver
1951  39 : adMin
1952  50 : hilite
1953 */
1954
1955 bool NQD_bitblt_hook(uint32 p)
1956 {
1957        D(bug("accl_draw_hook %08x\n", p));
1958
1959        // Check if we can accelerate this bitblt
1960        if (ReadMacInt32(p + 0x018) + ReadMacInt32(p + 0x128) == 0 &&
1961                ReadMacInt32(p + 0x130) == 0 &&
1962                ReadMacInt32(p + acclSrcPixelSize) >= 8 &&
1963                ReadMacInt32(p + acclSrcPixelSize) == ReadMacInt32(p + acclDestPixelSize) &&
1964                (ReadMacInt32(p + acclSrcRowBytes) ^ ReadMacInt32(p + acclDestRowBytes)) >= 0 && // same sign?
1965                ReadMacInt32(p + acclTransferMode) == 0 &&                                                                               // srcCopy?
1966                ReadMacInt32(p + 0x15c) > 0) {
1967
1968                // Yes, set function pointer
1969                WriteMacInt32(p + acclDrawProc, NativeTVECT(NATIVE_BITBLT));
1970                return true;
1971        }
1972        return false;
1973 }
1974
1975 // Wait for graphics operation to finish
1976 bool NQD_sync_hook(uint32 arg)
1977 {
1978        D(bug("accl_sync_hook %08x\n", arg));
1979        return true;
1980 }
1981
1982 void VideoInstallAccel(void)
1983 {
1984        // Install acceleration hooks
1985        if (PrefsFindBool("gfxaccel")) {
1986                D(bug("Video: Installing acceleration hooks\n"));
1987                uint32 base;
1988
1989                SheepVar bitblt_hook_info(sizeof(accl_hook_info));
1990                base = bitblt_hook_info.addr();
1991                WriteMacInt32(base + 0, NativeTVECT(NATIVE_BITBLT_HOOK));
1992                WriteMacInt32(base + 4, NativeTVECT(NATIVE_SYNC_HOOK));
1993                WriteMacInt32(base + 8, ACCL_BITBLT);
1994                NQDMisc(6, bitblt_hook_info.ptr());
1995
1996                SheepVar fillrect_hook_info(sizeof(accl_hook_info));
1997                base = fillrect_hook_info.addr();
1998                WriteMacInt32(base + 0, NativeTVECT(NATIVE_FILLRECT_HOOK));
1999                WriteMacInt32(base + 4, NativeTVECT(NATIVE_SYNC_HOOK));
2000                WriteMacInt32(base + 8, ACCL_FILLRECT);
2001                NQDMisc(6, fillrect_hook_info.ptr());
2002        }
2003 }
2004
2005
2006 /*
1662   *  Change video mode
1663   */
1664  
# Line 2295 | Line 1950 | static void *redraw_func(void *arg)
1950          int64 ticks = 0;
1951          uint64 next = GetTicks_usec() + VIDEO_REFRESH_DELAY;
1952  
1953 <        for (;;) {
1953 >        while (!redraw_thread_cancel) {
1954  
1955                  // Pause if requested (during video mode switches)
1956                  while (thread_stop_req)
# Line 2362 | Line 2017 | static void *redraw_func(void *arg)
2017                                          // Set new cursor image if it was changed
2018                                          if (hw_mac_cursor_accl && cursor_changed) {
2019                                                  cursor_changed = false;
2020 <                                                memcpy(cursor_image->data, MacCursor + 4, 32);
2021 <                                                memcpy(cursor_mask_image->data, MacCursor + 36, 32);
2020 >                                                uint8 *x_data = (uint8 *)cursor_image->data;
2021 >                                                uint8 *x_mask = (uint8 *)cursor_mask_image->data;
2022 >                                                for (int i = 0; i < 32; i++) {
2023 >                                                        x_mask[i] = MacCursor[4 + i] | MacCursor[36 + i];
2024 >                                                        x_data[i] = MacCursor[4 + i];
2025 >                                                }
2026                                                  XDisplayLock();
2027                                                  XFreeCursor(x_display, mac_cursor);
2028                                                  XPutImage(x_display, cursor_map, cursor_gc, cursor_image, 0, 0, 0, 0, 16, 16);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines