6 ;============================================================================
8 ; unwound vertical scaling code
10 ; eax light table pointer, 0 lowbyte overwritten
11 ; ebx all 0, low byte overwritten
12 ; ecx fractional step value
13 ; edx fractional scale value
14 ; esi start of source pixels
15 ; edi bottom pixel in screenbuffer to blit into
17 ; ebx should be set to 0 0 0 dh to feed the pipeline
19 ; The graphics wrap vertically at 128 pixels
20 ;============================================================================
26 SCALEDEFINE MACRO number
39 ;=================================
56 mov edi,[_ylookup+ebx*4]
58 add edi,[_columnofs + ebx*4]
61 sub ebp,eax ; ebp = pixel count
69 mov edx,[_dc_texturemid]
71 shl edx,9 ; 7 significant bits, 25 frac
73 shl ecx,9 ; 7 significant bits, 25 frac
76 mov eax,[_dc_colormap]
79 shld ebx,edx,7 ; get address of first location
80 call [scalecalls+4+ebp*4]
86 ;============ HIGH DETAIL ============
88 SCALELABEL MACRO number
95 mov al,[esi+ebx] ; get source pixel
96 add edx,ecx ; calculate next location
97 mov al,[eax] ; translate the color
99 ; shld ebx,edx,7 ; get address of next location
102 mov [edi-(LINE-1)*SCREENWIDTH],al ; draw a pixel to the buffer
116 ;============================================================================
118 ; unwound horizontal texture mapping code
121 ; ebx scratch register
122 ; ecx position 6.10 bits x, 6.10 bits y
123 ; edx step 6.10 bits x, 6.10 bits y
128 ; ebp should by preset from ebx / ecx before calling
129 ;============================================================================
137 MAPDEFINE MACRO number
160 ; Horizontal texture mapping
173 mov eax,[mapcalls+eax*4]
174 mov [callpoint],eax ; spot to jump into unwound
175 mov eax,[mapcalls+4+ebx*4]
176 mov [returnpoint],eax ; spot to patch a ret at
177 mov BYTE PTR [eax], OP_RET
180 ; build composite position
191 ; build composite step
204 mov edi,[_ylookup+edi*4]
207 mov eax,[_ds_colormap]
210 ; feed the pipeline and jump in
212 mov ebp,0fffh ; used to mask off slop high bits from position
213 shld ebx,ecx,22 ; shift y units in
214 shld ebx,ecx,6 ; shift x units in
215 and ebx,ebp ; mask off slop bits
218 mov ebx,[returnpoint]
219 mov BYTE PTR [ebx],OP_MOVAL ; remove the ret patched in
226 ;============= HIGH DETAIL ============
230 MAPLABEL MACRO number
242 mov al,[esi+ebx] ; get source pixel
243 shld ebx,ecx,22 ; shift y units in
244 shld ebx,ecx,6 ; shift x units in
245 mov al,[eax] ; translate color
246 and ebx,ebp ; mask off slop bits
247 add ecx,edx ; position += step
248 mov [edi+PLANE+PCOL*4],al ; write pixel