2 Copyright (C) 2002 Rice1964
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef _RICE_CONFIG_H_
21 #define _RICE_CONFIG_H_
40 } SupportedDeviceType;
42 enum DirectXCombinerType
60 SupportedDeviceType type;
61 } RenderEngineSetting;
67 FRM_BUF_BASIC_AND_WRITEBACK,
68 FRM_BUF_WRITEBACK_AND_RELOAD,
70 FRM_BUF_WITH_EMULATOR,
71 FRM_BUF_BASIC_AND_WITH_EMULATOR,
72 FRM_BUF_WITH_EMULATOR_READ_ONLY,
73 FRM_BUF_WITH_EMULATOR_WRITE_ONLY,
77 FRM_BUF_WRITEBACK_NORMAL,
78 FRM_BUF_WRITEBACK_1_2,
79 FRM_BUF_WRITEBACK_1_3,
80 FRM_BUF_WRITEBACK_1_4,
81 FRM_BUF_WRITEBACK_1_5,
82 FRM_BUF_WRITEBACK_1_6,
83 FRM_BUF_WRITEBACK_1_7,
84 FRM_BUF_WRITEBACK_1_8,
92 TXT_BUF_WRITE_BACK_AND_RELOAD,
102 FORCE_DEFAULT_FILTER,
108 TEXTURE_NO_MIPMAP = 0,
110 TEXTURE_BILINEAR_FILTER,
111 TEXTURE_TRILINEAR_FILTER,
115 TEXTURE_NO_ENHANCEMENT,
116 TEXTURE_2X_ENHANCEMENT,
117 TEXTURE_2XSAI_ENHANCEMENT,
118 TEXTURE_HQ2X_ENHANCEMENT,
119 TEXTURE_LQ2X_ENHANCEMENT,
120 TEXTURE_HQ4X_ENHANCEMENT,
121 TEXTURE_SHARPEN_ENHANCEMENT,
122 TEXTURE_SHARPEN_MORE_ENHANCEMENT,
128 TEXTURE_ENHANCEMENT_NORMAL,
129 TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1,
130 TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2,
131 TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3,
132 TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4,
136 SCREEN_UPDATE_DEFAULT = 0,
137 SCREEN_UPDATE_AT_VI_UPDATE = 1,
138 SCREEN_UPDATE_AT_VI_CHANGE = 2,
139 SCREEN_UPDATE_AT_CI_CHANGE = 3,
140 SCREEN_UPDATE_AT_1ST_CI_CHANGE = 4,
141 SCREEN_UPDATE_AT_1ST_PRIMITIVE = 5,
142 SCREEN_UPDATE_BEFORE_SCREEN_CLEAR = 6,
143 SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN = 7, // Update screen at VI origin is updated and the screen has been drawn
147 ONSCREEN_DISPLAY_NOTHING = 0,
148 ONSCREEN_DISPLAY_DLIST_PER_SECOND,
149 ONSCREEN_DISPLAY_FRAME_PER_SECOND,
150 ONSCREEN_DISPLAY_DEBUG_INFORMATION_ONLY,
151 ONSCREEN_DISPLAY_TEXT_FROM_CORE_ONLY,
152 ONSCREEN_DISPLAY_DLIST_PER_SECOND_WITH_CORE_MSG,
153 ONSCREEN_DISPLAY_FRAME_PER_SECOND_WITH_CORE_MSG,
154 ONSCREEN_DISPLAY_DEBUG_INFORMATION_WITH_CORE_MSG,
160 HACK_FOR_BANJO_TOOIE,
163 HACK_FOR_MARIO_TENNIS,
167 HACK_FOR_PILOT_WINGS,
172 HACK_FOR_SUPER_BOWLING,
174 HACK_FOR_ALL_STAR_BASEBALL,
175 HACK_FOR_TIGER_HONEY_HUNT,
176 HACK_REVERSE_XY_COOR,
180 HACK_FOR_COMMANDCONQUER,
182 HACK_FOR_SOUTH_PARK_RALLY,
183 HACK_FOR_BUST_A_MOVE,
184 HACK_FOR_OGRE_BATTLE,
187 HACK_FOR_ROGUE_SQUADRON,
190 HACK_FOR_POLARISSNOCROSS,
191 HACK_FOR_TOPGEARRALLY,
198 NOT_USE_CI_WIDTH_AND_RATIO,
199 USE_CI_WIDTH_AND_RATIO_FOR_NTSC,
200 USE_CI_WIDTH_AND_RATIO_FOR_PAL,
206 BOOL bOGLVertexClipper;
208 BOOL bEnableVertexShader;
217 uint32 forceTextureFilter;
218 uint32 textureEnhancement;
219 uint32 textureEnhancementControl;
220 uint32 textureQuality;
221 uint32 anisotropicFiltering;
222 uint32 multiSampling;
224 BOOL bSmallTextureOnly;
225 BOOL bDumpTexturesToFiles;
226 BOOL bLoadHiResTextures;
227 BOOL bLoadHiResCRCOnly;
229 int OpenglDepthBufferSetting;
230 int OpenglRenderSetting;
233 HACK_FOR_GAMES enableHackForGames;
239 bool bCheckBackBufs; // Check texture again against the recent backbuffer addresses
240 bool bWriteBackBufToRDRAM; // If a recent backbuffer is used, write its content back to RDRAM
241 bool bLoadBackBufFromRDRAM; // Load content from RDRAM and draw into backbuffer
242 bool bIgnore; // Ignore all rendering into texture buffers
244 bool bSupportRenderTextures; // Support render-to-texture
245 bool bCheckRenderTextures; // Check texture again against the the last render_texture addresses
246 bool bRenderTextureWriteBack; // Write back render_texture into RDRAM
247 bool bLoadRDRAMIntoRenderTexture; // Load RDRAM content and render into render_texture
249 bool bAtEachFrameUpdate; // Reload and write back at each frame buffer and CI update
251 bool bProcessCPUWrite;
252 bool bProcessCPURead;
254 bool bFillRectNextTextureBuffer;
255 bool bIgnoreRenderTextureIfHeightUnknown;
257 } FrameBufferOptions;
260 uint32 N64FrameBufferEmuType;
261 uint32 N64FrameBufferWriteBackControl;
262 uint32 N64RenderToTextureEmuType;
263 uint32 screenUpdateSetting;
264 BOOL bNormalCombiner;
267 BOOL bAccurateTextureMapping;
268 BOOL bInN64Resolution;
269 BOOL bDoubleSizeForSmallTxtrBuf;
273 typedef struct IniSection
279 // Options with changeable default values
280 uint32 dwNormalCombiner;
281 uint32 dwNormalBlender;
282 uint32 dwFastTextureCRC;
283 uint32 dwAccurateTextureMapping;
284 uint32 dwFrameBufferOption;
285 uint32 dwRenderToTextureOption;
286 uint32 dwScreenUpdateSetting;
288 // Options with FALSE as default values
289 BOOL bDisableBlender;
290 BOOL bForceScreenClear;
292 BOOL bForceDepthBuffer;
294 // Less useful options
296 BOOL bDisableTextureCRC;
297 BOOL bIncTexRectEdge;
299 BOOL bTextureScaleHack;
301 BOOL bUseSmallerTexture;
302 BOOL bPrimaryDepthHack;
304 BOOL bDisableCulling;
308 uint32 UseCIWidthAndRatio;
311 BOOL bTxtSizeMethod2;
317 uint8 x1, x2, x3, x4;
319 uint32 dwBootAddressOffset;
336 // Other info from the rom. This is for convenience
337 unsigned char szGameName[50+1];
340 // Copy of the ROM header
343 // With changeable default values
344 uint32 dwNormalCombiner;
345 uint32 dwNormalBlender;
346 uint32 dwAccurateTextureMapping;
347 uint32 dwFastTextureCRC;
348 uint32 dwFrameBufferOption;
349 uint32 dwRenderToTextureOption;
350 uint32 dwScreenUpdateSetting;
352 // With FALSE as its default values
353 BOOL bForceScreenClear;
355 BOOL bForceDepthBuffer;
356 BOOL bDisableBlender;
358 // Less useful options
360 BOOL bDisableTextureCRC;
361 BOOL bIncTexRectEdge;
363 BOOL bTextureScaleHack;
365 BOOL bUseSmallerTexture;
366 BOOL bPrimaryDepthHack;
368 BOOL bDisableCulling;
371 uint32 UseCIWidthAndRatio;
374 BOOL bTxtSizeMethod2;
376 } GameSetting, *LPGAMESETTING;
385 #define TV_SYSTEM_NTSC 1
386 #define TV_SYSTEM_PAL 0
388 extern GlobalOptions options;
389 extern FrameBufferOptions frameBufferOptions;
390 extern RomOptions defaultRomOptions;
391 extern RomOptions currentRomOptions;
392 extern const CountryIDInfo g_CountryCodeInfo[];
393 extern GameSetting g_curRomInfo;
394 extern bool bIniIsChanged;
395 extern char szIniFileName[300];
397 extern BOOL InitConfiguration(void);
398 extern BOOL LoadConfiguration(void);
399 extern void WriteIniFile();
400 extern BOOL ReadIniFile();
401 extern void OutputSectionDetails(uint32 i, FILE * fh);
402 extern void GenerateCurrentRomOptions();
403 extern void Ini_GetRomOptions(LPGAMESETTING pGameSetting);
404 extern void Ini_StoreRomOptions(LPGAMESETTING pGameSetting);
405 extern uint32 CountryCodeToTVSystem(uint32 countryCode);
406 extern void ROM_GetRomNameFromHeader(unsigned char * szName, ROMHeader * pHdr);