-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathConfig.h
243 lines (202 loc) · 5.61 KB
/
Config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
Copyright (C) 2002-2009 Rice1964
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either
2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _RICE_CONFIG_H_
#define _RICE_CONFIG_H_
#include "typedefs.h"
enum {
FRM_BUF_NONE,
FRM_BUF_IGNORE,
FRM_BUF_BASIC,
FRM_BUF_BASIC_AND_WRITEBACK,
FRM_BUF_WRITEBACK_AND_RELOAD,
FRM_BUF_COMPLETE,
FRM_BUF_WITH_EMULATOR,
FRM_BUF_BASIC_AND_WITH_EMULATOR,
FRM_BUF_WITH_EMULATOR_READ_ONLY,
FRM_BUF_WITH_EMULATOR_WRITE_ONLY,
};
enum {
FRM_BUF_WRITEBACK_NORMAL,
FRM_BUF_WRITEBACK_1_2,
FRM_BUF_WRITEBACK_1_3,
FRM_BUF_WRITEBACK_1_4,
FRM_BUF_WRITEBACK_1_5,
FRM_BUF_WRITEBACK_1_6,
FRM_BUF_WRITEBACK_1_7,
FRM_BUF_WRITEBACK_1_8,
};
enum {
TXT_BUF_NONE,
TXT_BUF_IGNORE,
TXT_BUF_NORMAL,
TXT_BUF_WRITE_BACK,
TXT_BUF_WRITE_BACK_AND_RELOAD ,
};
enum {
FORCE_DEFAULT_FILTER,
FORCE_POINT_FILTER,
FORCE_LINEAR_FILTER,
FORCE_BILINEAR_FILTER,
};
enum {
TEXTURE_NO_ENHANCEMENT,
TEXTURE_2XSAI_ENHANCEMENT,
TEXTURE_HQ2X_ENHANCEMENT,
TEXTURE_HQ2XS_ENHANCEMENT,
TEXTURE_EXTERNAL,
};
enum HACK_FOR_GAMES
{
NO_HACK_FOR_GAME,
HACK_FOR_BANJO_TOOIE,
HACK_FOR_DR_MARIO,
HACK_FOR_ZELDA,
HACK_FOR_MARIO_TENNIS,
HACK_FOR_BANJO,
HACK_FOR_PD,
HACK_FOR_GE,
HACK_FOR_PILOT_WINGS,
HACK_FOR_YOSHI,
HACK_FOR_NITRO,
HACK_FOR_TONYHAWK,
HACK_FOR_NASCAR,
HACK_FOR_SUPER_BOWLING,
HACK_FOR_CONKER,
HACK_FOR_ALL_STAR_BASEBALL,
HACK_FOR_TIGER_HONEY_HUNT,
HACK_REVERSE_XY_COOR,
HACK_REVERSE_Y_COOR,
HACK_FOR_GOLDEN_EYE,
HACK_FOR_FZERO,
HACK_FOR_COMMANDCONQUER,
HACK_FOR_RUMBLE,
HACK_FOR_SOUTH_PARK_RALLY,
HACK_FOR_BUST_A_MOVE,
HACK_FOR_OGRE_BATTLE,
HACK_FOR_TWINE,
HACK_FOR_EXTREME_G2,
HACK_FOR_ROGUE_SQUADRON,
HACK_FOR_MARIO_GOLF,
HACK_FOR_MLB,
HACK_FOR_POLARISSNOCROSS,
HACK_FOR_TOPGEARRALLY,
HACK_FOR_TOPGEAROVERDRIVE,
HACK_FOR_DUKE_NUKEM,
HACK_FOR_ZELDA_MM,
HACK_FOR_MARIO_KART,
HACK_FOR_DIDDY_KONG_RACING,
};
enum {
NOT_USE_CI_WIDTH_AND_RATIO,
USE_CI_WIDTH_AND_RATIO_FOR_NTSC,
USE_CI_WIDTH_AND_RATIO_FOR_PAL,
};
struct GlobalOptions{
bool bEnableHacks;
bool bEnableFog;
bool bWinFrameMode;
bool bMipMaps;
uint32 forceTextureFilter;
uint32 textureEnhancement;
uint32 textureEnhancementControl;
bool bDumpTexturesToFiles;
bool bLoadHiResTextures;
bool bCacheHiResTextures;
uint32 DirectXAntiAliasingValue;
uint32 DirectXAnisotropyValue;
HACK_FOR_GAMES enableHackForGames;
} ;
extern GlobalOptions options;
struct FrameBufferOptions{
bool bUpdateCIInfo;
bool bCheckBackBufs; // Check texture again against the recent backbuffer addresses
bool bWriteBackBufToRDRAM; // If a recent backbuffer is used, write its content back to RDRAM
bool bLoadBackBufFromRDRAM; // Load content from RDRAM and draw into backbuffer
bool bIgnore; // Ignore all rendering into texture buffers
bool bSupportRenderTextures; // Support render-to-texture
bool bCheckRenderTextures; // Check texture again against the the last render_texture addresses
bool bRenderTextureWriteBack; // Write back render_texture into RDRAM
bool bLoadRDRAMIntoRenderTexture; // Load RDRAM content and render into render_texture
bool bAtEachFrameUpdate; // Reload and write back at each frame buffer and CI update
bool bProcessCPUWrite;
bool bProcessCPURead;
bool bFillRectNextTextureBuffer;
bool bIgnoreRenderTextureIfHeightUnknown;
};
extern FrameBufferOptions frameBufferOptions;
BOOL InitConfiguration(void);
struct RomOptions{
uint32 N64FrameBufferEmuType;
uint32 N64FrameBufferWriteBackControl;
uint32 N64RenderToTextureEmuType;
};
extern RomOptions defaultRomOptions;
extern RomOptions currentRomOptions;
extern char szIniFileName[300];
void OutputSectionDetails(uint32 i, FILE * fh);
int FindIniEntry(uint32 dwCRC1, uint32 dwCRC2, uint8 nCountryID, LPCTSTR szName);
struct ROMHeader
{
uint8 x1, x2, x3, x4;
uint32 dwClockRate;
uint32 dwBootAddressOffset;
uint32 dwRelease;
uint32 dwCRC1;
uint32 dwCRC2;
uint64 qwUnknown1;
char szName[20];
uint32 dwUnknown2;
uint16 wUnknown3;
uint8 nUnknown4;
uint8 nManufacturer;
uint16 wCartID;
s8 nCountryID;
uint8 nUnknown5;
};
#pragma pack()
typedef struct
{
// Other info from the rom. This is for convenience
TCHAR szGameName[50+1];
s8 nCountryID;
// Copy of the ROM header
ROMHeader romheader;
// With changeable default values
uint32 dwFrameBufferOption;
uint32 dwRenderToTextureOption;
// Less useful options
BOOL bIncTexRectEdge;
BOOL bZHack;
BOOL bPrimaryDepthHack;
BOOL bTexture1Hack;
BOOL bDisableCulling;
int VIWidth;
int VIHeight;
uint32 UseCIWidthAndRatio;
BOOL bTxtSizeMethod2;
BOOL bEnableTxtLOD;
} GameSetting, *LPGAMESETTING;
extern GameSetting g_curRomInfo;
void ROM_GetRomNameFromHeader(TCHAR * szName, ROMHeader * pHdr);
#define TV_SYSTEM_NTSC 1
#define TV_SYSTEM_PAL 0
uint32 CountryCodeToTVSystem(uint32 countryCode);
enum {
PSH_OPTIONS,
PSH_ROM_SETTINGS,
};
void CreateOptionsDialogs(HWND hParent);
#endif