diff --git a/desmume/src/movie.cpp b/desmume/src/movie.cpp index 0a7a67794..1360c91d8 100644 --- a/desmume/src/movie.cpp +++ b/desmume/src/movie.cpp @@ -176,7 +176,7 @@ MovieData::MovieData() void MovieData::truncateAt(int frame) { - if(records.size() < frame) + if(records.size() > frame) records.resize(frame); } @@ -727,6 +727,8 @@ void _CDECL_ FCEUI_SaveMovie(const char *fname, std::wstring author, int flag, s assert(nds.touchX == input.touch.touchX && nds.touchY == input.touch.touchY); assert((mr.touch.x << 4) == nds.touchX && (mr.touch.y << 4) == nds.touchY); + currMovieData.truncateAt(currFrameCounter); + mr.dump(&currMovieData, osRecordingMovie,currMovieData.records.size()); currMovieData.records.push_back(mr); @@ -864,9 +866,6 @@ bool mov_loadstate(EMUFILE* fp, int size) if(!movie_readonly) { - ////truncate before we copy, just to save some time - //tempMovieData.truncateAt(currFrameCounter); // disabled because this can really screw things up and shouldn't usually be faster - currMovieData = tempMovieData; currMovieData.rerecordCount = currRerecordCount; } diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 3d5c5bfd0..645d2af55 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2806,7 +2806,6 @@ void CloseRom() NDS_Reset(); } -//TODO - async key state? for real? int GetModifiers(int key) { int modifiers = 0; @@ -2814,9 +2813,9 @@ int GetModifiers(int key) if (key == VK_MENU || key == VK_CONTROL || key == VK_SHIFT) return 0; - if(GetAsyncKeyState(VK_MENU )&0x8000) modifiers |= CUSTKEY_ALT_MASK; - if(GetAsyncKeyState(VK_CONTROL)&0x8000) modifiers |= CUSTKEY_CTRL_MASK; - if(GetAsyncKeyState(VK_SHIFT )&0x8000) modifiers |= CUSTKEY_SHIFT_MASK; + if(GetKeyState(VK_MENU )&0x8000) modifiers |= CUSTKEY_ALT_MASK; + if(GetKeyState(VK_CONTROL)&0x8000) modifiers |= CUSTKEY_CTRL_MASK; + if(GetKeyState(VK_SHIFT )&0x8000) modifiers |= CUSTKEY_SHIFT_MASK; return modifiers; } diff --git a/desmume/src/windows/snddx.cpp b/desmume/src/windows/snddx.cpp index ac7754b16..ac71a19d4 100755 --- a/desmume/src/windows/snddx.cpp +++ b/desmume/src/windows/snddx.cpp @@ -122,7 +122,8 @@ int SNDDXInit(int buffersize) return -1; } - soundbufsize = buffersize * 2 * 2; + soundbufsize = buffersize * 2; // caller already multiplies buffersize by 2 + soundoffset = 0; memset(&wfx, 0, sizeof(wfx)); wfx.wFormatTag = WAVE_FORMAT_PCM;