diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index e2f1b253..231a7f62 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -1998,6 +1998,9 @@ void clearwin() { case 16: _asm { + push es + mov ax,ds + mov es,ax xor eax,eax mov edi,SurfBufD xor ebx,ebx @@ -2005,17 +2008,20 @@ void clearwin() xor eax,eax mov ecx,SurfaceX rep stosw - mov SurfaceX,edx add edi,Temp1 - shl edx,1 + sub edi,SurfaceX + sub edi,SurfaceX add ebx,1 - sub edx,edi cmp ebx,SurfaceY jne Blank2 + pop es // BUGFIX } break; case 32: _asm { + push es + mov ax,ds + mov es,ax xor eax,eax mov edi,SurfBufD xor ebx,ebx @@ -2031,6 +2037,7 @@ void clearwin() add ebx,1 cmp ebx,SurfaceY jne Blank3 + pop es // BUGFIX } break; }