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

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

unix.superglobalmegacorp.com

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