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.15 by gbeauche, 2005-01-19T20:27:14Z vs.
Revision 1.18 by gbeauche, 2005-04-02T09:56:12Z

# Line 1 | Line 1
1   /*
2   *  video_blit.cpp - Video/graphics emulation, blitters
3   *
4 < *  Basilisk II (C) 1997-2004 Christian Bauer
4 > *  Basilisk II (C) 1997-2005 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 302 | Line 302 | static void Blit_Copy_Raw(uint8 * dest,
302   #include "video_blit.h"
303  
304   /* -------------------------------------------------------------------------- */
305 < /* --- 1/2/4-bit indexed to 8-bit mode conversion                           --- */
305 > /* --- 1/2/4-bit indexed to 8-bit mode conversion                         --- */
306   /* -------------------------------------------------------------------------- */
307  
308   static void Blit_Expand_1_To_8(uint8 * dest, const uint8 * p, uint32 length)
# Line 344 | Line 344 | static void Blit_Expand_4_To_8(uint8 * d
344   }
345  
346   /* -------------------------------------------------------------------------- */
347 < /* --- 2/4/8-bit indexed to 16-bit mode color expansion                   --- */
347 > /* --- 1/2/4/8-bit indexed to 16-bit mode color expansion                 --- */
348   /* -------------------------------------------------------------------------- */
349  
350 + static void Blit_Expand_1_To_16(uint8 * dest, const uint8 * p, uint32 length)
351 + {
352 +        uint16 *q = (uint16 *)dest;
353 +        for (uint32 i=0; i<length; i++) {
354 +                uint8 c = *p++;
355 +                *q++ = -(c >> 7);
356 +                *q++ = -((c >> 6) & 1);
357 +                *q++ = -((c >> 5) & 1);
358 +                *q++ = -((c >> 4) & 1);
359 +                *q++ = -((c >> 3) & 1);
360 +                *q++ = -((c >> 2) & 1);
361 +                *q++ = -((c >> 1) & 1);
362 +                *q++ = -(c & 1);
363 +        }
364 + }
365 +
366   static void Blit_Expand_2_To_16(uint8 * dest, const uint8 * p, uint32 length)
367   {
368          uint16 *q = (uint16 *)dest;
# Line 377 | Line 393 | static void Blit_Expand_8_To_16(uint8 *
393   }
394  
395   /* -------------------------------------------------------------------------- */
396 < /* --- 2/4/8-bit indexed to 32-bit mode color expansion                   --- */
396 > /* --- 1/2/4/8-bit indexed to 32-bit mode color expansion                 --- */
397   /* -------------------------------------------------------------------------- */
398  
399 + static void Blit_Expand_1_To_32(uint8 * dest, const uint8 * p, uint32 length)
400 + {
401 +        uint32 *q = (uint32 *)dest;
402 +        for (uint32 i=0; i<length; i++) {
403 +                uint8 c = *p++;
404 +                *q++ = -(c >> 7);
405 +                *q++ = -((c >> 6) & 1);
406 +                *q++ = -((c >> 5) & 1);
407 +                *q++ = -((c >> 4) & 1);
408 +                *q++ = -((c >> 3) & 1);
409 +                *q++ = -((c >> 2) & 1);
410 +                *q++ = -((c >> 1) & 1);
411 +                *q++ = -(c & 1);
412 +        }
413 + }
414 +
415   static void Blit_Expand_2_To_32(uint8 * dest, const uint8 * p, uint32 length)
416   {
417          uint32 *q = (uint32 *)dest;
# Line 466 | Line 498 | bool Screen_blitter_init(VisualFormat co
498          const bool use_sdl_video = false;
499   #endif
500   #if REAL_ADDRESSING || DIRECT_ADDRESSING
501 <        if (!use_sdl_video && mac_depth == 1) {
501 >        if (mac_depth == 1 && !use_sdl_video && !visual_format.fullscreen) {
502  
503 <                // 1-bit mode uses a 1-bit X image, so there's no need for special blitting routines
503 >                // Windowed 1-bit mode uses a 1-bit X image, so there's no need for special blitting routines
504                  Screen_blit = Blit_Copy_Raw;
505  
506          } else {
# Line 498 | Line 530 | bool Screen_blitter_init(VisualFormat co
530                  case 15:
531                  case 16:
532                          switch (mac_depth) {
533 +                        case 1: Screen_blit = Blit_Expand_1_To_16; break;
534                          case 2: Screen_blit = Blit_Expand_2_To_16; break;
535                          case 4: Screen_blit = Blit_Expand_4_To_16; break;
536                          case 8: Screen_blit = Blit_Expand_8_To_16; break;
# Line 506 | Line 539 | bool Screen_blitter_init(VisualFormat co
539                  case 24:
540                  case 32:
541                          switch (mac_depth) {
542 +                        case 1: Screen_blit = Blit_Expand_1_To_32; break;
543                          case 2: Screen_blit = Blit_Expand_2_To_32; break;
544                          case 4: Screen_blit = Blit_Expand_4_To_32; break;
545                          case 8: Screen_blit = Blit_Expand_8_To_32; break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines