From 576255a0b839f596ee34a22fa4031fa873dfef11 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 7 Oct 2010 23:33:07 +0000 Subject: [PATCH] fix emulator crash caused by uninitialized blending table. now.. why did it only show up in linux? some nondeterminism difference between windows and linux emulation.... disturbing.... --- desmume/src/GPU.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index df4944882..f083ec8f9 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -196,6 +196,12 @@ void GPU_Reset(GPU *g, u8 l) { memset(g, 0, sizeof(GPU)); + //important for emulator stability for this to initialize, since we have to setup a table based on it + g->BLDALPHA_EVA = 0; + g->BLDALPHA_EVB = 0; + //make sure we have our blend table setup even if the game blends without setting the blend variables + g->updateBLDALPHA(); + g->setFinalColorBck_funcNum = 0; g->setFinalColor3d_funcNum = 0; g->setFinalColorSpr_funcNum = 0;