Annotation of hatari/src/convert/low640x16.c, revision 1.1.1.3

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

unix.superglobalmegacorp.com

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