From 82904b4a746f8c957ca0f9a740f4a98c0f812f5a Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 25 May 2016 05:09:44 +0000 Subject: [PATCH] fix bug entering cheats with values > 7FFFFFFF --- desmume/src/windows/cheatsWin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desmume/src/windows/cheatsWin.cpp b/desmume/src/windows/cheatsWin.cpp index 4aeed1547..8c62f27c0 100644 --- a/desmume/src/windows/cheatsWin.cpp +++ b/desmume/src/windows/cheatsWin.cpp @@ -249,8 +249,11 @@ INT_PTR CALLBACK CheatsAddProc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam { u32 tmp_addr = 0; sscanf_s(editBuf[0], "%x", &tmp_addr); + + s64 val; + sscanf(editBuf[1],"%lld",&val); - if (cheats->add(searchAddSize, tmp_addr, atol(editBuf[1]), editBuf[2], searchAddFreeze)) + if (cheats->add(searchAddSize, tmp_addr, (u32)val, editBuf[2], searchAddFreeze)) { if ((searchAddMode == 0) || (cheats->save() && (searchAddMode == 1 || searchAddMode == 2))) {