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

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.3 ! root        8:  Uint32 eax, ebx, ecx;
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 */
        !            21:      Line_ConvertLowRes_640x16Bit(edi, ebp, (Uint32 *)esi, eax, ebx, ecx);
        !            22:     else
        !            23:      Line_ConvertMediumRes_640x16Bit(edi, ebp, esi, eax, ebx, ecx);
        !            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: 
        !            33: void Line_ConvertMediumRes_640x16Bit(Uint32 *edi, Uint32 *ebp, Uint16 *esi, Uint32 eax, Uint32 ebx, Uint32 ecx)
1.1       root       34: {
1.1.1.2   root       35: 
1.1.1.3 ! root       36:    ScrX=STScreenWidthBytes>>2;   /* Amount to draw across in 16-pixels (4 bytes) */
1.1.1.2   root       37: 
                     38:    do    /* x-loop */
                     39:     {
                     40: 
                     41:      /* Do 16 pixels at one time */
                     42:      ebx=*edi;
1.1       root       43: 
1.1.1.3 ! root       44:      if( (ScrUpdateFlag&0xe0000000) || ebx!=*ebp )     /* Does differ? */
        !            45:       { /* copy word */
1.1.1.2   root       46: 
                     47:        bScreenContentsChanged=TRUE;
1.1       root       48: 
1.1.1.2   root       49: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
                     50:        /* Plot in 'right-order' on big endian systems */
                     51:        if( !bScrDoubleY )                  /* Double on Y? */
                     52:         {
                     53:          MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     54:          PLOT_MED_640_16BIT(12) ;
                     55:          MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                     56:          PLOT_MED_640_16BIT(4) ;
                     57:          MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                     58:          PLOT_MED_640_16BIT(8) ;
                     59:          MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                     60:          PLOT_MED_640_16BIT(0) ;
                     61:         }
                     62:         else
                     63:         {
                     64:          MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     65:          PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
                     66:          MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                     67:          PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
                     68:          MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                     69:          PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
                     70:          MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                     71:          PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
                     72:         }
                     73: #else
                     74:        /* Plot in 'wrong-order', as ebx is 68000 endian */
                     75:        if( !bScrDoubleY )                  /* Double on Y? */
                     76:         {
                     77:          MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     78:          PLOT_MED_640_16BIT(4) ;
                     79:          MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                     80:          PLOT_MED_640_16BIT(12) ;
                     81:          MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                     82:          PLOT_MED_640_16BIT(0) ;
                     83:          MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                     84:          PLOT_MED_640_16BIT(8) ;
                     85:         }
                     86:         else
                     87:         {
                     88:          MED_BUILD_PIXELS_0 ;              /* Generate 'ecx' as pixels [4,5,6,7] */
                     89:          PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
                     90:          MED_BUILD_PIXELS_1 ;              /* Generate 'ecx' as pixels [12,13,14,15] */
                     91:          PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
                     92:          MED_BUILD_PIXELS_2 ;              /* Generate 'ecx' as pixels [0,1,2,3] */
                     93:          PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
                     94:          MED_BUILD_PIXELS_3 ;              /* Generate 'ecx' as pixels [8,9,10,11] */
                     95:          PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
                     96:         }
                     97: #endif
                     98:       }
                     99: 
                    100:      esi += 16;                             /* Next PC pixels */
                    101:      edi += 1;                              /* Next ST pixels */
                    102:      ebp += 1;                              /* Next ST copy pixels */
                    103:     }
                    104:    while( --ScrX );                         /* Loop on X */
                    105: 
                    106: }

unix.superglobalmegacorp.com

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