Annotation of hatari/src/convert/vdi2.c, revision 1.1.1.2

1.1.1.2 ! root        1: /* Screen Conversion, VDI Res to 2Colour (1-Bit and 8-Bit) */
1.1       root        2: 
1.1.1.2 ! root        3: #if 0  /* Currently unused */
1.1       root        4: void ConvertVDIRes_2Colour_1Bit(void)
                      5: {
1.1.1.2 ! root        6:   /* Copy palette to bitmap (2 colours) */
        !             7: 
1.1       root        8:   if (HBLPalettes[0]==0x777) {
                      9:     ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0xff;
                     10:     ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0x00;
                     11:   }
                     12:   else {
                     13:     ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0x00;
                     14:     ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0xff;
                     15:   }
1.1.1.2 ! root       16: 
        !            17:   /* Simply copy ST screen, as same format! */
1.1       root       18:   memcpy(pPCScreenDest,pSTScreen,(VDIWidth/8)*VDIHeight);
                     19: 
                     20:   bScreenContentsChanged = TRUE;
                     21: }
1.1.1.2 ! root       22: #endif
1.1       root       23: 
                     24: 
                     25: void ConvertVDIRes_2Colour(void)
                     26: {
1.1.1.2 ! root       27:   Uint16 *edi, *ebp;
        !            28:   Uint32 *esi;
        !            29:   register Uint16 eax, ebx;
        !            30: 
        !            31:   ScrY = 0;                             /* Starting line in ST screen */
        !            32: 
        !            33:   edi = (Uint16 *)pSTScreen;            /* ST format screen */
        !            34:   ebp = (Uint16 *)pSTScreenCopy;        /* Previous ST format screen */
        !            35: 
        !            36:   do      /* y-loop */
        !            37:   {
        !            38:     esi = (Uint32 *)pPCScreenDest;      /* PC format screen, byte per pixel 256 colours */
        !            39: 
        !            40:     ScrX = VDIWidth >> 4;               /* Amount to draw across in 16-pixels (4 bytes) */
        !            41: 
        !            42:     do          /* x-loop */
        !            43:     {
        !            44:       /* Do 16 pixels at one time */
        !            45:       ebx = *edi;
        !            46: 
        !            47:       if( (ScrUpdateFlag&0xe0000000) || ebx!=*ebp )  /* Does differ? */
        !            48:       {
        !            49:         bScreenContentsChanged = TRUE;
        !            50: 
        !            51: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
        !            52:         /* Plot in 'right-order' on big endian systems */
        !            53:         HIGH_BUILD_PIXELS_0 ;           /* Generate pixels [4,5,6,7] */
        !            54:         PLOT_HIGH_640_8BIT(3) ;
        !            55:         HIGH_BUILD_PIXELS_1 ;           /* Generate pixels [0,1,2,3] */
        !            56:         PLOT_HIGH_640_8BIT(2) ;
        !            57:         HIGH_BUILD_PIXELS_2 ;           /* Generate pixels [12,13,14,15] */
        !            58:         PLOT_HIGH_640_8BIT(1) ;
        !            59:         HIGH_BUILD_PIXELS_3 ;           /* Generate pixels [8,9,10,11] */
        !            60:         PLOT_HIGH_640_8BIT(0) ;
        !            61: #else
        !            62:         /* Plot in 'wrong-order', as ebx is 68000 endian */
        !            63:         HIGH_BUILD_PIXELS_0 ;           /* Generate pixels [4,5,6,7] */
        !            64:         PLOT_HIGH_640_8BIT(1) ;
        !            65:         HIGH_BUILD_PIXELS_1 ;           /* Generate pixels [0,1,2,3] */
        !            66:         PLOT_HIGH_640_8BIT(0) ;
        !            67:         HIGH_BUILD_PIXELS_2 ;           /* Generate pixels [12,13,14,15] */
        !            68:         PLOT_HIGH_640_8BIT(3) ;
        !            69:         HIGH_BUILD_PIXELS_3 ;           /* Generate pixels [8,9,10,11] */
        !            70:         PLOT_HIGH_640_8BIT(2) ;
        !            71: #endif
        !            72:       }
        !            73: 
        !            74:       esi += 4;                         /* Next PC pixels */
        !            75:       edi += 1;                         /* Next ST pixels */
        !            76:       ebp += 1;                         /* Next ST copy pixels */
        !            77:     }
        !            78:     while( --ScrX );                    /* Loop on X */
1.1       root       79: 
1.1.1.2 ! root       80:     pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine);  /* Offset to next line */
1.1       root       81: 
1.1.1.2 ! root       82:     ScrY += 1;
1.1       root       83:   }
1.1.1.2 ! root       84:   while( ScrY < VDIHeight );            /* Loop on Y */
1.1       root       85: 
                     86: }
1.1.1.2 ! root       87: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.