Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-glide64/src/Combine.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
#ifndef COMBINE_H
37
#define COMBINE_H
38
#include "Gfx1.3.h"
39
40
// texture MOD types
41
#define TMOD_TEX_INTER_COLOR_USING_FACTOR 1
42
#define TMOD_TEX_INTER_COL_USING_COL1 2
43
#define TMOD_FULL_COLOR_SUB_TEX 3
44
#define TMOD_COL_INTER_COL1_USING_TEX 4
45
#define TMOD_COL_INTER_COL1_USING_TEXA 5
46
#define TMOD_COL_INTER_COL1_USING_TEXA__MUL_TEX 6
47
#define TMOD_COL_INTER_TEX_USING_TEXA 7
48
#define TMOD_COL2_INTER__COL_INTER_COL1_USING_TEX__USING_TEXA 8
49
#define TMOD_TEX_SCALE_FAC_ADD_FAC 9
50
#define TMOD_TEX_SUB_COL_MUL_FAC_ADD_TEX 10
51
#define TMOD_TEX_SCALE_COL_ADD_COL 11
52
#define TMOD_TEX_ADD_COL 12
53
#define TMOD_TEX_SUB_COL 13
54
#define TMOD_TEX_SUB_COL_MUL_FAC 14
55
#define TMOD_COL_INTER_TEX_USING_COL1 15
56
#define TMOD_COL_MUL_TEXA_ADD_TEX 16
57
#define TMOD_COL_INTER_TEX_USING_TEX 17
58
#define TMOD_TEX_INTER_NOISE_USING_COL 18
59
#define TMOD_TEX_INTER_COL_USING_TEXA 19
60
#define TMOD_TEX_MUL_COL 20
61
#define TMOD_TEX_SCALE_FAC_ADD_COL 21
62
63
#define COMBINE_EXT_COLOR 1
64
#define COMBINE_EXT_ALPHA 2
65
#define TEX_COMBINE_EXT_COLOR 1
66
#define TEX_COMBINE_EXT_ALPHA 2
67
68
typedef struct
69
{
70
DWORD ccolor; // constant color to set at the end, color and alpha
71
DWORD c_fnc, c_fac, c_loc, c_oth; // grColorCombine flags
72
DWORD a_fnc, a_fac, a_loc, a_oth; // grAlphaCombine flags
73
DWORD tex, tmu0_func, tmu0_fac, tmu0_invert, tmu1_func, tmu1_fac, tmu1_invert;
74
DWORD tmu0_a_func, tmu0_a_fac, tmu0_a_invert, tmu1_a_func, tmu1_a_fac, tmu1_a_invert;
75
int dc0_lodbias, dc1_lodbias;
76
BYTE dc0_detailscale, dc1_detailscale;
77
float dc0_detailmax, dc1_detailmax;
78
float lodbias0, lodbias1;
79
DWORD abf1, abf2;
80
DWORD mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0;
81
DWORD mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1;
82
//combine extensions
83
DWORD c_ext_a, c_ext_a_mode, c_ext_b, c_ext_b_mode, c_ext_c, c_ext_d;
84
BOOL c_ext_c_invert, c_ext_d_invert;
85
DWORD a_ext_a, a_ext_a_mode, a_ext_b, a_ext_b_mode, a_ext_c, a_ext_d;
86
BOOL a_ext_c_invert, a_ext_d_invert;
87
DWORD t0c_ext_a, t0c_ext_a_mode, t0c_ext_b, t0c_ext_b_mode, t0c_ext_c, t0c_ext_d;
88
BOOL t0c_ext_c_invert, t0c_ext_d_invert;
89
DWORD t0a_ext_a, t0a_ext_a_mode, t0a_ext_b, t0a_ext_b_mode, t0a_ext_c, t0a_ext_d;
90
BOOL t0a_ext_c_invert, t0a_ext_d_invert;
91
DWORD t1c_ext_a, t1c_ext_a_mode, t1c_ext_b, t1c_ext_b_mode, t1c_ext_c, t1c_ext_d;
92
BOOL t1c_ext_c_invert, t1c_ext_d_invert;
93
DWORD t1a_ext_a, t1a_ext_a_mode, t1a_ext_b, t1a_ext_b_mode, t1a_ext_c, t1a_ext_d;
94
BOOL t1a_ext_c_invert, t1a_ext_d_invert;
95
GRCOLORCOMBINEEXT grColorCombineExt;
96
GRCOLORCOMBINEEXT grAlphaCombineExt;
97
GRTEXCOLORCOMBINEEXT grTexColorCombineExt;
98
GRTEXCOLORCOMBINEEXT grTexAlphaCombineExt;
99
GRCONSTANTCOLORVALUEEXT grConstantColorValueExt;
100
DWORD tex_ccolor;
101
BOOL combine_ext;
102
BYTE cmb_ext_use;
103
BYTE tex_cmb_ext_use;
104
} COMBINE;
105
106
extern COMBINE cmb;
107
108
void Combine ();
109
void CombineBlender ();
110
void CountCombine ();
111
void InitCombine ();
112
void ColorCombinerToExtension ();
113
void AlphaCombinerToExtension ();
114
void TexColorCombinerToExtension (GrChipID_t tmu);
115
void TexAlphaCombinerToExtension (GrChipID_t tmu);
116
117
#endif //COMBINE _H
118
119
120