]> icculus.org git repositories - btb/d2x.git/blob - unused/pa_null/poly_acc.h
configuration fixes
[btb/d2x.git] / unused / pa_null / poly_acc.h
1 /*
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-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14
15 #if defined(POLY_ACC)
16 #if !defined(POLY_ACC_H)
17 #define POLY_ACC_H
18
19 //
20 //  A simplified interface to a variety of 3D cards.
21 //
22
23 #define SM_640x480x15xPA    23          // 640x480 15 bits per pixel, POLY ACC
24 #define BM_LINEAR15 5                   // 1555 format, may be able to replace with BM_RGB15. John indicated that
25                                         // BM_RGB15 wasn't finished so I made a new type.
26 #define PA_BPP  2                       // bytes per pixel.
27
28 extern unsigned short pa_clut[256];     // translate from 8 bit pixels to 15 bit pixels.
29 extern int pa_filter_mode;              //  For Virge filtering control, set in Custom Detail Level menu.
30
31 int pa_init(void);                      // init library.
32 void pa_reset();                        // cleans up library.
33 int pa_detect(int mode);                // detect card and whether mode is supported.
34 void pa_set_mode(int mode);             // sets display mode if valid PA mode.
35 void pa_update_clut(                    // 8 bit to 15 bit table update.
36     unsigned char *pal,
37     int start, int count,
38     int type);                          // type 0==0..63, 1==0..255.
39 void pa_restore_clut(void);
40 void pa_save_clut(void);
41 void pa_step_up(int r, int g, int b);
42
43 void *pa_get_buffer_address(int which); // returns a pointer to the front(0), or back(1) buffer.
44                                         // NOTE: this only makes sense until the next page flip.
45 void pa_swap_buffer(void);              // performs the page flip.
46 void pa_ibitblt(void *src, void *dst, void *mask);
47
48 void pa_clear_buffer(int buffer, ushort color);
49 void pa_set_3d_offset(int x, int y);    // where on screen the triangles should be drawn.
50 void pa_draw_tmap(void /*$$grs_bitmap*/ * srcb, void /*$$g3ds_tmap*/ * tmap, int transparency_on, int lighting_on,
51     int perspective, fix min_z);
52 void pa_draw_flat(void /*$$g3ds_tmap*/ * tmap, int color, int alpha);
53 void pa_blit(grs_bitmap *dst, int dx, int dy, grs_bitmap *src, int sx, int sy, int w, int h);
54 void pa_blit_scale(grs_bitmap *source_bmp, grs_bitmap *dest_bmp,
55     int x0, int y0, int x1, int y1,
56     fix u0, fix v0,  fix u1, fix v1, int orient
57 );
58 int pa_blit_lit(grs_bitmap *dst, int dx, int dy, grs_bitmap *src, int sx, int sy, int w, int h);
59
60 int pa_rect(int left,int top,int right,int bot);
61
62 void pa_init_cache(void);
63 void pa_cache_hit(int slot);
64 void pa_cache_miss(int slot, grs_bitmap * bmp);
65
66 int pa_idle(void);                      // allows program to poll whether the chip is busy.
67 void pa_sync(void);                     // waits for current async op to complete.
68 void pa_flush(void);                    // flushes dma and waits for everything to complete.
69
70 void pa_about_to_flip();                                        // used in Rendition version, but not in S3 version
71
72 void pa_set_write_mode (int mode);              // used by 3Dfx
73 void pa_set_frontbuffer_current(void);  // used by 3Dfx
74
75 #endif
76 #endif