|
|
1.1 root 1: // Screen Conversion, High Res to 640x8Bit
2:
3: void ConvertHighRes_640x8Bit_YLoop(void);
4: void Line_ConvertHighRes_640x8Bit(void);
5:
6: void ConvertHighRes_640x8Bit(void)
7: {
8: //fprintf(stderr,"FIXME: Screen Conversion, High Res to 640x8Bit\n");
9: unsigned char *src=pSTScreen;
10: unsigned char *dst=pPCScreenDest;
11: int i;
12: for(i=0; i<640*400/8; i++, src++)
13: {
14: if( *src & 128 ) *dst++ = 0; else *dst++ = 1;
15: if( *src & 64 ) *dst++ = 0; else *dst++ = 1;
16: if( *src & 32 ) *dst++ = 0; else *dst++ = 1;
17: if( *src & 16 ) *dst++ = 0; else *dst++ = 1;
18: if( *src & 8 ) *dst++ = 0; else *dst++ = 1;
19: if( *src & 4 ) *dst++ = 0; else *dst++ = 1;
20: if( *src & 2 ) *dst++ = 0; else *dst++ = 1;
21: if( *src & 1 ) *dst++ = 0; else *dst++ = 1;
22: }
23: bScreenContentsChanged = TRUE;
24: /* FIXME */
25: /*
26: __asm {
27: push ebp
28: push edi
29: push esi
30: push ebx
31:
32: mov edi,[pSTScreen] // ST format screen 4-plane 16 colours
33: mov ebp,[pSTScreenCopy] // Previous ST format screen
34: mov esi,[pPCScreenDest] // PC format screen, byte per pixel 256 colours
35: xor edx,edx // Clear index for loop
36:
37: mov eax,[STScreenStartHorizLine]
38: mov [ScrY],eax // 200 lines
39: jmp ConvertHighRes_640x8Bit_YLoop
40: }
41: */
42: }
43:
44: /*
45: NAKED void ConvertHighRes_640x8Bit_YLoop(void)
46: {
47: __asm {
48: // NOTE 'ScrUpdateFlag' is already set(to full update or check, no palettes)
49: jmp Line_ConvertHighRes_640x8Bit // 0 palette same, can do check tests
50: }
51: }
52: NAKED void Line_ConvertHighRes_640x8Bit(void)
53: {
54: __asm {
55: mov [ScrX],40
56: x_loop:
57: // Do 16 pixels at one time
58: mov bx,[edi]
59: // Full update? or just test changes?
60: test [ScrUpdateFlag],0xe0000000
61: jne copy_word // Force
62: // Does differ?
63: cmp bx,[ebp]
64: je next_word // Pixels are same as last frame, so ignore
65:
66: copy_word:
67: mov [bScreenContentsChanged],TRUE
68:
69: // Plot in 'wrong-order', as ebx is 68000 endian
70: HIGH_BUILD_PIXELS_0 // Generate 'ecx' as pixels [4,5,6,7]
71: PLOT_HIGH_640_8BIT(4)
72: HIGH_BUILD_PIXELS_1 // Generate 'ecx' as pixels [0,1,2,3]
73: PLOT_HIGH_640_8BIT(0)
74: HIGH_BUILD_PIXELS_2 // Generate 'ecx' as pixels [12,13,14,15]
75: PLOT_HIGH_640_8BIT(12)
76: HIGH_BUILD_PIXELS_3 // Generate 'ecx' as pixels [8,9,10,11]
77: PLOT_HIGH_640_8BIT(8)
78:
79: next_word:
80: add esi,16 // Next PC pixels
81: add edi,2 // Next ST pixels
82: add ebp,2 // Next ST copy pixels
83:
84: dec [ScrX]
85: jne x_loop // Loop on X
86:
87: sub esi,(40*16) // Back to start of line
88: add esi,[PCScreenBytesPerLine] // Offset to next line
89:
90: inc [ScrY]
91: mov eax,[STScreenEndHorizLine]
92: cmp [ScrY],eax
93: jne ConvertHighRes_640x8Bit_YLoop // And on Y
94:
95: pop ebx
96: pop esi
97: pop edi
98: pop ebp
99:
100: ret
101: }
102: }
103: */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.