Win32 - fix NDS_UnPause to not attempt to unpause if no ROM is loaded (causes a rom to try to be loaded and errors). NDS_Pause and NDS_UnPause only respond if paused = false or true respectively. Minor fix to Drag and Drop

This commit is contained in:
adelikat 2008-11-15 20:04:22 +00:00
parent b187f8d164
commit b5cd79371b
1 changed files with 16 additions and 10 deletions

View File

@ -989,19 +989,25 @@ DWORD WINAPI run()
void NDS_Pause() void NDS_Pause()
{ {
execute = FALSE; if (!paused)
paused = TRUE; {
SPU_Pause(1); execute = FALSE;
while (!paused) {} paused = TRUE;
printlog("Paused\n"); SPU_Pause(1);
while (!paused) {}
printlog("Paused\n");
}
} }
void NDS_UnPause() void NDS_UnPause()
{ {
paused = FALSE; if (romloaded && paused)
execute = TRUE; {
SPU_Pause(0); paused = FALSE;
printlog("Unpaused\n"); execute = TRUE;
SPU_Pause(0);
printlog("Unpaused\n");
}
} }
void StateSaveSlot(int num) void StateSaveSlot(int num)
@ -1693,8 +1699,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
EnableMenuItem(menu, IDM_GAME_INFO, MF_ENABLED); EnableMenuItem(menu, IDM_GAME_INFO, MF_ENABLED);
EnableMenuItem(menu, IDM_IMPORTBACKUPMEMORY, MF_ENABLED); EnableMenuItem(menu, IDM_IMPORTBACKUPMEMORY, MF_ENABLED);
romloaded = TRUE; romloaded = TRUE;
NDS_UnPause();
} }
NDS_UnPause();
} }
return 0; return 0;
case WM_MOUSEMOVE: case WM_MOUSEMOVE: