Skip to content

Commit d74ec5f

Browse files
committed
Removed ExtraSaveSlots from ddraw.ini (always enabled)
Changed the maximum number of save slots to 1000 (10k was overkill).
1 parent 45b1cce commit d74ec5f

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

artifacts/ddraw.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,14 +514,15 @@ UseScrollingQuestsList=1
514514
;ConsoleOutputPath=console.txt
515515

516516
;Set to 1 to add additional pages of save slots
517-
ExtraSaveSlots=0
517+
;This option is always enabled in 4.4.10/3.8.50 or later and cannot be disabled (kept for reference only)
518+
ExtraSaveSlots=1
518519

519-
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand, set the next two lines
520+
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand, set the next two options
520521
;Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
521-
;AutoQuickSave sets how many pages you want to use for quick saving (valid range: 1..10)
522+
;AutoQuickSave sets the number of pages used for quick saving (valid range: 1..10)
522523
;Set to 0 to disable
523524
AutoQuickSave=0
524-
;AutoQuickSavePage is the page number to start at if ExtraSaveSlots is enabled (valid range: 0..999)
525+
;AutoQuickSavePage sets the starting page number for quick saving (valid range: 0..99)
525526
;Set to -1 to use the current selected page (not recommended)
526527
AutoQuickSavePage=1
527528

sfall/Modules/ExtraSaveSlots.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ long ExtraSaveSlots::GetSaveSlot() {
3737
}
3838

3939
void ExtraSaveSlots::SetSaveSlot(long page, long slot) {
40-
if (page >= 0 && page <= 9990) LSPageOffset = page - (page % 10);
40+
if (page >= 0 && page <= 990) LSPageOffset = page - (page % 10);
4141
if (slot >= 0 && slot < 10) fo::var::slot_cursor = slot;
4242
}
4343

@@ -67,7 +67,7 @@ static void LoadPageOffsets() {
6767
fo::var::slot_cursor = 0;
6868
}
6969
LSPageOffset = IniReader::GetInt("POSITION", "PageOffset", 0, LoadPath);
70-
if (LSPageOffset > 9990) {
70+
if (LSPageOffset > 990) {
7171
LSPageOffset = 0;
7272
}
7373
}
@@ -116,7 +116,7 @@ static void SetPageNum() {
116116

117117
DWORD NewTick = 0, OldTick = 0;
118118
int button = 0, exitFlag = 0, numpos = 0;
119-
char Number[4], blip = '_';
119+
char Number[3], blip = '_';
120120

121121
DWORD tempPageOffset = -1;
122122

@@ -161,7 +161,7 @@ static void SetPageNum() {
161161

162162
button = fo::func::get_input();
163163
if (button >= '0' && button <= '9') {
164-
if (numpos < 3) {
164+
if (numpos < 2) {
165165
Number[numpos] = button;
166166
Number[numpos + 1] = '\0';
167167
numpos++;
@@ -172,7 +172,7 @@ static void SetPageNum() {
172172
tempPageOffset = (atoi(Number)) * 10;
173173
}
174174
}
175-
//else exitFlag=-1;
175+
//else exitFlag = -1;
176176
} else if (button == 0x08 && numpos) {
177177
numpos--;
178178
Number[numpos] = '\0';
@@ -188,7 +188,7 @@ static void SetPageNum() {
188188
}
189189
}
190190

191-
if (tempPageOffset != -1 && tempPageOffset <= 9990) {
191+
if (tempPageOffset != -1 && tempPageOffset <= 990) {
192192
LSPageOffset = tempPageOffset;
193193
}
194194

@@ -199,22 +199,22 @@ static long __fastcall CheckPage(long button) {
199199
switch (button) {
200200
case 0x14B: // left button
201201
LSPageOffset -= 10;
202-
if (LSPageOffset < 0) LSPageOffset += 10000; // to the last page
202+
if (LSPageOffset < 0) LSPageOffset += 1000; // to the last page
203203
__asm call fo::funcoffs::gsound_red_butt_press_;
204204
break;
205205
case 0x149: // fast left PGUP button
206206
LSPageOffset -= 100;
207-
if (LSPageOffset < 0) LSPageOffset += 10000;
207+
if (LSPageOffset < 0) LSPageOffset += 1000;
208208
__asm call fo::funcoffs::gsound_red_butt_press_;
209209
break;
210210
case 0x14D: // right button
211211
LSPageOffset += 10;
212-
if (LSPageOffset >= 10000) LSPageOffset -= 10000; // to the first page
212+
if (LSPageOffset >= 1000) LSPageOffset -= 1000; // to the first page
213213
__asm call fo::funcoffs::gsound_red_butt_press_;
214214
break;
215215
case 0x151: // fast right PGDN button
216216
LSPageOffset += 100;
217-
if (LSPageOffset >= 10000) LSPageOffset -= 10000;
217+
if (LSPageOffset >= 1000) LSPageOffset -= 1000;
218218
__asm call fo::funcoffs::gsound_red_butt_press_;
219219
break;
220220
case 'p': // p/P button pressed - start SetPageNum func
@@ -468,7 +468,7 @@ static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) {
468468
if (++currentPageCount >= quickSavePageCount) {
469469
currentPageCount = 0;
470470
quickSavePage = quickSavePageInit;
471-
} else if (quickSavePage <= 9980) {
471+
} else if (quickSavePage <= 980) {
472472
quickSavePage += 10;
473473
}
474474
}
@@ -524,29 +524,29 @@ long ExtraSaveSlots::GetQuickSaveSlot() {
524524
void ExtraSaveSlots::SetQuickSaveSlot(long page, long slot, long check) {
525525
if (page < 0) {
526526
quickSavePage = -1;
527-
} else if (page <= 9990) {
527+
} else if (page <= 990) {
528528
quickSavePage = page - (page % 10);
529529
}
530530
if (slot >= 0 && slot < 10) quickSaveSlot = slot;
531531
dontCheckSlot = check;
532532
}
533533

534534
void ExtraSaveSlots::init() {
535-
bool extraSaveSlots = (IniReader::GetConfigInt("Misc", "ExtraSaveSlots", 0) != 0);
536-
if (extraSaveSlots) {
535+
//bool extraSaveSlots = (IniReader::GetConfigInt("Misc", "ExtraSaveSlots", 1) != 0);
536+
//if (extraSaveSlots) {
537537
dlogr("Applying extra save slots patch.", DL_INIT);
538538
EnableSuperSaving();
539-
}
539+
//}
540540

541541
quickSavePageCount = IniReader::GetConfigInt("Misc", "AutoQuickSave", 0);
542542
if (quickSavePageCount > 0) {
543543
dlogr("Applying auto quick save patch.", DL_INIT);
544544
if (quickSavePageCount > 10) quickSavePageCount = 10;
545545

546546
quickSavePage = IniReader::GetConfigInt("Misc", "AutoQuickSavePage", 1);
547-
if (quickSavePage > 999) quickSavePage = 999;
547+
if (quickSavePage > 99) quickSavePage = 99;
548548

549-
if (extraSaveSlots && quickSavePage >= 0) {
549+
if (/*extraSaveSlots &&*/ quickSavePage >= 0) {
550550
quickSavePage *= 10;
551551
quickSavePageInit = quickSavePage;
552552
}

0 commit comments

Comments
 (0)