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

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

unix.superglobalmegacorp.com

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