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.
27 global _scale_trans_color
28 global _scale_error_term
29 global _scale_initial_pixel_count
31 global _scale_adj_down
32 global _scale_final_pixel_count
33 global _scale_ydelta_minus_1
34 global _scale_whole_step
35 global _scale_source_ptr
36 global _scale_dest_ptr
39 _scale_trans_color db 0
40 _scale_error_term dd 0
41 _scale_initial_pixel_count dd 0
44 _scale_final_pixel_count dd 0
45 _scale_ydelta_minus_1 dd 0
46 _scale_whole_step dd 0
47 _scale_source_ptr dd 0
49 _scale_cc_jump_spot dd 0
50 _scale_slice_length_1 dd 0
51 _scale_slice_length_2 dd 0
55 global _rls_stretch_scanline_asm
57 _rls_stretch_scanline_asm:
60 mov esi, [_scale_source_ptr]
61 mov edi, [_scale_dest_ptr]
62 mov edx, [_scale_ydelta_minus_1]
63 mov ebx, [_scale_whole_step]
64 mov ah, [_scale_trans_color]
65 mov ebp, [_scale_error_term]
67 mov ecx, [_scale_initial_pixel_count]
70 je first_pixel_transparent
74 first_pixel_transparent:
78 skip_this_pixel: add edi, ecx
82 next_pixel: lodsb ; get next source pixel
84 add ebp, [_scale_adj_up]
87 sub ebp, [_scale_adj_down]
91 rep stosb ; write source pixel to n locations
98 mov ecx, [_scale_final_pixel_count]
105 global _scale_do_cc_scanline
106 global _rls_do_cc_setup_asm
108 _scale_do_cc_scanline:
111 mov esi, [_scale_source_ptr]
112 mov edi, [_scale_dest_ptr]
113 mov ah, [_scale_trans_color]
114 mov ebx, [_scale_slice_length_1]
115 mov edx, [_scale_slice_length_2]
117 mov ecx, [_scale_initial_pixel_count]
119 ; Do the first texture pixel
120 mov ecx, [_scale_initial_pixel_count]
127 mov ecx, [_scale_cc_jump_spot]
130 ; This is the compiled code to do the middle pixels...
131 scale_cc_start: mov al, [esi]
132 scale_cc_changer: db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
142 db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
155 mov ecx, [_scale_final_pixel_count]
158 je last_one_transparent
160 last_one_transparent:
165 _rls_do_cc_setup_asm:
169 mov ebx, [_scale_whole_step]
170 mov [_scale_slice_length_1], ebx
172 mov [_scale_slice_length_2], ebx
174 mov ebp, [_scale_error_term]
175 mov edx, [_scale_ydelta_minus_1]
177 mov ebx, scale_cc_end
178 sub ebx, scale_cc_start ; ebx = distance to next changer inst.
180 mov eax, [_scale_ydelta_minus_1]
183 imul eax, ebx ; eax = sizeof 1 iteration * numiterations.
185 mov edi, last_cc_instruction
186 sub edi, eax ; edi = address of first iteration that we need
188 mov [_scale_cc_jump_spot], edi
190 mov ecx, scale_cc_changer
191 sub ecx, scale_cc_start ; ecx = distance from start to to next changer inst.
195 next_pixel1: add ebp, [_scale_adj_up]
196 jle no_inc_error_term1
197 ; Modify code in scale_do_cc_scanline_ to write 'edx' pixels
201 mov word[edi], 0CA8Bh ; 0x8BCA = mov ecx, edx
203 sub ebp, [_scale_adj_down]
208 no_inc_error_term1: ; Modify code in scale_do_cc_scanline_ to write 'ebx' pixels
212 mov word [edi], 0CB8Bh ; 0x8BCB = mov ecx, ebx
220 BigError: int 3 ; Stop, buddy!!