1 ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
2 ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
3 ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
4 ;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
5 ;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
6 ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
7 ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
8 ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
9 ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
10 ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
12 ; $Source: /cvs/cvsroot/d2x/2d/scalea.asm,v $
13 ; $Revision: 1.1.1.1 $
15 ; $Date: 2001-01-19 03:29:57 $
17 ; Asm inner loop for scaler.
19 ; $Log: not supported by cvs2svn $
20 ; Revision 1.1.1.1 1999/06/14 21:57:07 donut
21 ; Import of d1x 1.37 source.
23 ; Revision 1.2 1994/01/12 18:02:52 john
24 ; Asm code for the scaler... first iteration here
25 ; has compiled code that works!!
27 ; Revision 1.1 1994/01/12 12:20:11 john
41 global _scale_trans_color
42 global _scale_error_term
43 global _scale_initial_pixel_count
45 global _scale_adj_down
46 global _scale_final_pixel_count
47 global _scale_ydelta_minus_1
48 global _scale_whole_step
49 global _scale_source_ptr
50 global _scale_dest_ptr
53 _scale_trans_color db 0
54 _scale_error_term dd 0
55 _scale_initial_pixel_count dd 0
58 _scale_final_pixel_count dd 0
59 _scale_ydelta_minus_1 dd 0
60 _scale_whole_step dd 0
61 _scale_source_ptr dd 0
63 _scale_cc_jump_spot dd 0
64 _scale_slice_length_1 dd 0
65 _scale_slice_length_2 dd 0
69 global _rls_stretch_scanline_asm
71 _rls_stretch_scanline_asm:
74 mov esi, [_scale_source_ptr]
75 mov edi, [_scale_dest_ptr]
76 mov edx, [_scale_ydelta_minus_1]
77 mov ebx, [_scale_whole_step]
78 mov ah, [_scale_trans_color]
79 mov ebp, [_scale_error_term]
81 mov ecx, [_scale_initial_pixel_count]
84 je first_pixel_transparent
88 first_pixel_transparent:
92 skip_this_pixel: add edi, ecx
96 next_pixel: lodsb ; get next source pixel
98 add ebp, [_scale_adj_up]
101 sub ebp, [_scale_adj_down]
105 rep stosb ; write source pixel to n locations
112 mov ecx, [_scale_final_pixel_count]
119 global _scale_do_cc_scanline
120 global _rls_do_cc_setup_asm
122 _scale_do_cc_scanline:
125 mov esi, [_scale_source_ptr]
126 mov edi, [_scale_dest_ptr]
127 mov ah, [_scale_trans_color]
128 mov ebx, [_scale_slice_length_1]
129 mov edx, [_scale_slice_length_2]
131 mov ecx, [_scale_initial_pixel_count]
133 ; Do the first texture pixel
134 mov ecx, [_scale_initial_pixel_count]
141 mov ecx, [_scale_cc_jump_spot]
144 ; This is the compiled code to do the middle pixels...
145 scale_cc_start: mov al, [esi]
146 scale_cc_changer: db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
156 db 08bh, 0cbh ;mov ecx, ebx ;<==== CODE CHANGES TO EBX OR EDX !!!!!!
169 mov ecx, [_scale_final_pixel_count]
172 je last_one_transparent
174 last_one_transparent:
179 _rls_do_cc_setup_asm:
183 mov ebx, [_scale_whole_step]
184 mov [_scale_slice_length_1], ebx
186 mov [_scale_slice_length_2], ebx
188 mov ebp, [_scale_error_term]
189 mov edx, [_scale_ydelta_minus_1]
191 mov ebx, scale_cc_end
192 sub ebx, scale_cc_start ; ebx = distance to next changer inst.
194 mov eax, [_scale_ydelta_minus_1]
197 imul eax, ebx ; eax = sizeof 1 iteration * numiterations.
199 mov edi, last_cc_instruction
200 sub edi, eax ; edi = address of first iteration that we need
202 mov [_scale_cc_jump_spot], edi
204 mov ecx, scale_cc_changer
205 sub ecx, scale_cc_start ; ecx = distance from start to to next changer inst.
209 next_pixel1: add ebp, [_scale_adj_up]
210 jle no_inc_error_term1
211 ; Modify code in scale_do_cc_scanline_ to write 'edx' pixels
215 mov word[edi], 0CA8Bh ; 0x8BCA = mov ecx, edx
217 sub ebp, [_scale_adj_down]
222 no_inc_error_term1: ; Modify code in scale_do_cc_scanline_ to write 'ebx' pixels
226 mov word [edi], 0CB8Bh ; 0x8BCB = mov ecx, ebx
234 BigError: int 3 ; Stop, buddy!!