Annotation of hatari/src/convert/med640x16.c, revision 1.1.1.9

1.1.1.7   root        1: /*
                      2:   Hatari - low320x8.c
1.1       root        3: 
1.1.1.7   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, Medium Res to 640x16Bit
                      8: */
1.1.1.3   root        9: 
1.1.1.5   root       10: static void ConvertMediumRes_640x16Bit(void)
1.1       root       11: {
1.1.1.7   root       12:        Uint32 *edi, *ebp;
                     13:        Uint16 *esi;
                     14:        Uint32 eax;
                     15:        int y;
                     16: 
                     17:        Convert_StartFrame();            /* Start frame, track palettes */
                     18: 
                     19:        for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++)
                     20:        {
                     21: 
                     22:                eax = STScreenLineOffset[y] + STScreenLeftSkipBytes;  /* Offset for this line + Amount to skip on left hand side */
                     23:                edi = (Uint32 *)((Uint8 *)pSTScreen + eax);        /* ST format screen 4-plane 16 colors */
                     24:                ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax);    /* Previous ST format screen */
                     25:                esi = (Uint16 *)pPCScreenDest;                     /* PC format screen */
                     26: 
                     27:                if (AdjustLinePaletteRemap(y) & 0x00030000)        /* Change palette table */
                     28:                        Line_ConvertMediumRes_640x16Bit(edi, ebp, esi, eax);
                     29:                else
                     30:                        Line_ConvertLowRes_640x16Bit(edi, ebp, (Uint32 *)esi, eax);
                     31: 
                     32:                /* Offset to next line */
                     33:                pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine * 2);
                     34:        }
1.1       root       35: }
1.1.1.3   root       36: 
                     37: 
1.1.1.5   root       38: static void Line_ConvertMediumRes_640x16Bit(Uint32 *edi, Uint32 *ebp, Uint16 *esi, Uint32 eax)
1.1       root       39: {
1.1.1.7   root       40:        Uint32 ebx, ecx;
                     41:        int x, update, Screen2BytesPerLine;
1.1.1.2   root       42: 
1.1.1.7   root       43:        x = STScreenWidthBytes >> 2;   /* Amount to draw across in 16-pixels (4 bytes) */
                     44:        Screen2BytesPerLine = PCScreenBytesPerLine/2;
                     45:        update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK;
1.1.1.2   root       46: 
1.1.1.7   root       47:        do  /* x-loop */
                     48:        {
1.1.1.2   root       49: 
1.1.1.7   root       50:                /* Do 16 pixels at one time */
                     51:                ebx = *edi;
1.1       root       52: 
1.1.1.7   root       53:                if (update || ebx != *ebp)      /* Does differ? */
                     54:                {
                     55:                        /* copy word */
1.1.1.2   root       56: 
1.1.1.8   root       57:                        bScreenContentsChanged = true;
1.1       root       58: 
1.1.1.2   root       59: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.7   root       60:                        /* Plot in 'right-order' on big endian systems */
                     61:                        if (!bScrDoubleY)                     /* Double on Y? */
                     62:                        {
1.1.1.9 ! root       63:                                MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.7   root       64:                                PLOT_MED_640_16BIT(12) ;
1.1.1.9 ! root       65:                                MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.7   root       66:                                PLOT_MED_640_16BIT(4) ;
1.1.1.9 ! root       67:                                MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.7   root       68:                                PLOT_MED_640_16BIT(8) ;
1.1.1.9 ! root       69:                                MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.7   root       70:                                PLOT_MED_640_16BIT(0) ;
                     71:                        }
                     72:                        else
                     73:                        {
1.1.1.9 ! root       74:                                MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.7   root       75:                                PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
1.1.1.9 ! root       76:                                MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.7   root       77:                                PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
1.1.1.9 ! root       78:                                MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.7   root       79:                                PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
1.1.1.9 ! root       80:                                MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.7   root       81:                                PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
                     82:                        }
1.1.1.2   root       83: #else
1.1.1.7   root       84:                        /* Plot in 'wrong-order', as ebx is 68000 endian */
                     85:                        if (!bScrDoubleY)                     /* Double on Y? */
                     86:                        {
                     87:                                MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     88:                                PLOT_MED_640_16BIT(4) ;
                     89:                                MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                     90:                                PLOT_MED_640_16BIT(12) ;
                     91:                                MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                     92:                                PLOT_MED_640_16BIT(0) ;
                     93:                                MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                     94:                                PLOT_MED_640_16BIT(8) ;
                     95:                        }
                     96:                        else
                     97:                        {
                     98:                                MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     99:                                PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
                    100:                                MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                    101:                                PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
                    102:                                MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                    103:                                PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
                    104:                                MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                    105:                                PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
                    106:                        }
1.1.1.2   root      107: #endif
1.1.1.7   root      108:                }
1.1.1.2   root      109: 
1.1.1.7   root      110:                esi += 16;                      /* Next PC pixels */
                    111:                edi += 1;                       /* Next ST pixels */
                    112:                ebp += 1;                       /* Next ST copy pixels */
                    113:        }
                    114:        while (--x);                        /* Loop on X */
1.1.1.2   root      115: 
                    116: }

unix.superglobalmegacorp.com

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