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

1.1       root        1: // Screen Conversion, Low Res to 640x16Bit
                      2: 
                      3: void ConvertLowRes_640x16Bit_YLoop(void);
                      4: void Line_ConvertLowRes_640x16Bit(void);
                      5: 
                      6: void ConvertLowRes_640x16Bit(void)
                      7: {
                      8: fprintf(stderr,"FIXME: Screen Conversion, Low Res to 640x16Bit\n");
                      9: /* FIXME */
                     10: /*
                     11:   __asm {
                     12:     push  ebp
                     13:     push  edi
                     14:     push  esi
                     15:     push  ebx
                     16: 
                     17:     xor    edx,edx                  // Clear index for loop
                     18: 
                     19:     call  Convert_StartFrame            // Start frame, track palettes
                     20:     mov    eax,[STScreenStartHorizLine]
                     21:     mov    [ScrY],eax                // Starting line in ST screen
                     22:     jmp    ConvertLowRes_640x16Bit_YLoop
                     23:   }
                     24: */
                     25: }
                     26: /*
                     27: NAKED void ConvertLowRes_640x16Bit_YLoop(void)
                     28: {
                     29:   __asm {
                     30:     // Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen
                     31:     mov    eax,[ScrY]
                     32:     mov    eax,STScreenLineOffset[eax*4]      // Offset for this line
                     33:     add    eax,[STScreenLeftSkipBytes]        // Amount to skip on left hand side
                     34:     mov    edi,[pSTScreen]              // ST format screen 4-plane 16 colours
                     35:     add    edi,eax
                     36:     mov    ebp,[pSTScreenCopy]            // Previous ST format screen
                     37:     add    ebp,eax
                     38:     mov    esi,[pPCScreenDest]            // PC format screen, byte per pixel 256 colours
                     39: 
                     40:     call  AdjustLinePaletteRemap          // Change palette table, DO NOT corrupt edx,edi,esi or ebp!
                     41:     test  eax,0x00030000
                     42:     jne    Line_ConvertMediumRes_640x16Bit      // resolution change(MUST be first)
                     43:     jmp    Line_ConvertLowRes_640x16Bit      // 0 palette same, can do check tests
                     44:   }
                     45: }
                     46: NAKED void Line_ConvertLowRes_640x16Bit(void)
                     47: {
                     48:   __asm {
                     49:     mov    eax,[STScreenWidthBytes]        // Amount to draw across
                     50:     shr    eax,3                  // in 16-pixels(8 bytes)
                     51:     mov    [ScrX],eax
                     52: x_loop:
                     53: #ifdef TEST_SCREEN_UPDATE
                     54:     mov    DWORD PTR [esi+0],0
                     55:     mov    DWORD PTR [esi+8],0
                     56:     mov    DWORD PTR [esi+16],0
                     57:     mov    DWORD PTR [esi+24],0
                     58:     mov    DWORD PTR [esi+32],0
                     59:     mov    DWORD PTR [esi+40],0
                     60:     mov    DWORD PTR [esi+48],0
                     61:     mov    DWORD PTR [esi+56],0
                     62: #endif  //TEST_SCREEN_UPDATE
                     63: 
                     64:     // Do 16 pixels at one time
                     65:     mov    ebx,[edi]
                     66:     mov    ecx,4[edi]
                     67:     // Full update? or just test changes?
                     68:     test  [ScrUpdateFlag],0xe0000000
                     69:     jne    copy_word                // Force
                     70:     // Does differ?
                     71:     cmp    ebx,[ebp]
                     72:     jne    copy_word
                     73:     cmp    ecx,4[ebp]
                     74:     je    next_word                // Pixels are same as last frame, so ignore
                     75: 
                     76: copy_word:
                     77:     mov    [bScreenContentsChanged],TRUE
                     78: 
                     79:     // Double up on Y?
                     80:     cmp    [bScrDoubleY],TRUE
                     81:     je    double_y
                     82: 
                     83:     // Plot pixels
                     84:     LOW_BUILD_PIXELS_0                // Generate 'ecx' as pixels [4,5,6,7]
                     85:     PLOT_LOW_640_16BIT(16)
                     86:     LOW_BUILD_PIXELS_1                // Generate 'ecx' as pixels [12,13,14,15]
                     87:     PLOT_LOW_640_16BIT(48)
                     88:     LOW_BUILD_PIXELS_2                // Generate 'ecx' as pixels [0,1,2,3]
                     89:     PLOT_LOW_640_16BIT(0)
                     90:     LOW_BUILD_PIXELS_3                // Generate 'ecx' as pixels [8,9,10,11]
                     91:     PLOT_LOW_640_16BIT(32)
                     92: 
                     93:     jmp    done_word
                     94: 
                     95: double_y:
                     96:     push  ebp
                     97:     mov    ebp,[PCScreenBytesPerLine]
                     98:     // Plot pixels
                     99:     LOW_BUILD_PIXELS_0                // Generate 'ecx' as pixels [4,5,6,7]
                    100:     PLOT_LOW_640_16BIT_DOUBLE_Y(16)
                    101:     LOW_BUILD_PIXELS_1                // Generate 'ecx' as pixels [12,13,14,15]
                    102:     PLOT_LOW_640_16BIT_DOUBLE_Y(48)
                    103:     LOW_BUILD_PIXELS_2                // Generate 'ecx' as pixels [0,1,2,3]
                    104:     PLOT_LOW_640_16BIT_DOUBLE_Y(0)
                    105:     LOW_BUILD_PIXELS_3                // Generate 'ecx' as pixels [8,9,10,11]
                    106:     PLOT_LOW_640_16BIT_DOUBLE_Y(32)
                    107:     pop    ebp
                    108: done_word:
                    109: 
                    110: next_word:
                    111:     add    esi,16*4                // Next PC pixels
                    112:     add    edi,8                  // Next ST pixels
                    113:     add    ebp,8                  // Next ST copy pixels
                    114: 
                    115:     dec    [ScrX]
                    116:     jne    x_loop                  // Loop on X
                    117: 
                    118:     mov    eax,[pPCScreenDest]
                    119:     add    eax,[PCScreenBytesPerLine]        // Offset to next line
                    120:     add    eax,[PCScreenBytesPerLine]
                    121:     mov    [pPCScreenDest],eax
                    122: 
                    123:     inc    [ScrY]
                    124:     mov    eax,[STScreenEndHorizLine]
                    125:     cmp    [ScrY],eax
                    126:     jne    ConvertLowRes_640x16Bit_YLoop      // And on Y
                    127: 
                    128:     pop    ebx
                    129:     pop    esi
                    130:     pop    edi
                    131:     pop    ebp
                    132: 
                    133:     ret
                    134:   }
                    135: }
                    136: */

unix.superglobalmegacorp.com

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