Skip to content

Commit e9d85d2

Browse files
committed
Fixed AutoQuickSavePage option, now set value to -1 is used for saving in current(active) page.
Scripts functions read_byte/short/int/string no longer require the AllowUnsafeScripting option.
1 parent 81ddf7a commit e9d85d2

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

artifacts/ddraw.ini

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;sfall configuration settings
2-
;v4.1.2 - Extended version
2+
;v4.1.3 - Extended version
33

44
[Main]
55
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
@@ -408,10 +408,11 @@ ExtraSaveSlots=1
408408

409409
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand, set the next two lines
410410
;AutoQuickSave sets how many save slots on a page you want to use for quick saving (valid range: 1..10)
411+
;AutoQuickSavePage is the page number to use auto save (valid range: 0..999, if ExtraSaveSlots is enabled)
411412
;Quick save will cyclically overwrite the save from the first slot of the page to the slot specified in the parameter
412-
;Set to 0 to disable.
413+
;Set to 0 to disable
413414
AutoQuickSave=0
414-
;AutoQuickSavePage is the page number to use (valid range: 0..999) if ExtraSaveSlots is enabled
415+
;Set to -1, to use active selected page
415416
AutoQuickSavePage=1
416417

417418
;Set to 1 to speed up the HP/AC counter animations
@@ -588,8 +589,8 @@ DialogOptions9Lines=1
588589
;Set to 1 to leave the music playing in dialogue with talking heads
589590
EnableMusicInDialogue=0
590591

591-
;Set to 1 to prevent the player from running while sneaking without Silent Running perk
592-
DontTurnOffSneakIfYouRun=0
592+
;Set to 1 so that the sneak mode does not turn off when the "Run Always" option is set, without need to hold the Shift key
593+
DontTurnOffSneakIfYouRun=1
593594

594595
;Set to 1 to fix the bug that unable to sell used geiger counters or stealth boys
595596
CanSellUsedGeiger=1
@@ -649,7 +650,7 @@ AIDrugUsePerfFix=0
649650

650651
;Set to 1 to disables loading of all configuration settings of the game from the saved game, except the difficulty settings
651652
;Set to 2 also disables load the game/combat difficulty settings
652-
SkipLoadingGameSetting=0
653+
SkipLoadingGameSetting=1
653654

654655
;Set to 1 to displays the electric stats of the armor in the player's inventory
655656
;Set to 2 will replace the name of the player's character in the inventory by the health points
@@ -739,18 +740,20 @@ SkipSizeCheck=0
739740

740741
;Set to 1 to stop Fallout from deleting non readonly protos at startup
741742
;Has pretty nasty side effects when saving/reloading, so don't use for regular gameplay
743+
;It is not recommended to set for regular game
742744
DontDeleteProtos=0
743745

744746
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
745747
;Does not require sfall debugging mode
746748
AllowUnsafeScripting=0
747749

748750
;Set to 1 to force sfall to inject all hooks code into the game, even if corresponding hook scripts don't exist
751+
;It is not recommended to set for regular game
749752
InjectAllGameHooks=0
750753

751754
;These options control what output is saved in the debug log (sfall-log.txt)
752755
;Prints messages duing sfall initialization
753-
Init=0
756+
Init=1
754757
;Prints messages relating to hook scripts
755758
Hook=0
756759
;Prints messages relating to scripting

artifacts/scripting/sfall opcode list.txt

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

2-
*0x8156 - int read_byte(int address)
3-
*0x8157 - int read_short(int address)
4-
*0x8158 - int read_int(int address)
5-
*0x8159 - string read_string(int address)
2+
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
3+
4+
0x8156 - int read_byte(int address)
5+
0x8157 - int read_short(int address)
6+
0x8158 - int read_int(int address)
7+
0x8159 - string read_string(int address)
68

79
*0x81cf - void write_byte(int address, int value)
810
*0x81d0 - void write_short(int address, int value)
@@ -356,7 +358,3 @@
356358
0x827a - any sfall_func4(string funcName, arg1, arg2, arg3, arg4)
357359
0x827b - any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)
358360
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
359-
360-
361-
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
362-

sfall/Modules/ExtraSaveSlots.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,10 @@ static void CreateSaveComment(char* bufstr) {
440440
strcpy(bufstr, buf);
441441
}
442442

443-
static DWORD quickSavePage = 0, autoQuickSave = 0;
444-
443+
static DWORD autoQuickSave = 0;
444+
static long quickSavePage = 0;
445445
static FILETIME ftPrevSlot;
446+
446447
static DWORD __stdcall QuickSaveGame(fo::DbFile* file, char* filename) {
447448

448449
unsigned int currSlot = fo::var::slot_cursor;
@@ -513,9 +514,9 @@ void ExtraSaveSlots::init() {
513514

514515
quickSavePage = GetConfigInt("Misc", "AutoQuickSavePage", 0);
515516
if (quickSavePage > 999) quickSavePage = 999;
516-
quickSavePage *= 10;
517517

518-
if (extraSaveSlots && quickSavePage > 0) {
518+
if (extraSaveSlots && quickSavePage > -1) {
519+
quickSavePage *= 10;
519520
MakeCall(0x47B923, SaveGame_hack1, 1);
520521
} else {
521522
SafeWrite8(0x47B923, 0x89);

sfall/Modules/Scripting/Opcodes.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ void InitNewOpcodes() {
209209

210210
if (GetPrivateProfileIntA("Debugging", "AllowUnsafeScripting", 0, ::sfall::ddrawIni)) {
211211
dlogr(" Unsafe opcodes enabled.", DL_SCRIPT);
212-
opcodes[0x156] = op_read_byte;
213-
opcodes[0x157] = op_read_short;
214-
opcodes[0x158] = op_read_int;
215-
opcodes[0x159] = op_read_string;
216212
opcodes[0x1cf] = op_write_byte;
217213
opcodes[0x1d0] = op_write_short;
218214
opcodes[0x1d1] = op_write_int;
@@ -223,6 +219,10 @@ void InitNewOpcodes() {
223219
} else {
224220
dlogr(" Unsafe opcodes disabled.", DL_SCRIPT);
225221
}
222+
opcodes[0x156] = op_read_byte;
223+
opcodes[0x157] = op_read_short;
224+
opcodes[0x158] = op_read_int;
225+
opcodes[0x159] = op_read_string;
226226

227227
opcodes[0x15a] = op_set_pc_base_stat;
228228
opcodes[0x15b] = op_set_pc_extra_stat;

0 commit comments

Comments
 (0)