Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-glide64/src/Debugger.h
2 views
1
/*
2
* Glide64 - Glide video plugin for Nintendo 64 emulators.
3
* Copyright (c) 2002 Dave2001
4
*
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.
9
*
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.
14
*
15
* You should have received a copy of the GNU General Public
16
* Licence along with this program; if not, write to the Free
17
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA
19
*/
20
21
//****************************************************************
22
//
23
// Glide64 - Glide Plugin for Nintendo 64 emulators (tested mostly with Project64)
24
// Project started on December 29th, 2001
25
//
26
// To modify Glide64:
27
// * 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.
28
// * 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
//
30
// Official Glide64 development channel: #Glide64 on EFnet
31
//
32
// Original author: Dave2001 ([email protected])
33
// Other authors: Gonetz, Gugaman
34
//
35
//****************************************************************
36
37
#define SELECTED_NONE 0x00000000
38
#define SELECTED_TRI 0x00000001
39
#define SELECTED_TEX 0x00000002
40
41
typedef struct TEX_INFO_t
42
{
43
DWORD cur_cache[2]; // Current cache #
44
BYTE format;
45
BYTE size;
46
DWORD width, height;
47
WORD line, wid;
48
BYTE palette;
49
BYTE clamp_s, clamp_t;
50
BYTE mirror_s, mirror_t;
51
BYTE mask_s, mask_t;
52
BYTE shift_s, shift_t;
53
WORD ul_s, ul_t, lr_s, lr_t;
54
WORD t_ul_s, t_ul_t, t_lr_s, t_lr_t;
55
float scale_s, scale_t;
56
int tmu;
57
} TEX_INFO;
58
59
typedef struct TRI_INFO_t
60
{
61
DWORD nv; // Number of vertices
62
VERTEX *v; // Vertices (2d screen coords) of the triangle, used to outline
63
DWORD cycle1, cycle2, cycle_mode; // Combine mode at the time of rendering
64
BYTE uncombined; // which is uncombined: 0x01=color 0x02=alpha 0x03=both
65
DWORD geom_mode; // geometry mode flags
66
DWORD othermode_h; // setothermode_h flags
67
DWORD othermode_l; // setothermode_l flags
68
DWORD tri_n; // Triangle number
69
DWORD flags;
70
71
int type; // 0-normal, 1-texrect, 2-fillrect
72
73
// texture info
74
TEX_INFO t[2];
75
76
// colors
77
DWORD fog_color;
78
DWORD fill_color;
79
DWORD prim_color;
80
DWORD blend_color;
81
DWORD env_color;
82
DWORD prim_lodmin, prim_lodfrac;
83
84
TRI_INFO_t *pNext;
85
} TRI_INFO;
86
87
typedef struct
88
{
89
BOOL capture; // Capture moment for debugging?
90
91
DWORD selected; // Selected object (see flags above)
92
TRI_INFO *tri_sel;
93
94
DWORD tex_scroll; // texture scrolling
95
DWORD tex_sel;
96
97
// CAPTURE INFORMATION
98
BYTE *screen; // Screen capture
99
TRI_INFO *tri_list; // Triangle information list
100
TRI_INFO *tri_last; // Last in the list (first in)
101
102
DWORD tmu; // tmu #
103
104
DWORD draw_mode;
105
106
// Page number
107
int page;
108
109
} DEBUGGER;
110
111
#define PAGE_GENERAL 0
112
#define PAGE_TEX1 1
113
#define PAGE_TEX2 2
114
#define PAGE_COLORS 3
115
#define PAGE_FBL 4
116
#define PAGE_OTHERMODE_L 5
117
#define PAGE_OTHERMODE_H 6
118
#define PAGE_TEXELS 7
119
#define PAGE_COORDS 8
120
#define PAGE_TEX_INFO 9
121
122
#define TRI_TRIANGLE 0
123
#define TRI_TEXRECT 1
124
#define TRI_FILLRECT 2
125
#define TRI_BACKGROUND 3
126
#ifdef _WIN32
127
static char *tri_type[4] = { "TRIANGLE", "TEXRECT", "FILLRECT", "BACKGROUND" };
128
#endif // _WIN32
129
extern DEBUGGER debug;
130
131
void debug_init ();
132
void debug_capture ();
133
void debug_cacheviewer ();
134
void debug_mouse ();
135
void debug_keys ();
136
void output (float x, float y, BOOL scale, const char *fmt, ...);
137
138
139