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.
13 ; Flat shader derived from texture mapper (kind of slow)
19 global _asm_tmap_scanline_flat
20 global asm_tmap_scanline_flat
24 %include "tmap_inc.asm"
28 ; --------------------------------------------------------------------------------------------------
30 ; _xleft fixed point left x coordinate
31 ; _xright fixed point right x coordinate
32 ; _y fixed point y coordinate
33 ;**; _pixptr address of source pixel map
35 ; for (x = (int) xleft; x <= (int) xright; x++) {
36 ; _setcolor(read_pixel_from_tmap(srcb,((int) (u/z)) & 63,((int) (v/z)) & 63));
43 _asm_tmap_scanline_flat:
44 asm_tmap_scanline_flat:
47 ; Setup for loop: _loop_count iterations = (int) xright - (int) xleft
48 ;**; esi source pixel pointer = pixptr
49 ; edi initial row pointer = y*320+x
51 ; set esi = pointer to start of texture map data
54 ; set edi = address of first pixel to modify
56 cmp edi,[_window_bottom]
59 imul edi,[_bytes_per_row]
66 add edi,[_write_buffer]
68 ; set _loop_count = # of iterations
71 cmp eax,[_window_right]
73 mov eax,[_window_right]
74 eax_ok1: cmp eax,[_window_left]
76 mov eax,[_window_left]
82 cmp eax,[_window_width]
84 mov eax,[_window_width]
89 ; edi = destination pixel pointer
90 cmp dword [_tmap_flat_cthru_table], 0
93 mov al,[_tmap_flat_color]
107 _no_full_words: adc ecx,ecx ; if cy set, then write one more pixel (ecx == 0)
108 rep stosb ; write 0 or 1 pixel
114 mov esi, [_tmap_flat_cthru_table]
118 ; edi = dest, esi = table, ecx = count
121 mov al, [edi] ; get already drawn pixel
122 mov al, [eax+esi] ; xlat thru cthru table
123 mov [edi],al ; write it