Annotation of hatari/src/convert/low320x8.c, revision 1.1.1.7

1.1       root        1: /*
1.1.1.2   root        2:   Hatari - low320x8.c
1.1.1.5   root        3: 
1.1.1.2   root        4:   This file is distributed under the GNU Public License, version 2 or at your
                      5:   option any later version. Read the file gpl.txt for details.
                      6: 
                      7:   Screen conversion function, Low Res to 320x8Bit
1.1       root        8: */
                      9: 
1.1.1.3   root       10: static void ConvertLowRes_320x8Bit(void)
1.1       root       11: {
1.1.1.5   root       12:        Uint32 *edi, *ebp;
                     13:        Uint32 *esi;
                     14:        Uint32 eax, edx;
                     15:        Uint32 ebx, ecx;
                     16:        int y, x, update;
                     17: 
                     18:        edx = 0;
1.1.1.2   root       19: 
1.1.1.5   root       20:        Convert_StartFrame();             /* Start frame, track palettes */
1.1.1.2   root       21: 
1.1.1.5   root       22:        for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++)
                     23:        {
1.1.1.2   root       24: 
1.1.1.5   root       25:                /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen */
                     26:                eax = STScreenLineOffset[y] + STScreenLeftSkipBytes;  /* Offset for this line + Amount to skip on left hand side */
                     27:                edi = (Uint32 *)((Uint8 *)pSTScreen + eax);       /* ST format screen 4-plane 16 colors */
                     28:                ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax);   /* Previous ST format screen */
                     29:                esi = (Uint32 *)pPCScreenDest;                    /* PC format screen, byte per pixel 256 colors */
1.1.1.3   root       30: 
1.1.1.5   root       31:                update = AdjustLinePaletteRemap(y) & PALETTEMASK_UPDATEMASK;
1.1.1.2   root       32: 
1.1.1.5   root       33:                x = STScreenWidthBytes>>3;   /* Amount to draw across in 16-pixels(8 bytes) */
1.1.1.2   root       34: 
1.1.1.5   root       35:                do    /* x-loop */
                     36:                {
                     37:                        /* Do 16 pixels at one time */
                     38:                        ebx = *edi;
                     39:                        ecx = *(edi+1);
1.1.1.2   root       40: 
1.1.1.5   root       41:                        if (update || ebx!=*ebp || ecx!=*(ebp+1)) /* Does differ? */
                     42:                        {
                     43:                                /* copy word */
1.1.1.2   root       44: 
1.1.1.6   root       45:                                bScreenContentsChanged = true;
1.1.1.2   root       46: 
                     47: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.5   root       48:                                /* Plot pixels */
1.1.1.7 ! root       49:                                LOW_BUILD_PIXELS_0 ;    /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.5   root       50:                                PLOT_LOW_320_8BIT(3) ;
1.1.1.7 ! root       51:                                LOW_BUILD_PIXELS_1 ;    /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.5   root       52:                                PLOT_LOW_320_8BIT(1) ;
1.1.1.7 ! root       53:                                LOW_BUILD_PIXELS_2 ;    /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.5   root       54:                                PLOT_LOW_320_8BIT(2) ;
1.1.1.7 ! root       55:                                LOW_BUILD_PIXELS_3 ;    /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.5   root       56:                                PLOT_LOW_320_8BIT(0) ;
1.1.1.2   root       57: #else
1.1.1.5   root       58:                                /* Plot pixels */
                     59:                                LOW_BUILD_PIXELS_0 ;    /* Generate 'ecx' as pixels [4,5,6,7] */
                     60:                                PLOT_LOW_320_8BIT(1) ;
                     61:                                LOW_BUILD_PIXELS_1 ;    /* Generate 'ecx' as pixels [12,13,14,15] */
                     62:                                PLOT_LOW_320_8BIT(3) ;
                     63:                                LOW_BUILD_PIXELS_2 ;    /* Generate 'ecx' as pixels [0,1,2,3] */
                     64:                                PLOT_LOW_320_8BIT(0) ;
                     65:                                LOW_BUILD_PIXELS_3 ;    /* Generate 'ecx' as pixels [8,9,10,11] */
                     66:                                PLOT_LOW_320_8BIT(2) ;
1.1.1.2   root       67: #endif
1.1.1.5   root       68:                        }
1.1.1.2   root       69: 
1.1.1.5   root       70:                        esi += 4;                 /* Next PC pixels */
                     71:                        edi += 2;                 /* Next ST pixels */
                     72:                        ebp += 2;                 /* Next ST copy pixels */
                     73:                }
                     74:                while (--x);             /* Loop on X */
1.1       root       75: 
1.1.1.5   root       76:                pPCScreenDest = (((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine);  /* Offset to next line */
                     77:        }
1.1       root       78: }

unix.superglobalmegacorp.com

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