From 5f23cb6bcdfcc4fb8bf3f56d581dfb3c655a71f9 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 12 Feb 2012 13:47:33 +0000 Subject: [PATCH] Debugging helper disabling a.nasm calls with OpenGL renderers. Uncomment #define DEBUG_VALGRIND_NO_SMC in duke3d.h to be able to valgrind --smc-check=none (or the default stack-only) with Polymost and Polymer renderers. git-svn-id: https://svn.eduke32.com/eduke32@2337 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/duke3d.h | 4 ++++ polymer/eduke32/source/game.c | 4 ++++ polymer/eduke32/source/sector.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index fd739fb08..2d0c8dad6 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -108,6 +108,10 @@ extern "C" { // JBF 20040604: sync is a function on some platforms #define sync dsync +// Uncomment the following to remove calls to a.nasm functions with the GL renderers +// so that debugging with valgrind --smc-check=none is possible: +//#define DEBUG_VALGRIND_NO_SMC + #include "namesdyn.h" #include "function.h" #include "macros.h" diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 33c86c934..d80c3ec1d 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3445,6 +3445,10 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) walock[TILE_SAVESHOT] = 199; if (waloff[TILE_SAVESHOT] == 0) allocache(&waloff[TILE_SAVESHOT],200*320,&walock[TILE_SAVESHOT]); +#ifdef DEBUG_VALGRIND_NO_SMC + Bmemset((void *)waloff[TILE_SAVESHOT], 0, 200*320); + return; +#endif setviewtotile(TILE_SAVESHOT,200L,320L); } else if (getrendermode() == 0 && ((ud.screen_tilting && p->rotscrnang) || ud.detail==0)) diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index d88dc4a21..9c670c569 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -369,6 +369,9 @@ void G_AnimateCamSprite(void) { int32_t i = camsprite; +#ifdef DEBUG_VALGRIND_NO_SMC + return; +#endif if (camsprite <= 0) return; if (T1 >= 4)