diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index e1c68211..c163da34 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -421,7 +421,7 @@ ExtraSaveSlots=0 ;AutoQuickSave sets how many save slots on a page you want to use for quick saving (valid range: 1..10) ;AutoQuickSavePage is the page number to use (valid range: 1..1000) if ExtraSaveSlots is enabled ;The quick saves will be rotated from the first slot on the page to the n-th slot -;Set to 0 to disable. AutoQuickSave will use page 1 if AutoQuickSavePage is disabled +;Set to 0 to disable. AutoQuickSave will use the current selected page if AutoQuickSavePage is disabled AutoQuickSave=0 AutoQuickSavePage=0 diff --git a/sfall/Modules/ExtraSaveSlots.cpp b/sfall/Modules/ExtraSaveSlots.cpp index 4871fedc..17a0a942 100644 --- a/sfall/Modules/ExtraSaveSlots.cpp +++ b/sfall/Modules/ExtraSaveSlots.cpp @@ -419,7 +419,7 @@ static void CreateSaveComment(char* bufstr) { } static DWORD autoQuickSave = 0; -static DWORD quickSavePage = 0; +static long quickSavePage = 0; static FILETIME ftPrevSlot; static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) { @@ -433,7 +433,7 @@ static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) { || (ftCurrSlot.dwHighDateTime == ftPrevSlot.dwHighDateTime && ftCurrSlot.dwLowDateTime > ftPrevSlot.dwLowDateTime)) { ftPrevSlot.dwHighDateTime = ftCurrSlot.dwHighDateTime; ftPrevSlot.dwLowDateTime = ftCurrSlot.dwLowDateTime; - if (++currSlot > 9 || currSlot > autoQuickSave) { + if (++currSlot > autoQuickSave) { currSlot = 0; } else { fo::var::slot_cursor = currSlot; @@ -481,20 +481,20 @@ void ExtraSaveSlots::init() { } autoQuickSave = GetConfigInt("Misc", "AutoQuickSave", 0); - quickSavePage = GetConfigInt("Misc", "AutoQuickSavePage", 0); - if (autoQuickSave >= 1 && autoQuickSave <= 10) { + if (autoQuickSave > 0) { dlog("Applying auto quick save patch.", DL_INIT); - autoQuickSave--; - if (quickSavePage > 0) { - if (quickSavePage > 1000) quickSavePage = 1000; - quickSavePage = (quickSavePage - 1) * 10; - } + if (autoQuickSave > 10) autoQuickSave = 10; + autoQuickSave--; // reserved slot count - if (extraSaveSlots) { + quickSavePage = GetConfigInt("Misc", "AutoQuickSavePage", 0); + if (quickSavePage > 1000) quickSavePage = 1000; + + if (extraSaveSlots && quickSavePage > 0) { + quickSavePage = (quickSavePage - 1) * 10; MakeCall(0x47B923, SaveGame_hack1, 1); } else { SafeWrite8(0x47B923, 0x89); - SafeWrite32(0x47B924, 0x5193B83D); // mov [slot_cursor], edi(0) + SafeWrite32(0x47B924, 0x5193B83D); // mov [slot_cursor], edi = 0 } MakeJump(0x47B984, SaveGame_hack0); dlogr(" Done", DL_INIT);