Annotation of hatari/src/convert/vdi2.c, revision 1.1

1.1     ! root        1: // Screen Conversion, VDI Res to 2Colour(1-Bit and 8-Bit)
        !             2: 
        !             3: void ConvertVDIRes_2Colour_1Bit(void)
        !             4: {
        !             5: fprintf(stderr,"FIXME: Screen Conversion, VDI Res to 2Colour(1-Bit and 8-Bit)\n");
        !             6:   // Copy palette to bitmap (2 colours)
        !             7: /* FIXME */
        !             8: /*
        !             9:   if (HBLPalettes[0]==0x777) {
        !            10:     ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0xff;
        !            11:     ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0x00;
        !            12:   }
        !            13:   else {
        !            14:     ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0x00;
        !            15:     ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0xff;
        !            16:   }
        !            17: */
        !            18:   // Simply copy ST screen, as same format!
        !            19:   memcpy(pPCScreenDest,pSTScreen,(VDIWidth/8)*VDIHeight);
        !            20: 
        !            21:   bScreenContentsChanged = TRUE;
        !            22: }
        !            23: 
        !            24: void ConvertVDIRes_2Colour_YLoop(void);
        !            25: void Line_ConvertVDIRes_2Colour(void);
        !            26: 
        !            27: void ConvertVDIRes_2Colour(void)
        !            28: {
        !            29: fprintf(stderr,"FIXME: Screen Conversion, VDI Res to 2Colour(1-Bit and 8-Bit)\n");/* FIXME */
        !            30: /*
        !            31:   __asm {
        !            32:     push  ebp
        !            33:     push  edi
        !            34:     push  esi
        !            35:     push  ebx
        !            36: 
        !            37:     xor    edx,edx                  // Clear index for loop
        !            38: 
        !            39:     mov    eax,0
        !            40:     mov    [ScrY],eax                // Starting line in ST screen
        !            41: 
        !            42:     // Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen
        !            43:     mov    edi,[pSTScreen]              // ST format screen 4-plane 16 colours
        !            44:     mov    ebp,[pSTScreenCopy]            // Previous ST format screen
        !            45:     mov    esi,[pPCScreenDest]            // PC format screen, byte per pixel 256 colours
        !            46: 
        !            47:     jmp    ConvertVDIRes_2Colour_YLoop
        !            48:   }
        !            49: */
        !            50: }
        !            51: /*
        !            52: NAKED void ConvertVDIRes_2Colour_YLoop(void)
        !            53: {
        !            54:   __asm {
        !            55:     // Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen
        !            56:     mov    esi,[pPCScreenDest]            // PC format screen, byte per pixel 256 colours
        !            57: 
        !            58:     jmp    Line_ConvertVDIRes_2Colour      // 0 palette same, can do check tests
        !            59:   }
        !            60: }
        !            61: NAKED void Line_ConvertVDIRes_2Colour(void)
        !            62: {
        !            63:   __asm {
        !            64:     mov    eax,[VDIWidth]              // Amount to draw across
        !            65:     shr    eax,4                  // in 16-pixels(4 bytes)
        !            66:     mov    [ScrX],eax
        !            67: x_loop:
        !            68:     // Do 16 pixels at one time
        !            69:     mov    bx,[edi]
        !            70:     // Full update? or just test changes?
        !            71:     test  [ScrUpdateFlag],0xe0000000
        !            72:     jne    copy_word                // Force
        !            73:     // Does differ?
        !            74:     cmp    bx,[ebp]
        !            75:     je    next_word                // Pixels are same as last frame, so ignore
        !            76: 
        !            77: copy_word:
        !            78:     mov    [bScreenContentsChanged],TRUE
        !            79: 
        !            80:     // Plot in 'wrong-order', as ebx is 68000 endian
        !            81:     HIGH_BUILD_PIXELS_0                // Generate 'ecx' as pixels [4,5,6,7]
        !            82:     PLOT_HIGH_640_8BIT(4)
        !            83:     HIGH_BUILD_PIXELS_1                // Generate 'ecx' as pixels [0,1,2,3]
        !            84:     PLOT_HIGH_640_8BIT(0)
        !            85:     HIGH_BUILD_PIXELS_2                // Generate 'ecx' as pixels [12,13,14,15]
        !            86:     PLOT_HIGH_640_8BIT(12)
        !            87:     HIGH_BUILD_PIXELS_3                // Generate 'ecx' as pixels [8,9,10,11]
        !            88:     PLOT_HIGH_640_8BIT(8)
        !            89: 
        !            90: next_word:
        !            91:     add    esi,16                  // Next PC pixels
        !            92:     add    edi,2                  // Next ST pixels
        !            93:     add    ebp,2                  // Next ST copy pixels
        !            94: 
        !            95:     dec    [ScrX]
        !            96:     jne    x_loop                  // Loop on X
        !            97: 
        !            98:     mov    eax,[pPCScreenDest]
        !            99:     add    eax,[PCScreenBytesPerLine]        // Offset to next line
        !           100:     mov    [pPCScreenDest],eax
        !           101:     
        !           102:     inc    [ScrY]
        !           103:     mov    eax,[VDIHeight]
        !           104:     cmp    [ScrY],eax
        !           105:     jne    ConvertVDIRes_2Colour_YLoop      // And on Y
        !           106: 
        !           107:     pop    ebx
        !           108:     pop    esi
        !           109:     pop    edi
        !           110:     pop    ebp
        !           111: 
        !           112:     ret
        !           113:   }
        !           114: }
        !           115: */

unix.superglobalmegacorp.com

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