|
|
1.1 ! root 1: // Screen Conversion, Medium Res to 640x16Bit ! 2: ! 3: void ConvertMediumRes_640x16Bit_YLoop(void); ! 4: void Line_ConvertMediumRes_640x16Bit(void); ! 5: ! 6: void ConvertMediumRes_640x16Bit(void) ! 7: { ! 8: fprintf(stderr,"FIXME: Screen Conversion, Medium 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 ConvertMediumRes_640x16Bit_YLoop ! 23: } ! 24: */ ! 25: } ! 26: /* ! 27: NAKED void ConvertMediumRes_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: je Line_ConvertLowRes_640x16Bit // resolution change(MUST be first) ! 43: jmp Line_ConvertMediumRes_640x16Bit // 0 palette same, can do check tests ! 44: } ! 45: } ! 46: NAKED void Line_ConvertMediumRes_640x16Bit(void) ! 47: { ! 48: __asm { ! 49: mov eax,[STScreenWidthBytes] // Amount to draw across ! 50: shr eax,2 // in 16-pixels(4 bytes) ! 51: mov [ScrX],eax ! 52: x_loop: ! 53: #ifdef TEST_SCREEN_UPDATE ! 54: mov WORD PTR [esi+0],0 ! 55: mov WORD PTR [esi+4],0 ! 56: mov WORD PTR [esi+8],0 ! 57: mov WORD PTR [esi+12],0 ! 58: mov WORD PTR [esi+16],0 ! 59: mov WORD PTR [esi+20],0 ! 60: mov WORD PTR [esi+24],0 ! 61: mov WORD PTR [esi+28],0 ! 62: #endif //TEST_SCREEN_UPDATE ! 63: ! 64: // Do 16 pixels at one time ! 65: mov ebx,[edi] ! 66: // Full update? or just test changes? ! 67: test [ScrUpdateFlag],0xe0000000 ! 68: jne copy_word // Force ! 69: // Does differ? ! 70: cmp ebx,[ebp] ! 71: je next_word // Pixels are same as last frame, so ignore ! 72: ! 73: copy_word: ! 74: mov [bScreenContentsChanged],TRUE ! 75: ! 76: // Plot in 'wrong-order', as ebx is 68000 endian ! 77: cmp [bScrDoubleY],TRUE // Double on Y? ! 78: je double_y ! 79: ! 80: MED_BUILD_PIXELS_0 // Generate 'ecx' as pixels [4,5,6,7] ! 81: PLOT_MED_640_16BIT(8) ! 82: MED_BUILD_PIXELS_1 // Generate 'ecx' as pixels [12,13,14,15] ! 83: PLOT_MED_640_16BIT(24) ! 84: MED_BUILD_PIXELS_2 // Generate 'ecx' as pixels [0,1,2,3] ! 85: PLOT_MED_640_16BIT(0) ! 86: MED_BUILD_PIXELS_3 // Generate 'ecx' as pixels [8,9,10,11] ! 87: PLOT_MED_640_16BIT(16) ! 88: ! 89: jmp done_word ! 90: ! 91: double_y: ! 92: push ebp ! 93: mov ebp,[PCScreenBytesPerLine] ! 94: MED_BUILD_PIXELS_0 // Generate 'ecx' as pixels [4,5,6,7] ! 95: PLOT_MED_640_16BIT_DOUBLE_Y(8) ! 96: MED_BUILD_PIXELS_1 // Generate 'ecx' as pixels [12,13,14,15] ! 97: PLOT_MED_640_16BIT_DOUBLE_Y(24) ! 98: MED_BUILD_PIXELS_2 // Generate 'ecx' as pixels [0,1,2,3] ! 99: PLOT_MED_640_16BIT_DOUBLE_Y(0) ! 100: MED_BUILD_PIXELS_3 // Generate 'ecx' as pixels [8,9,10,11] ! 101: PLOT_MED_640_16BIT_DOUBLE_Y(16) ! 102: pop ebp ! 103: done_word: ! 104: ! 105: next_word: ! 106: add esi,16*2 // Next PC pixels ! 107: add edi,4 // Next ST pixels ! 108: add ebp,4 // Next ST copy pixels ! 109: ! 110: dec [ScrX] ! 111: jne x_loop // Loop on X ! 112: ! 113: mov eax,[pPCScreenDest] ! 114: add eax,[PCScreenBytesPerLine] // Offset to next line ! 115: add eax,[PCScreenBytesPerLine] ! 116: mov [pPCScreenDest],eax ! 117: ! 118: inc [ScrY] ! 119: mov eax,[STScreenEndHorizLine] ! 120: cmp [ScrY],eax ! 121: jne ConvertMediumRes_640x16Bit_YLoop // And on Y ! 122: ! 123: pop ebx ! 124: pop esi ! 125: pop edi ! 126: pop ebp ! 127: ! 128: ret ! 129: } ! 130: } ! 131: */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.