From 25c2789ca5348a395aee90e759c52fc704f42382 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 2 Jul 2010 18:56:05 +0000 Subject: [PATCH] win32: add an option to disable texturing, for debugging and educational purposes --- desmume/src/NDSSystem.h | 2 ++ desmume/src/gfx3d.cpp | 6 ++++++ desmume/src/windows/main.cpp | 9 ++++++--- desmume/src/windows/resource.h | 2 ++ desmume/src/windows/resources.rc | Bin 940126 -> 940396 bytes 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 7ca7b1eab..12b412581 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -510,6 +510,7 @@ extern struct TCommonSettings { : GFX3D_HighResolutionInterpolateColor(true) , GFX3D_EdgeMark(true) , GFX3D_Fog(true) + , GFX3D_Texture(true) , UseExtBIOS(false) , SWIFromBIOS(false) , PatchSWI3(false) @@ -546,6 +547,7 @@ extern struct TCommonSettings { bool GFX3D_HighResolutionInterpolateColor; bool GFX3D_EdgeMark; bool GFX3D_Fog; + bool GFX3D_Texture; bool UseExtBIOS; char ARM9BIOS[256]; diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index 06dd8c3eb..88a13042b 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -1613,6 +1613,7 @@ void gfx3d_UpdateToonTable(u8 offset, u16 val) { gfx3d.state.invalidateToon = true; gfx3d.state.u16ToonTable[offset] = val; + //printf("toon %d set to %04X\n",offset,val); } void gfx3d_UpdateToonTable(u8 offset, u32 val) @@ -1621,6 +1622,8 @@ void gfx3d_UpdateToonTable(u8 offset, u32 val) gfx3d.state.invalidateToon = true; gfx3d.state.u16ToonTable[offset] = val & 0xFFFF; gfx3d.state.u16ToonTable[offset+1] = val >> 16; + //printf("toon %d set to %04X\n",offset,gfx3d.state.u16ToonTable[offset]); + //printf("toon %d set to %04X\n",offset+1,gfx3d.state.u16ToonTable[offset+1]); } s32 gfx3d_GetClipMatrix (unsigned int index) @@ -2030,6 +2033,9 @@ static void gfx3d_doFlush() gfx3d.state.wbuffer = BIT1(gfx3d.state.activeFlushCommand); gfx3d.renderState = gfx3d.state; + + if(!CommonSettings.GFX3D_Texture) + gfx3d.renderState.enableTexturing = false; gfx3d.state.activeFlushCommand = gfx3d.state.pendingFlushCommand; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index e525b63e0..4f7396fb7 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2763,6 +2763,7 @@ int _main() CommonSettings.GFX3D_HighResolutionInterpolateColor = GetPrivateProfileBool("3D", "HighResolutionInterpolateColor", 1, IniName); CommonSettings.GFX3D_EdgeMark = GetPrivateProfileBool("3D", "EnableEdgeMark", 1, IniName); CommonSettings.GFX3D_Fog = GetPrivateProfileBool("3D", "EnableFog", 1, IniName); + CommonSettings.GFX3D_Texture = GetPrivateProfileBool("3D", "EnableTexture", 1, IniName); //CommonSettings.gfx3d_flushMode = GetPrivateProfileInt("3D", "AlternateFlush", 0, IniName); Change3DCoreWithFallbackAndSave(cur3DCore); @@ -5439,9 +5440,10 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) { int i; - CheckDlgButton(hw,IDC_INTERPOLATECOLOR,CommonSettings.GFX3D_HighResolutionInterpolateColor?1:0); - CheckDlgButton(hw,IDC_3DSETTINGS_EDGEMARK,CommonSettings.GFX3D_EdgeMark?1:0); - CheckDlgButton(hw,IDC_3DSETTINGS_FOG,CommonSettings.GFX3D_Fog?1:0); + CheckDlgButton(hw,IDC_INTERPOLATECOLOR,CommonSettings.GFX3D_HighResolutionInterpolateColor); + CheckDlgButton(hw,IDC_3DSETTINGS_EDGEMARK,CommonSettings.GFX3D_EdgeMark); + CheckDlgButton(hw,IDC_3DSETTINGS_FOG,CommonSettings.GFX3D_Fog); + CheckDlgButton(hw,IDC_3DSETTINGS_TEXTURE,CommonSettings.GFX3D_Texture); //CheckDlgButton(hw,IDC_ALTERNATEFLUSH,CommonSettings.gfx3d_flushMode); for(i = 0; core3DList[i] != NULL; i++) @@ -5461,6 +5463,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) CommonSettings.GFX3D_HighResolutionInterpolateColor = IsDlgCheckboxChecked(hw,IDC_INTERPOLATECOLOR); CommonSettings.GFX3D_EdgeMark = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_EDGEMARK); CommonSettings.GFX3D_Fog = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_FOG); + CommonSettings.GFX3D_Texture = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_TEXTURE); Change3DCoreWithFallbackAndSave(ComboBox_GetCurSel(GetDlgItem(hw, IDC_3DCORE))); WritePrivateProfileInt("3D", "HighResolutionInterpolateColor", CommonSettings.GFX3D_HighResolutionInterpolateColor?1:0, IniName); WritePrivateProfileInt("3D", "EnableEdgeMark", CommonSettings.GFX3D_EdgeMark?1:0, IniName); diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index ad5f6ccd1..da38e60e1 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -692,6 +692,8 @@ #define ID_LABEL_HK2 4466 #define IDC_GI_USEDROMSIZE 4467 #define ID_LABEL_HK3 4467 +#define IDC_3DSETTINGS_FOG2 4467 +#define IDC_3DSETTINGS_TEXTURE 4467 #define ID_LABEL_HK4 4468 #define IDC_GI_ICON 4469 #define ID_LABEL_HK5 4469 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 90f73bc85706ea90fe28e1369c649385272dad13..198d869e5350b868804fcb8912025bc8cf99004c 100644 GIT binary patch delta 346 zcmX}nze@sP90u_3dv~wi>*?We6gfx+Em3smVIruww3SF1lr+@PZeb7zaf4t(;f2GO z973TXBJ0TLT?-lya{Gu51?<0)F-#s)n>SCWO)xjFW--^0mr#$Y4b;!%5A2@HUtF)zw=`;HDT|p2 zR=~?Hbub%Z9umW+5KE!c3QX0Tb;)bMEEw>YZryq$v|p$XZ<`yFFuAZFQq$C$Mwc)Q&!4m-x_ z?|NAEwgF!}$jIzF z-A{@$YWjs97PjfP&atkV{%-*{8>8X$i;`^8(;fWST_!J>%))NWpu=Fu02LLu!0I=> zVIm7iS>jhN+vyYTFtKc3c7gQ>)8sRvM%(9HX6<8a=efoT#BAGnuCW&!MR!&^&{;st S3B+7L%nigmK&SHR>;eG4>|9;|