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))) {