|
|
1.1 root 1: // Screen Conversion, Low Res to 320x8Bit
2:
3: void ConvertLowRes_320x8Bit_YLoop(void);
4: void Line_ConvertLowRes_320x8Bit(void);
5:
6: void ConvertLowRes_320x8Bit(void)
7: {
8: fprintf(stderr,"FIXME: Screen Conversion, Low Res to 320x8Bit\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_320x8Bit_YLoop
23: }
24: */
25: }
26: /*
27: NAKED void ConvertLowRes_320x8Bit_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: jmp Line_ConvertLowRes_320x8Bit // 0 palette same, can do check tests
42: }
43: }
44: NAKED void Line_ConvertLowRes_320x8Bit(void)
45: {
46: __asm {
47: mov eax,[STScreenWidthBytes] // Amount to draw across
48: shr eax,3 // in 16-pixels(8 bytes)
49: mov [ScrX],eax
50: x_loop:
51: #ifdef TEST_SCREEN_UPDATE
52: mov BYTE PTR [esi+0],0
53: mov BYTE PTR [esi+2],0
54: mov BYTE PTR [esi+4],0
55: mov BYTE PTR [esi+6],0
56: mov BYTE PTR [esi+8],0
57: mov BYTE PTR [esi+10],0
58: mov BYTE PTR [esi+12],0
59: mov BYTE PTR [esi+14],0
60: #endif //TEST_SCREEN_UPDATE
61:
62: // Do 16 pixels at one time
63: mov ebx,[edi]
64: mov ecx,4[edi]
65: // Full update? or just test changes?
66: test [ScrUpdateFlag],0xe0000000
67: jne copy_word // Force
68: // Does differ?
69: cmp ebx,[ebp]
70: jne copy_word
71: cmp ecx,4[ebp]
72: je next_word // Pixels are same as last frame, so ignore
73:
74: copy_word:
75: mov [bScreenContentsChanged],TRUE
76:
77: // Plot pixels
78: LOW_BUILD_PIXELS_0 // Generate 'ecx' as pixels [4,5,6,7]
79: PLOT_LOW_320_8BIT(4)
80: LOW_BUILD_PIXELS_1 // Generate 'ecx' as pixels [12,13,14,15]
81: PLOT_LOW_320_8BIT(12)
82: LOW_BUILD_PIXELS_2 // Generate 'ecx' as pixels [0,1,2,3]
83: PLOT_LOW_320_8BIT(0)
84: LOW_BUILD_PIXELS_3 // Generate 'ecx' as pixels [8,9,10,11]
85: PLOT_LOW_320_8BIT(8)
86:
87: next_word:
88: add esi,16 // Next PC pixels
89: add edi,8 // Next ST pixels
90: add ebp,8 // Next ST copy pixels
91:
92: dec [ScrX]
93: jne x_loop // Loop on X
94:
95: mov eax,[pPCScreenDest]
96: add eax,[PCScreenBytesPerLine] // Offset to next line
97: mov [pPCScreenDest],eax
98:
99: inc [ScrY]
100: mov eax,[STScreenEndHorizLine]
101: cmp [ScrY],eax
102: jne ConvertLowRes_320x8Bit_YLoop // And on Y
103:
104: pop ebx
105: pop esi
106: pop edi
107: pop ebp
108:
109: ret
110: }
111: }
112: */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.