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