]> icculus.org git repositories - btb/d2x.git/blob - texmap/tmap_inc.asm
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / texmap / tmap_inc.asm
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.
11 ;
12 ;
13 ; Mike's include file for the texture mapper library.
14 ;
15 ;
16
17 ; VESA in this file must be the same as VESA in tmap.h
18 VESA    equ     0
19
20 direct_to_video equ     0
21 %if direct_to_video
22   %if VESA
23
24 ; for vesa mode
25 WINDOW_LEFT     =       0
26 WINDOW_RIGHT    =       300
27 WINDOW_TOP      =       0
28 WINDOW_BOTTOM   =       200
29 WINDOW_WIDTH    =       WINDOW_RIGHT - WINDOW_LEFT
30 BYTES_PER_ROW   =       300*2
31
32   %else
33
34 ; for non-vesa mode
35 WINDOW_LEFT     =       58
36 WINDOW_RIGHT    =       262
37 WINDOW_TOP      =       34
38 WINDOW_BOTTOM   =       167
39 WINDOW_WIDTH    =       WINDOW_RIGHT - WINDOW_LEFT
40 BYTES_PER_ROW   =       320             ; number of bytes between rows
41
42   %endif
43
44 ; for vesa, 15 bit color, 640x480x2
45 SCREEN_WIDTH    =       640
46 SCREEN_HEIGHT   =       480
47 BYTES_PER_PIXEL =       2
48 %endif
49
50 %ifdef __ELF__
51 ; It appears that ELF C compilers do not prefix symbols with '_', so here we
52 ; cater for them...
53 %define _gr_fade_table  gr_fade_table
54 %define _write_buffer   write_buffer
55 %define _window_left    window_left
56 %define _window_right   window_right
57 %define _window_top     window_top
58 %define _window_bottom  window_bottom
59 %define _window_width   window_width
60 %define _window_height  window_height
61 %define _bytes_per_row  bytes_per_row
62 %define _y_pointers     y_pointers
63
64 %define _per2_flag      per2_flag
65 %define _tmap_flat_cthru_table          tmap_flat_cthru_table
66 %define _tmap_flat_color                tmap_flat_color
67 %define _tmap_flat_shade_value          tmap_flat_shade_value
68 %define _dither_intensity_lighting      dither_intensity_lighting
69 %define _Lighting_on                    Lighting_on
70
71 %define _Transparency_on        Transparency_on
72 %define _fx_u                   fx_u
73 %define _fx_v                   fx_v
74 %define _fx_z                   fx_z
75 %define _fx_l                   fx_l
76 %define _fx_du_dx               fx_du_dx
77 %define _fx_dv_dx               fx_dv_dx
78 %define _fx_dz_dx               fx_dz_dx
79 %define _fx_dl_dx               fx_dl_dx
80 %define _fx_y                   fx_y
81 %define _fx_xleft               fx_xleft
82 %define _fx_xright              fx_xright
83 %define _pixptr                 pixptr
84 %endif
85
86         extern  _gr_fade_table;:byte
87 ;NO_INVERSE_TABLE       extrn   _gr_inverse_table:byte
88         extern  _write_buffer;:dword
89         extern  _window_left;:dword
90         extern _window_right;:dword
91         extern _window_top;:dword
92         extern _window_bottom;:dword,
93         extern _window_width;:dword,
94         extern _bytes_per_row;:dword,
95         extern _window_height;:dword
96         extern  _y_pointers;:dword
97
98 ;NO_INVERSE_TABLE _rgb_to_palette       equ     _gr_inverse_table
99 ;NO_INVERSE_TABLE _pixel_average        equ     _gr_inverse_table               ; should be blend table, but i took it out -john
100
101 max_window_width        equ     800
102 num_iters       equ     max_window_width
103
104 %if num_iters & 1
105 %assign num_iters num_iters+1
106 %endif
107         extern _per2_flag;:dword
108         extern _tmap_flat_cthru_table;:dword
109         extern _tmap_flat_color;:byte
110         extern _tmap_flat_shade_value;:byte
111         extern _dither_intensity_lighting;:dword
112         extern _Lighting_on;:dword
113
114 ; DPH: Selectors are about as portable as a rock.
115 ;        extern _pixel_data_selector;:word
116 ;        extern _gr_fade_table_selector;:word
117
118         extern _Transparency_on;:dword
119         extern _fx_u;:dword
120         extern _fx_v;:dword
121         extern _fx_z;:dword
122         extern _fx_l;:dword
123         extern _fx_du_dx;:dword
124         extern _fx_dv_dx;:dword
125         extern _fx_dz_dx;:dword
126         extern _fx_dl_dx;:dword
127         extern _fx_y;:dword
128         extern _fx_xleft;:dword
129         extern _fx_xright;:dword
130         extern _pixptr;:dword
131
132