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

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

unix.superglobalmegacorp.com

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