2 * Glide64 - Glide video plugin for Nintendo 64 emulators.
3 * Copyright (c) 2002 Dave2001
4 * Copyright (c) 2003-2009 Sergey 'Gonetz' Lipski
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 //****************************************************************
23 // Glide64 - Glide Plugin for Nintendo 64 emulators
24 // Project started on December 29th, 2001
27 // Dave2001, original author, founded the project in 2001, left it in 2002
28 // Gugaman, joined the project in 2002, left it in 2002
29 // Sergey 'Gonetz' Lipski, joined the project in 2002, main author since fall of 2002
30 // Hiroshi 'KoolSmoky' Morii, joined the project in 2007
32 //****************************************************************
35 // * 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.
36 // * 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.
38 //****************************************************************
40 #define SELECTED_NONE 0x00000000
41 #define SELECTED_TRI 0x00000001
42 #define SELECTED_TEX 0x00000002
44 typedef struct TEX_INFO_t
46 wxUint32 cur_cache[2]; // Current cache #
49 wxUint32 width, height;
52 wxUint8 clamp_s, clamp_t;
53 wxUint8 mirror_s, mirror_t;
54 wxUint8 mask_s, mask_t;
55 wxUint8 shift_s, shift_t;
56 wxUint16 ul_s, ul_t, lr_s, lr_t;
57 wxUint16 t_ul_s, t_ul_t, t_lr_s, t_lr_t;
58 float scale_s, scale_t;
62 typedef struct TRI_INFO_t
64 wxUint32 nv; // Number of vertices
65 VERTEX *v; // Vertices (2d screen coords) of the triangle, used to outline
66 wxUint32 cycle1, cycle2, cycle_mode; // Combine mode at the time of rendering
67 wxUint8 uncombined; // which is uncombined: 0x01=color 0x02=alpha 0x03=both
68 wxUint32 geom_mode; // geometry mode flags
69 wxUint32 othermode_h; // setothermode_h flags
70 wxUint32 othermode_l; // setothermode_l flags
71 wxUint32 tri_n; // Triangle number
74 int type; // 0-normal, 1-texrect, 2-fillrect
85 wxUint32 prim_lodmin, prim_lodfrac;
90 typedef struct DEBUGGER_t
92 int capture; // Capture moment for debugging?
94 wxUint32 selected; // Selected object (see flags above)
97 wxUint32 tex_scroll; // texture scrolling
100 // CAPTURE INFORMATION
101 wxUint8 *screen; // Screen capture
102 TRI_INFO *tri_list; // Triangle information list
103 TRI_INFO *tri_last; // Last in the list (first in)
105 wxUint32 tmu; // tmu #
114 #define PAGE_GENERAL 0
117 #define PAGE_COLORS 3
119 #define PAGE_OTHERMODE_L 5
120 #define PAGE_OTHERMODE_H 6
121 #define PAGE_TEXELS 7
122 #define PAGE_COORDS 8
123 #define PAGE_TEX_INFO 9
125 #define TRI_TRIANGLE 0
126 #define TRI_TEXRECT 1
127 #define TRI_FILLRECT 2
128 #define TRI_BACKGROUND 3
130 extern GLIDE64_DEBUGGER _debugger;
133 void debug_capture ();
134 void debug_cacheviewer ();
137 void output (float x, float y, int scale, const char *fmt, ...);