2 ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 ;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
14 ; Asm inner loop for scaler.
18 ; Revision 1.2 1994/01/12 18:02:52 john
19 ; Asm code for the scaler... first iteration here
20 ; has compiled code that works!!
22 ; Revision 1.1 1994/01/12 12:20:11 john
36 global _scale_trans_color
37 global _scale_error_term
38 global _scale_initial_pixel_count
40 global _scale_adj_down
41 global _scale_final_pixel_count
42 global _scale_ydelta_minus_1
43 global _scale_whole_step
44 global _scale_source_ptr
45 global _scale_dest_ptr
48 _scale_trans_color db 0
49 _scale_error_term dd 0
50 _scale_initial_pixel_count dd 0
53 _scale_final_pixel_count dd 0
54 _scale_ydelta_minus_1 dd 0
55 _scale_whole_step dd 0
56 _scale_source_ptr dd 0
58 _scale_cc_jump_spot dd 0
59 _scale_slice_length_1 dd 0
60 _scale_slice_length_2 dd 0
64 global _rls_stretch_scanline_asm
66 _rls_stretch_scanline_asm:
69 mov esi, [_scale_source_ptr]
70 mov edi, [_scale_dest_ptr]
71 mov edx, [_scale_ydelta_minus_1]
72 mov ebx, [_scale_whole_step]
73 mov ah, [_scale_trans_color]
74 mov ebp, [_scale_error_term]
76 mov ecx, [_scale_initial_pixel_count]
79 je first_pixel_transparent
83 first_pixel_transparent:
87 skip_this_pixel: add edi, ecx
91 next_pixel: lodsb ; get next source pixel
93 add ebp, [_scale_adj_up]
96 sub ebp, [_scale_adj_down]
100 rep stosb ; write source pixel to n locations
107 mov ecx, [_scale_final_pixel_count]
114 global _scale_do_cc_scanline
115 global _rls_do_cc_setup_asm
117 _scale_do_cc_scanline:
120 mov esi, [_scale_source_ptr]
121 mov edi, [_scale_dest_ptr]
122 mov ah, [_scale_trans_color]
123 mov ebx, [_scale_slice_length_1]
124 mov edx, [_scale_slice_length_2]
126 mov ecx, [_scale_initial_pixel_count]
128 ; Do the first texture pixel
129 mov ecx, [_scale_initial_pixel_count]
136 mov ecx, [_scale_cc_jump_spot]
139 ; This is the compiled code to do the middle pixels...
140 scale_cc_start: mov al, [esi]
141 scale_cc_changer: db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
151 db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
164 mov ecx, [_scale_final_pixel_count]
167 je last_one_transparent
169 last_one_transparent:
174 _rls_do_cc_setup_asm:
178 mov ebx, [_scale_whole_step]
179 mov [_scale_slice_length_1], ebx
181 mov [_scale_slice_length_2], ebx
183 mov ebp, [_scale_error_term]
184 mov edx, [_scale_ydelta_minus_1]
186 mov ebx, scale_cc_end
187 sub ebx, scale_cc_start ; ebx = distance to next changer inst.
189 mov eax, [_scale_ydelta_minus_1]
192 imul eax, ebx ; eax = sizeof 1 iteration * numiterations.
194 mov edi, last_cc_instruction
195 sub edi, eax ; edi = address of first iteration that we need
197 mov [_scale_cc_jump_spot], edi
199 mov ecx, scale_cc_changer
200 sub ecx, scale_cc_start ; ecx = distance from start to to next changer inst.
204 next_pixel1: add ebp, [_scale_adj_up]
205 jle no_inc_error_term1
206 ; Modify code in scale_do_cc_scanline_ to write 'edx' pixels
210 mov word[edi], 0CA8Bh ; 0x8BCA = mov ecx, edx
212 sub ebp, [_scale_adj_down]
217 no_inc_error_term1: ; Modify code in scale_do_cc_scanline_ to write 'ebx' pixels
221 mov word [edi], 0CB8Bh ; 0x8BCB = mov ecx, ebx
229 BigError: int 3 ; Stop, buddy!!