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

Comparing BasiliskII/src/Unix/video_blit.cpp (file contents):
Revision 1.1 by gbeauche, 2001-01-28T14:05:19Z vs.
Revision 1.3 by gbeauche, 2001-06-22T08:34:49Z

# Line 67 | Line 67 | static void Blit_Copy_Raw(uint8 * dest,
67   /* --- BGR 555                                                            --- */
68   /* -------------------------------------------------------------------------- */
69  
70 < // TODO: BGR 555 (SGI/Irix)
71 < // R/G/B mask values: 0x001f, 0x03e0, 0x7c00
70 > #ifdef WORDS_BIGENDIAN
71 >
72 > // Native byte order
73 >
74 > #define FB_BLIT_1(dst, src) \
75 >        (dst = (((src) >> 10) & 0x001f) | ((src) & 0x03e0) | (((src) << 10) & 0x7c00))
76 >
77 > #define FB_BLIT_2(dst, src) \
78 >        (dst = (((src) >> 10) & 0x001f001f) | ((src) & 0x03e003e0) | (((src) << 10) & 0x7c007c00))
79 >
80 > #define FB_DEPTH 15
81 > #define FB_FUNC_NAME Blit_BGR555_NBO
82 > #include "video_blit.h"
83 >
84 > // Opposite byte order (untested)
85 >
86 > #define FB_BLIT_1(dst, src) \
87 >        (dst = (((src) >> 2) & 0x1f00) | (((src) >> 8) & 3) | (((src) << 8) & 0xe000) | (((src) << 2) & 0x7c))
88 >
89 > #define FB_BLIT_2(dst, src) \
90 >        (dst = (((src) >> 2) & 0x1f001f00) | (((src) >> 8) & 0x30003) | (((src) << 8) & 0xe000e000) | (((src) << 2) & 0x7c007c))
91 >
92 > #define FB_DEPTH 15
93 > #define FB_FUNC_NAME Blit_BGR555_OBO
94 > #include "video_blit.h"
95 >
96 > #else
97 >
98 > // Native byte order (untested)
99 >
100 > #define FB_BLIT_1(dst, src) \
101 >        (dst = (((src) >> 2) & 0x1f) | (((src) >> 8) & 0xe0) | (((src) << 8) & 0x0300) | (((src) << 2) & 0x7c00))
102 >
103 > #define FB_BLIT_2(dst, src) \
104 >        (dst = (((src) >> 2) & 0x1f001f) | (((src) >> 8) & 0xe000e0) | (((src) << 8) & 0x03000300) | (((src) << 2) & 0x7c007c00))
105 >
106 > #define FB_DEPTH 15
107 > #define FB_FUNC_NAME Blit_BGR555_NBO
108 > #include "video_blit.h"
109 >
110 > // Opposite byte order (untested)
111 >
112 > #define FB_BLIT_1(dst, src) \
113 >        (dst = (((src) << 6) & 0x1f00) | ((src) & 0xe003) | (((src) >> 6) & 0x7c))
114 >
115 > #define FB_BLIT_2(dst, src) \
116 >        (dst = (((src) << 6) & 0x1f001f00) | ((src) & 0xe003e003) | (((src) >> 6) & 0x7c007c))
117 >
118 > #define FB_DEPTH 15
119 > #define FB_FUNC_NAME Blit_BGR555_OBO
120 > #include "video_blit.h"
121 >
122 > #endif
123  
124   /* -------------------------------------------------------------------------- */
125   /* --- RGB 565                                                            --- */
# Line 168 | Line 219 | static void Blit_Copy_Raw(uint8 * dest,
219   /* --- BGR 888                                                            --- */
220   /* -------------------------------------------------------------------------- */
221  
222 < // Native byte order (untested)
222 > // Native byte order [BE] (untested)
223  
224   #ifdef WORDS_BIGENDIAN
225  
# Line 181 | Line 232 | static void Blit_Copy_Raw(uint8 * dest,
232  
233   #else
234  
235 + // Opposite byte order [LE] (untested)
236 +
237   #define FB_BLIT_2(dst, src) \
238          (dst = (((src) >> 16) & 0xff) | ((src) & 0xff0000) | (((src) & 0xff) << 16))
239  
# Line 190 | Line 243 | static void Blit_Copy_Raw(uint8 * dest,
243  
244   #endif
245  
246 < // Opposite byte order (untested)
246 > // Opposite byte order [BE] (untested) / Native byte order [LE] (untested)
247  
248   #ifdef WORDS_BIGENDIAN
249   # define FB_FUNC_NAME Blit_BGR888_OBO
# Line 229 | Line 282 | static Screen_blit_func_info Screen_blit
282          {  1, 0x000000, 0x000000, 0x000000, Blit_Copy_Raw       , Blit_Copy_Raw         },      // NT
283          {  8, 0x000000, 0x000000, 0x000000, Blit_Copy_Raw       , Blit_Copy_Raw         },      // OK (NBO)
284          { 15, 0x007c00, 0x0003e0, 0x00001f, Blit_Copy_Raw       , Blit_RGB555_OBO       },      // OK (OBO)
285 +        { 15, 0x00001f, 0x0003e0, 0x007c00, Blit_BGR555_NBO     , Blit_BGR555_OBO       },      // NT
286          { 16, 0x00f800, 0x0007e0, 0x00001f, Blit_RGB565_NBO     , Blit_RGB565_OBO       },      // OK (OBO)
287          { 24, 0xff0000, 0x00ff00, 0x0000ff, Blit_Copy_Raw       , Blit_RGB888_OBO       },      // OK (OBO)
288          { 24, 0x0000ff, 0x00ff00, 0xff0000, Blit_BGR888_NBO     , Blit_BGR888_OBO       },      // NT
289 <        { 32, 0xff0000, 0x00ff00, 0x0000ff, Blit_Copy_Raw       , Blit_RGB888_OBO       },      // OK (OBO)
290 <        { 32, 0x0000ff, 0x00ff00, 0xff0000, Blit_BGR888_NBO     , Blit_BGR888_OBO       }       // NT
289 >        { 32, 0xff0000, 0x00ff00, 0x0000ff, Blit_Copy_Raw       , Blit_RGB888_OBO       },      // OK
290 >        { 32, 0x0000ff, 0x00ff00, 0xff0000, Blit_BGR888_NBO     , Blit_BGR888_OBO       }       // OK
291   #else
292          {  1, 0x000000, 0x000000, 0x000000, Blit_Copy_Raw       , Blit_Copy_Raw         },      // NT
293          {  8, 0x000000, 0x000000, 0x000000, Blit_Copy_Raw       , Blit_Copy_Raw         },      // OK (NBO)
294          { 15, 0x007c00, 0x0003e0, 0x00001f, Blit_RGB555_NBO     , Blit_Copy_Raw         },      // OK (NBO)
295 +        { 15, 0x00001f, 0x0003e0, 0x007c00, Blit_BGR555_NBO     , Blit_BGR555_OBO       },      // NT
296          { 16, 0x00f800, 0x0007e0, 0x00001f, Blit_RGB565_NBO     , Blit_RGB565_OBO       },      // OK (NBO)
297          { 24, 0xff0000, 0x00ff00, 0x0000ff, Blit_RGB888_NBO     , Blit_Copy_Raw         },      // OK (NBO)
298          { 24, 0x0000ff, 0x00ff00, 0xff0000, Blit_BGR888_NBO     , Blit_BGR888_OBO       },      // NT
# Line 251 | Line 306 | static Screen_blit_func_info Screen_blit
306   // --> In that case, VOSF is not necessary
307   bool Screen_blitter_init(XVisualInfo * visual_info, bool native_byte_order)
308   {
309 + #if REAL_ADDRESSING || DIRECT_ADDRESSING
310          visualFormat.depth = visual_info->depth;
311          visualFormat.Rmask = visual_info->red_mask;
312          visualFormat.Gmask = visual_info->green_mask;
# Line 294 | Line 350 | bool Screen_blitter_init(XVisualInfo * v
350                          visualFormat.Rshift, visualFormat.Gshift, visualFormat.Bshift);
351                  abort();
352          }
353 + #else
354 +        // The UAE memory handlers will blit correctly
355 +        // --> no need for specialised blitters here
356 +        Screen_blit = Blit_Copy_Raw;
357 + #endif
358          
359          // If the blitter simply reduces to a copy, we don't need VOSF in DGA mode
360          // --> In that case, we return FALSE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines