Annotation of hatari/src/convert/med640x8.c, revision 1.1.1.5

1.1.1.2   root        1: /*
                      2:   Hatari - med640x8.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.
1.1       root        6: 
1.1.1.2   root        7:   Screen conversion, Medium Res to 640x8Bit
                      8: */
1.1       root        9: 
1.1.1.3   root       10: static void ConvertMediumRes_640x8Bit(void)
1.1       root       11: {
1.1.1.5 ! root       12:        Uint32 *edi, *ebp;
        !            13:        Uint32 *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 = (Uint32 *)pPCScreenDest;                    /* PC format screen */
        !            26: 
        !            27:                if (AdjustLinePaletteRemap(y) & 0x00030000)       /* Change palette table */
        !            28:                        Line_ConvertMediumRes_640x8Bit(edi, ebp, esi, eax);
        !            29:                else
        !            30:                        Line_ConvertLowRes_640x8Bit(edi, ebp, esi, eax);
1.1.1.2   root       31: 
1.1.1.5 ! root       32:                pPCScreenDest = (((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine*2);  /* Offset to next line */
        !            33:        }
1.1       root       34: }
1.1.1.2   root       35: 
                     36: 
1.1.1.3   root       37: static void Line_ConvertMediumRes_640x8Bit(Uint32 *edi, Uint32 *ebp, Uint32 *esi, Uint32 eax)
1.1       root       38: {
1.1.1.5 ! root       39:        Uint32 ebx, ecx;
        !            40:        int x, update, Screen4BytesPerLine;
1.1.1.2   root       41: 
1.1.1.5 ! root       42:        x = STScreenWidthBytes >> 2;    /* Amount to draw across in 16-pixels (4 bytes) */
        !            43:        Screen4BytesPerLine = PCScreenBytesPerLine / 4;
        !            44:        update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK;
1.1       root       45: 
1.1.1.5 ! root       46:        do  /* x-loop */
        !            47:        {
1.1.1.2   root       48: 
1.1.1.5 ! root       49:                /* Do 16 pixels at one time */
        !            50:                ebx = *edi;
1.1.1.2   root       51: 
1.1.1.5 ! root       52:                if (update || ebx != *ebp)      /* Does differ? */
        !            53:                {
        !            54:                        /* copy word */
1.1.1.2   root       55: 
1.1.1.5 ! root       56:                        bScreenContentsChanged = TRUE;
1.1.1.2   root       57: 
                     58: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.5 ! root       59:                        /* Plot in 'right-order' on big endian systems */
        !            60:                        if (!bScrDoubleY)                   /* Double on Y? */
        !            61:                        {
        !            62:                                MED_BUILD_PIXELS_0 ;            /* Generate 'ecx' as pixels [4,5,6,7] */
        !            63:                                PLOT_MED_640_8BIT(3) ;
        !            64:                                MED_BUILD_PIXELS_1 ;            /* Generate 'ecx' as pixels [12,13,14,15] */
        !            65:                                PLOT_MED_640_8BIT(1) ;
        !            66:                                MED_BUILD_PIXELS_2 ;            /* Generate 'ecx' as pixels [0,1,2,3] */
        !            67:                                PLOT_MED_640_8BIT(2) ;
        !            68:                                MED_BUILD_PIXELS_3 ;            /* Generate 'ecx' as pixels [8,9,10,11] */
        !            69:                                PLOT_MED_640_8BIT(0) ;
        !            70:                        }
        !            71:                        else
        !            72:                        {
        !            73:                                MED_BUILD_PIXELS_0 ;            /* Generate 'ecx' as pixels [4,5,6,7] */
        !            74:                                PLOT_MED_640_8BIT_DOUBLE_Y(3) ;
        !            75:                                MED_BUILD_PIXELS_1 ;            /* Generate 'ecx' as pixels [12,13,14,15] */
        !            76:                                PLOT_MED_640_8BIT_DOUBLE_Y(1) ;
        !            77:                                MED_BUILD_PIXELS_2 ;            /* Generate 'ecx' as pixels [0,1,2,3] */
        !            78:                                PLOT_MED_640_8BIT_DOUBLE_Y(2) ;
        !            79:                                MED_BUILD_PIXELS_3 ;            /* Generate 'ecx' as pixels [8,9,10,11] */
        !            80:                                PLOT_MED_640_8BIT_DOUBLE_Y(0) ;
        !            81:                        }
1.1.1.2   root       82: #else
1.1.1.5 ! root       83:                        /* Plot in 'wrong-order', as ebx is 68000 endian */
        !            84:                        if (!bScrDoubleY)                   /* Double on Y? */
        !            85:                        {
        !            86:                                MED_BUILD_PIXELS_0 ;            /* Generate 'ecx' as pixels [4,5,6,7] */
        !            87:                                PLOT_MED_640_8BIT(1) ;
        !            88:                                MED_BUILD_PIXELS_1 ;            /* Generate 'ecx' as pixels [12,13,14,15] */
        !            89:                                PLOT_MED_640_8BIT(3) ;
        !            90:                                MED_BUILD_PIXELS_2 ;            /* Generate 'ecx' as pixels [0,1,2,3] */
        !            91:                                PLOT_MED_640_8BIT(0) ;
        !            92:                                MED_BUILD_PIXELS_3 ;            /* Generate 'ecx' as pixels [8,9,10,11] */
        !            93:                                PLOT_MED_640_8BIT(2) ;
        !            94:                        }
        !            95:                        else
        !            96:                        {
        !            97:                                MED_BUILD_PIXELS_0 ;            /* Generate 'ecx' as pixels [4,5,6,7] */
        !            98:                                PLOT_MED_640_8BIT_DOUBLE_Y(1) ;
        !            99:                                MED_BUILD_PIXELS_1 ;            /* Generate 'ecx' as pixels [12,13,14,15] */
        !           100:                                PLOT_MED_640_8BIT_DOUBLE_Y(3) ;
        !           101:                                MED_BUILD_PIXELS_2 ;            /* Generate 'ecx' as pixels [0,1,2,3] */
        !           102:                                PLOT_MED_640_8BIT_DOUBLE_Y(0) ;
        !           103:                                MED_BUILD_PIXELS_3 ;            /* Generate 'ecx' as pixels [8,9,10,11] */
        !           104:                                PLOT_MED_640_8BIT_DOUBLE_Y(2) ;
        !           105:                        }
1.1.1.2   root      106: #endif
1.1.1.5 ! root      107:                }
        !           108: 
        !           109:                esi += 4;                       /* Next PC pixels */
        !           110:                edi += 1;                       /* Next ST pixels */
        !           111:                ebp += 1;                       /* Next ST copy pixels */
1.1.1.2   root      112: 
1.1.1.5 ! root      113:        }
        !           114:        while (--x);                        /* Loop on X */
1.1       root      115: }

unix.superglobalmegacorp.com

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