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

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

unix.superglobalmegacorp.com

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