Path: blob/master/libmupen64plus/mupen64plus-video-rice/src/Config.h
2 views
/*1Copyright (C) 2002 Rice196423This program is free software; you can redistribute it and/or4modify it under the terms of the GNU General Public License5as published by the Free Software Foundation; either version 26of the License, or (at your option) any later version.78This program is distributed in the hope that it will be useful,9but WITHOUT ANY WARRANTY; without even the implied warranty of10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11GNU General Public License for more details.1213You should have received a copy of the GNU General Public License14along with this program; if not, write to the Free Software15Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1617*/1819#ifndef _RICE_CONFIG_H_20#define _RICE_CONFIG_H_2122#include <stdio.h>2324#include "typedefs.h"2526typedef enum27{28OGL_DEVICE,29OGL_1_1_DEVICE,30OGL_1_2_DEVICE,31OGL_1_3_DEVICE,32OGL_1_4_DEVICE,33OGL_1_4_V2_DEVICE,34OGL_TNT2_DEVICE,35NVIDIA_OGL_DEVICE,36OGL_FRAGMENT_PROGRAM,3738DIRECTX_DEVICE,39} SupportedDeviceType;4041enum DirectXCombinerType42{43DX_DISABLE_COMBINER,44DX_BEST_FIT,45DX_LOW_END,46DX_HIGH_END,47DX_NVIDIA_TNT,48DX_2_STAGES,49DX_3_STAGES,50DX_4_STAGES,51DX_PIXEL_SHADER,52DX_SEMI_PIXEL_SHADER,53};545556typedef struct57{58const char* name;59SupportedDeviceType type;60} RenderEngineSetting;6162enum {63FRM_BUF_NONE,64FRM_BUF_IGNORE,65FRM_BUF_BASIC,66FRM_BUF_BASIC_AND_WRITEBACK,67FRM_BUF_WRITEBACK_AND_RELOAD,68FRM_BUF_COMPLETE,69FRM_BUF_WITH_EMULATOR,70FRM_BUF_BASIC_AND_WITH_EMULATOR,71FRM_BUF_WITH_EMULATOR_READ_ONLY,72FRM_BUF_WITH_EMULATOR_WRITE_ONLY,73};7475enum {76FRM_BUF_WRITEBACK_NORMAL,77FRM_BUF_WRITEBACK_1_2,78FRM_BUF_WRITEBACK_1_3,79FRM_BUF_WRITEBACK_1_4,80FRM_BUF_WRITEBACK_1_5,81FRM_BUF_WRITEBACK_1_6,82FRM_BUF_WRITEBACK_1_7,83FRM_BUF_WRITEBACK_1_8,84};8586enum {87TXT_BUF_NONE,88TXT_BUF_IGNORE,89TXT_BUF_NORMAL,90TXT_BUF_WRITE_BACK,91TXT_BUF_WRITE_BACK_AND_RELOAD,92};9394enum {95TXT_QUALITY_DEFAULT,96TXT_QUALITY_32BIT,97TXT_QUALITY_16BIT,98};99100enum {101FORCE_DEFAULT_FILTER,102FORCE_POINT_FILTER,103FORCE_LINEAR_FILTER,104};105106enum {107TEXTURE_NO_MIPMAP = 0,108TEXTURE_NO_FILTER,109TEXTURE_BILINEAR_FILTER,110TEXTURE_TRILINEAR_FILTER,111};112113enum {114TEXTURE_NO_ENHANCEMENT,115TEXTURE_2X_ENHANCEMENT,116TEXTURE_2XSAI_ENHANCEMENT,117TEXTURE_HQ2X_ENHANCEMENT,118TEXTURE_LQ2X_ENHANCEMENT,119TEXTURE_HQ4X_ENHANCEMENT,120TEXTURE_SHARPEN_ENHANCEMENT,121TEXTURE_SHARPEN_MORE_ENHANCEMENT,122TEXTURE_EXTERNAL,123TEXTURE_MIRRORED,124};125126enum {127TEXTURE_ENHANCEMENT_NORMAL,128TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1,129TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_2,130TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_3,131TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_4,132};133134enum {135SCREEN_UPDATE_DEFAULT = 0,136SCREEN_UPDATE_AT_VI_UPDATE = 1,137SCREEN_UPDATE_AT_VI_CHANGE = 2,138SCREEN_UPDATE_AT_CI_CHANGE = 3,139SCREEN_UPDATE_AT_1ST_CI_CHANGE = 4,140SCREEN_UPDATE_AT_1ST_PRIMITIVE = 5,141SCREEN_UPDATE_BEFORE_SCREEN_CLEAR = 6,142SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN = 7, // Update screen at VI origin is updated and the screen has been drawn143};144145enum {146ONSCREEN_DISPLAY_NOTHING = 0,147ONSCREEN_DISPLAY_DLIST_PER_SECOND,148ONSCREEN_DISPLAY_FRAME_PER_SECOND,149ONSCREEN_DISPLAY_DEBUG_INFORMATION_ONLY,150ONSCREEN_DISPLAY_TEXT_FROM_CORE_ONLY,151ONSCREEN_DISPLAY_DLIST_PER_SECOND_WITH_CORE_MSG,152ONSCREEN_DISPLAY_FRAME_PER_SECOND_WITH_CORE_MSG,153ONSCREEN_DISPLAY_DEBUG_INFORMATION_WITH_CORE_MSG,154};155156enum HACK_FOR_GAMES157{158NO_HACK_FOR_GAME,159HACK_FOR_BANJO_TOOIE,160HACK_FOR_DR_MARIO,161HACK_FOR_ZELDA,162HACK_FOR_MARIO_TENNIS,163HACK_FOR_BANJO,164HACK_FOR_PD,165HACK_FOR_GE,166HACK_FOR_PILOT_WINGS,167HACK_FOR_YOSHI,168HACK_FOR_NITRO,169HACK_FOR_TONYHAWK,170HACK_FOR_NASCAR,171HACK_FOR_SUPER_BOWLING,172HACK_FOR_CONKER,173HACK_FOR_ALL_STAR_BASEBALL,174HACK_FOR_TIGER_HONEY_HUNT,175HACK_REVERSE_XY_COOR,176HACK_REVERSE_Y_COOR,177HACK_FOR_GOLDEN_EYE,178HACK_FOR_FZERO,179HACK_FOR_COMMANDCONQUER,180HACK_FOR_RUMBLE,181HACK_FOR_SOUTH_PARK_RALLY,182HACK_FOR_BUST_A_MOVE,183HACK_FOR_OGRE_BATTLE,184HACK_FOR_TWINE,185HACK_FOR_EXTREME_G2,186HACK_FOR_ROGUE_SQUADRON,187HACK_FOR_MARIO_GOLF,188HACK_FOR_MLB,189HACK_FOR_POLARISSNOCROSS,190HACK_FOR_TOPGEARRALLY,191HACK_FOR_DUKE_NUKEM,192HACK_FOR_ZELDA_MM,193HACK_FOR_MARIO_KART,194};195196enum {197NOT_USE_CI_WIDTH_AND_RATIO,198USE_CI_WIDTH_AND_RATIO_FOR_NTSC,199USE_CI_WIDTH_AND_RATIO_FOR_PAL,200};201202typedef struct {203BOOL bEnableHacks;204BOOL bWinFrameMode;205BOOL bOGLVertexClipper;206BOOL bEnableSSE;207BOOL bEnableVertexShader;208BOOL bSkipFrame;209BOOL bFullTMEM;210BOOL bUseFullTMEM;211212BOOL bShowFPS;213214uint32 mipmapping;215uint32 fogMethod;216uint32 forceTextureFilter;217uint32 textureEnhancement;218uint32 textureEnhancementControl;219uint32 textureQuality;220uint32 anisotropicFiltering;221uint32 multiSampling;222BOOL bTexRectOnly;223BOOL bSmallTextureOnly;224BOOL bDumpTexturesToFiles;225BOOL bLoadHiResTextures;226BOOL bLoadHiResCRCOnly;227228int OpenglDepthBufferSetting;229int OpenglRenderSetting;230uint32 colorQuality;231232HACK_FOR_GAMES enableHackForGames;233} GlobalOptions;234235typedef struct {236bool bUpdateCIInfo;237238bool bCheckBackBufs; // Check texture again against the recent backbuffer addresses239bool bWriteBackBufToRDRAM; // If a recent backbuffer is used, write its content back to RDRAM240bool bLoadBackBufFromRDRAM; // Load content from RDRAM and draw into backbuffer241bool bIgnore; // Ignore all rendering into texture buffers242243bool bSupportRenderTextures; // Support render-to-texture244bool bCheckRenderTextures; // Check texture again against the the last render_texture addresses245bool bRenderTextureWriteBack; // Write back render_texture into RDRAM246bool bLoadRDRAMIntoRenderTexture; // Load RDRAM content and render into render_texture247248bool bAtEachFrameUpdate; // Reload and write back at each frame buffer and CI update249250bool bProcessCPUWrite;251bool bProcessCPURead;252253bool bFillRectNextTextureBuffer;254bool bIgnoreRenderTextureIfHeightUnknown;255//bool bFillColor;256} FrameBufferOptions;257258typedef struct {259uint32 N64FrameBufferEmuType;260uint32 N64FrameBufferWriteBackControl;261uint32 N64RenderToTextureEmuType;262uint32 screenUpdateSetting;263BOOL bNormalCombiner;264BOOL bNormalBlender;265BOOL bFastTexCRC;266BOOL bAccurateTextureMapping;267BOOL bInN64Resolution;268BOOL bDoubleSizeForSmallTxtrBuf;269BOOL bSaveVRAM;270} RomOptions;271272typedef struct IniSection273{274bool bOutput;275char crccheck[50];276char name[50];277278// Options with changeable default values279uint32 dwNormalCombiner;280uint32 dwNormalBlender;281uint32 dwFastTextureCRC;282uint32 dwAccurateTextureMapping;283uint32 dwFrameBufferOption;284uint32 dwRenderToTextureOption;285uint32 dwScreenUpdateSetting;286287// Options with FALSE as default values288BOOL bDisableBlender;289BOOL bForceScreenClear;290BOOL bEmulateClear;291BOOL bForceDepthBuffer;292293// Less useful options294BOOL bDisableObjBG;295BOOL bDisableTextureCRC;296BOOL bIncTexRectEdge;297BOOL bZHack;298BOOL bTextureScaleHack;299BOOL bFastLoadTile;300BOOL bUseSmallerTexture;301BOOL bPrimaryDepthHack;302BOOL bTexture1Hack;303BOOL bDisableCulling;304305int VIWidth;306int VIHeight;307uint32 UseCIWidthAndRatio;308309uint32 dwFullTMEM;310BOOL bTxtSizeMethod2;311BOOL bEnableTxtLOD;312} section;313314struct ROMHeader315{316uint8 x1, x2, x3, x4;317uint32 dwClockRate;318uint32 dwBootAddressOffset;319uint32 dwRelease;320uint32 dwCRC1;321uint32 dwCRC2;322uint64 qwUnknown1;323char szName[20];324uint32 dwUnknown2;325uint16 wUnknown3;326uint8 nUnknown4;327uint8 nManufacturer;328uint16 wCartID;329s8 nCountryID;330uint8 nUnknown5;331};332333typedef struct334{335// Other info from the rom. This is for convenience336unsigned char szGameName[50+1];337s8 nCountryID;338339// Copy of the ROM header340ROMHeader romheader;341342// With changeable default values343uint32 dwNormalCombiner;344uint32 dwNormalBlender;345uint32 dwAccurateTextureMapping;346uint32 dwFastTextureCRC;347uint32 dwFrameBufferOption;348uint32 dwRenderToTextureOption;349uint32 dwScreenUpdateSetting;350351// With FALSE as its default values352BOOL bForceScreenClear;353BOOL bEmulateClear;354BOOL bForceDepthBuffer;355BOOL bDisableBlender;356357// Less useful options358BOOL bDisableObjBG;359BOOL bDisableTextureCRC;360BOOL bIncTexRectEdge;361BOOL bZHack;362BOOL bTextureScaleHack;363BOOL bFastLoadTile;364BOOL bUseSmallerTexture;365BOOL bPrimaryDepthHack;366BOOL bTexture1Hack;367BOOL bDisableCulling;368int VIWidth;369int VIHeight;370uint32 UseCIWidthAndRatio;371372uint32 dwFullTMEM;373BOOL bTxtSizeMethod2;374BOOL bEnableTxtLOD;375} GameSetting, *LPGAMESETTING;376377typedef struct378{379s8 nCountryID;380char* szName;381uint32 nTvType;382} CountryIDInfo;383384#define TV_SYSTEM_NTSC 1385#define TV_SYSTEM_PAL 0386387extern GlobalOptions options;388extern FrameBufferOptions frameBufferOptions;389extern RomOptions defaultRomOptions;390extern RomOptions currentRomOptions;391extern const CountryIDInfo g_CountryCodeInfo[];392extern GameSetting g_curRomInfo;393extern bool bIniIsChanged;394extern char szIniFileName[300];395396extern BOOL InitConfiguration(void);397extern BOOL LoadConfiguration(void);398extern void WriteIniFile();399extern BOOL ReadIniFile();400extern void OutputSectionDetails(uint32 i, FILE * fh);401extern void GenerateCurrentRomOptions();402extern void Ini_GetRomOptions(LPGAMESETTING pGameSetting);403extern void Ini_StoreRomOptions(LPGAMESETTING pGameSetting);404extern uint32 CountryCodeToTVSystem(uint32 countryCode);405extern void ROM_GetRomNameFromHeader(unsigned char * szName, ROMHeader * pHdr);406407#endif408409410411