2 * Glide64 - Glide video plugin for Nintendo 64 emulators.
3 * Copyright (c) 2010 Jon Ring
4 * Copyright (c) 2002 Dave2001
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * Licence along with this program; if not, write to the Free
18 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA
28 static m64p_handle video_general_section;
29 static m64p_handle video_glide64_section;
34 if (ConfigOpenSection("Video-General", &video_general_section) != M64ERR_SUCCESS ||
35 ConfigOpenSection("Video-Glide64mk2", &video_glide64_section) != M64ERR_SUCCESS)
37 ERRLOG("Could not open configuration");
40 ConfigSetDefaultBool(video_general_section, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False");
41 ConfigSetDefaultInt(video_general_section, "ScreenWidth", 640, "Width of output window or fullscreen width");
42 ConfigSetDefaultInt(video_general_section, "ScreenHeight", 480, "Height of output window or fullscreen height");
47 int Config_ReadScreenInt(const char *itemname)
49 return ConfigGetParamInt(video_general_section, itemname);
52 PackedScreenResolution Config_ReadScreenSettings()
54 PackedScreenResolution packedResolution;
56 packedResolution.width = ConfigGetParamInt(video_general_section, "ScreenWidth");
57 packedResolution.height = ConfigGetParamInt(video_general_section, "ScreenHeight");
58 packedResolution.fullscreen = ConfigGetParamBool(video_general_section, "Fullscreen");
60 return packedResolution;
63 BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean)
65 VLOG("Getting value %s", itemname);
68 ConfigSetDefaultBool(video_glide64_section, itemname, def_value, desc);
69 return ConfigGetParamBool(video_glide64_section, itemname);
73 ConfigSetDefaultInt(video_glide64_section, itemname, def_value, desc);
74 return ConfigGetParamInt(video_glide64_section, itemname);
80 // Resolutions, MUST be in the correct order (SST1VID.H)
81 wxUint32 resolutions[0x18][2] = {
114 if(INI_FindSection("SETTINGS",FALSE) == FALSE) {
116 ERRLOG("Could not open configuration");
122 int Config_ReadScreenInt(const char *itemname) {
123 int res_data = Config_ReadInt("resolution", NULL, 7, FALSE, FALSE);
124 if(!strcmp("ScreenWidth", itemname))
125 return resolutions[res_data][0];
126 else if(!strcmp("ScreenHeight", itemname))
127 return resolutions[res_data][1];
131 BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean) {
132 VLOG("Getting value %s", itemname);
133 int z = INI_ReadInt(itemname, def_value, FALSE);
134 if(isBoolean) z=(z && 1);
140 #ifdef TEXTURE_FILTER
141 wxUint32 texfltr[] = {
143 SMOOTH_FILTER_1, //"Smooth filtering 1"
144 SMOOTH_FILTER_2, //"Smooth filtering 2"
145 SMOOTH_FILTER_3, //"Smooth filtering 3"
146 SMOOTH_FILTER_4, //"Smooth filtering 4"
147 SHARP_FILTER_1, //"Sharp filtering 1"
148 SHARP_FILTER_2, //"Sharp filtering 2"
151 wxUint32 texenht[] = {
152 NO_ENHANCEMENT, //"None"
153 NO_ENHANCEMENT, //"Store"
154 X2_ENHANCEMENT, //"X2"
155 X2SAI_ENHANCEMENT, //"X2SAI"
156 HQ2X_ENHANCEMENT, //"HQ2X"
157 HQ2XS_ENHANCEMENT, //"HQ2XS"
158 LQ2X_ENHANCEMENT, //"LQ2X"
159 LQ2XS_ENHANCEMENT, //"LQ2XS"
160 HQ4X_ENHANCEMENT, //"HQ4X"
163 wxUint32 texcmpr[] = {
164 //NO_COMPRESSION, //"None"
165 // NCC_COMPRESSION, //"NCC"
166 S3TC_COMPRESSION, //"S3TC"
167 FXT1_COMPRESSION, //"FXT1"
170 wxUint32 texhirs[] = {
171 NO_HIRESTEXTURES, //"Do not use"
172 RICE_HIRESTEXTURES, //"Rice format"
173 // GHQ_HIRESTEXTURES, //"GlideHQ format"
174 // JABO_HIRESTEXTURES, //"Jabo format"