]> icculus.org git repositories - btb/d2x.git/blob - texmap/tmap_inc.asm
mac data file loading
[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 ; $Source: /cvs/cvsroot/d2x/texmap/tmap_inc.asm,v $
13 ; $Revision: 1.2 $
14 ; $Author: bradleyb $
15 ; $Date: 2001-10-18 23:59:23 $
16 ;
17 ; Mike's include file for the texture mapper library.
18 ;
19 ; $Log: not supported by cvs2svn $
20 ; Revision 1.1.1.1  2001/01/19 03:30:16  bradleyb
21 ; Import of d2x-0.0.8
22 ;
23 ; Revision 1.1.1.1  1999/06/14 22:13:53  donut
24 ; Import of d1x 1.37 source.
25 ;
26 ; Revision 1.10  1995/02/20  18:22:52  john
27 ; Put all the externs in the assembly modules into tmap_inc.asm.
28 ; Also, moved all the C versions of the inner loops into a new module,
29 ; scanline.c.
30 ;
31 ; Revision 1.9  1994/12/02  23:29:45  mike
32 ; Add y_pointers.
33 ;
34 ; Revision 1.8  1994/11/12  16:39:36  mike
35 ; jae to ja.
36 ;
37 ; Revision 1.7  1994/10/26  23:27:39  john
38 ; Took out references to gr_inverse_table.
39 ;
40 ; Revision 1.6  1994/10/26  23:21:55  mike
41 ; kill unused stuff.
42 ;
43 ; Revision 1.5  1994/07/27  18:39:20  john
44 ; Took out references to blend table
45 ;
46 ; Revision 1.4  1994/01/31  15:40:17  mike
47 ; Add window_height.
48 ;
49 ; Revision 1.3  1993/12/07  12:27:48  john
50 ; Moved bmd_palette to gr_palette
51 ;
52 ; Revision 1.2  1993/11/22  10:24:10  mike
53 ; *** empty log message ***
54 ;
55 ; Revision 1.1  1993/09/08  17:29:47  mike
56 ; Initial revision
57 ;
58 ;
59 ;
60
61 ; VESA in this file must be the same as VESA in tmap.h
62 VESA    equ     0
63
64 direct_to_video equ     0
65 %if direct_to_video
66   %if VESA
67
68 ; for vesa mode
69 WINDOW_LEFT     =       0
70 WINDOW_RIGHT    =       300
71 WINDOW_TOP      =       0
72 WINDOW_BOTTOM   =       200
73 WINDOW_WIDTH    =       WINDOW_RIGHT - WINDOW_LEFT
74 BYTES_PER_ROW   =       300*2
75
76   %else
77
78 ; for non-vesa mode
79 WINDOW_LEFT     =       58
80 WINDOW_RIGHT    =       262
81 WINDOW_TOP      =       34
82 WINDOW_BOTTOM   =       167
83 WINDOW_WIDTH    =       WINDOW_RIGHT - WINDOW_LEFT
84 BYTES_PER_ROW   =       320             ; number of bytes between rows
85
86   %endif
87
88 ; for vesa, 15 bit color, 640x480x2
89 SCREEN_WIDTH    =       640
90 SCREEN_HEIGHT   =       480
91 BYTES_PER_PIXEL =       2
92 %endif
93
94 %ifdef __linux__
95 ; It appears that ELF C compilers do not prefix symbols with '_', so here we
96 ; cater for them...
97 %define _gr_fade_table  gr_fade_table
98 %define _write_buffer   write_buffer
99 %define _window_left    window_left
100 %define _window_right   window_right
101 %define _window_top     window_top
102 %define _window_bottom  window_bottom
103 %define _window_width   window_width
104 %define _window_height  window_height
105 %define _bytes_per_row  bytes_per_row
106 %define _y_pointers     y_pointers
107
108 %define _per2_flag      per2_flag
109 %define _tmap_flat_cthru_table          tmap_flat_cthru_table
110 %define _tmap_flat_color                tmap_flat_color
111 %define _tmap_flat_shade_value          tmap_flat_shade_value
112 %define _dither_intensity_lighting      dither_intensity_lighting
113 %define _Lighting_on                    Lighting_on
114
115 %define _Transparency_on        Transparency_on
116 %define _fx_u                   fx_u
117 %define _fx_v                   fx_v
118 %define _fx_z                   fx_z
119 %define _fx_l                   fx_l
120 %define _fx_du_dx               fx_du_dx
121 %define _fx_dv_dx               fx_dv_dx
122 %define _fx_dz_dx               fx_dz_dx
123 %define _fx_dl_dx               fx_dl_dx
124 %define _fx_y                   fx_y
125 %define _fx_xleft               fx_xleft
126 %define _fx_xright              fx_xright
127 %define _pixptr                 pixptr
128 %endif
129
130         extern  _gr_fade_table;:byte
131 ;NO_INVERSE_TABLE       extrn   _gr_inverse_table:byte
132         extern  _write_buffer;:dword
133         extern  _window_left;:dword
134         extern _window_right;:dword
135         extern _window_top;:dword
136         extern _window_bottom;:dword,
137         extern _window_width;:dword,
138         extern _bytes_per_row;:dword,
139         extern _window_height;:dword
140         extern  _y_pointers;:dword
141
142 ;NO_INVERSE_TABLE _rgb_to_palette       equ     _gr_inverse_table
143 ;NO_INVERSE_TABLE _pixel_average        equ     _gr_inverse_table               ; should be blend table, but i took it out -john
144
145 max_window_width        equ     800
146 num_iters       equ     max_window_width
147
148 %if num_iters & 1
149 %assign num_iters num_iters+1
150 %endif
151         extern _per2_flag;:dword
152         extern _tmap_flat_cthru_table;:dword
153         extern _tmap_flat_color;:byte
154         extern _tmap_flat_shade_value;:byte
155         extern _dither_intensity_lighting;:dword
156         extern _Lighting_on;:dword
157
158 ; DPH: Selectors are about as portable as a rock.
159 ;        extern _pixel_data_selector;:word
160 ;        extern _gr_fade_table_selector;:word
161
162         extern _Transparency_on;:dword
163         extern _fx_u;:dword
164         extern _fx_v;:dword
165         extern _fx_z;:dword
166         extern _fx_l;:dword
167         extern _fx_du_dx;:dword
168         extern _fx_dv_dx;:dword
169         extern _fx_dz_dx;:dword
170         extern _fx_dl_dx;:dword
171         extern _fx_y;:dword
172         extern _fx_xleft;:dword
173         extern _fx_xright;:dword
174         extern _pixptr;:dword
175
176