Replace Tmem_nasm.asm with C++ code. Patch by pyro.
[Glide64.git] / Debugger.h
blobf5f587524eb2beacfd3e8abb008f50c477fa7f39
1 /*
2 * Glide64 - Glide video plugin for Nintendo 64 emulators.
3 * Copyright (c) 2002 Dave2001
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //****************************************************************
22 // Glide64 - Glide Plugin for Nintendo 64 emulators (tested mostly with Project64)
23 // Project started on December 29th, 2001
25 // To modify Glide64:
26 // * Write your name and (optional)email, commented by your work, so I know who did it, and so that you can find which parts you modified when it comes time to send it to me.
27 // * Do NOT send me the whole project or file that you modified. Take out your modified code sections, and tell me where to put them. If people sent the whole thing, I would have many different versions, but no idea how to combine them all.
29 // Official Glide64 development channel: #Glide64 on EFnet
31 // Original author: Dave2001 (Dave2999@hotmail.com)
32 // Other authors: Gonetz, Gugaman
34 //****************************************************************
36 #define SELECTED_NONE 0x00000000
37 #define SELECTED_TRI 0x00000001
38 #define SELECTED_TEX 0x00000002
40 typedef struct TEX_INFO_t
42 DWORD cur_cache[2]; // Current cache #
43 BYTE format;
44 BYTE size;
45 DWORD width, height;
46 WORD line, wid;
47 BYTE palette;
48 BYTE clamp_s, clamp_t;
49 BYTE mirror_s, mirror_t;
50 BYTE mask_s, mask_t;
51 BYTE shift_s, shift_t;
52 WORD ul_s, ul_t, lr_s, lr_t;
53 WORD t_ul_s, t_ul_t, t_lr_s, t_lr_t;
54 float scale_s, scale_t;
55 int tmu;
56 } TEX_INFO;
58 typedef struct TRI_INFO_t
60 DWORD nv; // Number of vertices
61 VERTEX *v; // Vertices (2d screen coords) of the triangle, used to outline
62 DWORD cycle1, cycle2, cycle_mode; // Combine mode at the time of rendering
63 BYTE uncombined; // which is uncombined: 0x01=color 0x02=alpha 0x03=both
64 DWORD geom_mode; // geometry mode flags
65 DWORD othermode_h; // setothermode_h flags
66 DWORD othermode_l; // setothermode_l flags
67 DWORD tri_n; // Triangle number
68 DWORD flags;
70 int type; // 0-normal, 1-texrect, 2-fillrect
72 // texture info
73 TEX_INFO t[2];
75 // colors
76 DWORD fog_color;
77 DWORD fill_color;
78 DWORD prim_color;
79 DWORD blend_color;
80 DWORD env_color;
81 DWORD prim_lodmin, prim_lodfrac;
83 TRI_INFO_t *pNext;
84 } TRI_INFO;
86 typedef struct
88 BOOL capture; // Capture moment for debugging?
90 DWORD selected; // Selected object (see flags above)
91 TRI_INFO *tri_sel;
93 DWORD tex_scroll; // texture scrolling
94 DWORD tex_sel;
96 // CAPTURE INFORMATION
97 BYTE *screen; // Screen capture
98 TRI_INFO *tri_list; // Triangle information list
99 TRI_INFO *tri_last; // Last in the list (first in)
101 DWORD tmu; // tmu #
103 DWORD draw_mode;
105 // Page number
106 int page;
108 } DEBUGGER;
110 #define PAGE_GENERAL 0
111 #define PAGE_TEX1 1
112 #define PAGE_TEX2 2
113 #define PAGE_COLORS 3
114 #define PAGE_FBL 4
115 #define PAGE_OTHERMODE_L 5
116 #define PAGE_OTHERMODE_H 6
117 #define PAGE_TEXELS 7
118 #define PAGE_COORDS 8
119 #define PAGE_TEX_INFO 9
121 #define TRI_TRIANGLE 0
122 #define TRI_TEXRECT 1
123 #define TRI_FILLRECT 2
124 #define TRI_BACKGROUND 3
125 #ifdef _WIN32
126 static char *tri_type[4] = { "TRIANGLE", "TEXRECT", "FILLRECT", "BACKGROUND" };
127 #endif // _WIN32
128 extern DEBUGGER debug;
130 void debug_init ();
131 void debug_capture ();
132 void debug_cacheviewer ();
133 void debug_mouse ();
134 void debug_keys ();
135 void output (float x, float y, BOOL scale, const char *fmt, ...);