From d706e04b01edfaf7ee08e48adc5cdb520b3f31d8 Mon Sep 17 00:00:00 2001 From: Wipe Date: Sun, 23 Jun 2024 04:42:27 +0200 Subject: [PATCH] AllowUnsafeScripting 2 -> 1 - mode 1 forced, mode 2+ accepted (for old installs) - removed VOODOO_Init() call without lookup table stuff, patches using VOODOO_Alloc() shouldn't be used anymore - deprecated VOOOO_close_game --- .../source/scripts/GlobalScripts/gl_0.ssl | 21 +++++++------------ .../Mapper/source/scripts/headers/voodoo.h | 2 ++ Fallout2/Fallout1in2/ddraw.fo1in2.ini | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Fallout2/Fallout1in2/Mapper/source/scripts/GlobalScripts/gl_0.ssl b/Fallout2/Fallout1in2/Mapper/source/scripts/GlobalScripts/gl_0.ssl index 577cb063c..bfebbcb6f 100644 --- a/Fallout2/Fallout1in2/Mapper/source/scripts/GlobalScripts/gl_0.ssl +++ b/Fallout2/Fallout1in2/Mapper/source/scripts/GlobalScripts/gl_0.ssl @@ -22,7 +22,7 @@ procedure start begin debug("Remember to wear protective goggles" + _ANSI_window_name("Fallout 1in2 Debug Console")); - if (get_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting") != 2) then begin + if (get_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting") < 1) then begin call error_AllowUnsafeScripting in 1; end else begin if (get_ini_setting("ddraw.ini|Misc|DisableHorrigan") == 0) then begin @@ -36,19 +36,12 @@ procedure start begin if (get_ini_setting("ddraw.ini|Misc|Fallout1Behavior") == 0) then begin call error_Fallout1Behavior in 1; end - - init := VOODOO_Init(); // must be called before any other voodoo magick - - //if(init) then - //begin - // everything in this block will run only once per session - //end end end procedure error_AllowUnsafeScripting begin - debug_warning("Fo1in2 SETTINGS - 'AllowUnsafeScripting' != 2 in ddraw.ini!"); - message_box_warning("ERROR\n\nInvalid 'AllowUnsafeScripting' value\nChange ddraw.ini setting to 2!"); + debug_warning("Fo1in2 SETTINGS - 'AllowUnsafeScripting' < 1 in ddraw.ini!"); + message_box_warning("ERROR\n\nInvalid 'AllowUnsafeScripting' value\nChange ddraw.ini setting to 1!"); //create_message_window("Warning:\n'AllowUnsafeScripting' disabled in ddraw.ini\nFallout et Tu will not work correctly!"); call force_settings; @@ -80,10 +73,10 @@ procedure force_settings begin set_ini_setting("ddraw.ini|Misc|UseFileSystemOverride", 1); set_ini_setting("ddraw.ini|Misc|Fallout1Behavior", 1); - if (metarule_exist("signal_close_game")) then begin - set_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting", 2); + set_ini_setting("ddraw.ini|Debugging|AllowUnsafeScripting", 1); + if (metarule_exist("signal_close_game")) signal_close_game; - end else begin - VOODOO_close_game; + else + variable bad_cfg:= read_byte(0xBADCF6); end end diff --git a/Fallout2/Fallout1in2/Mapper/source/scripts/headers/voodoo.h b/Fallout2/Fallout1in2/Mapper/source/scripts/headers/voodoo.h index 7dbea7d6c..cec3f26be 100644 --- a/Fallout2/Fallout1in2/Mapper/source/scripts/headers/voodoo.h +++ b/Fallout2/Fallout1in2/Mapper/source/scripts/headers/voodoo.h @@ -66,10 +66,12 @@ variable $addr; write_byte(0x4A2A0D, 75) // This will shut down the game and not just send the player back to the main menu +/* #define VOODOO_close_game \ write_byte(0x481B2A, 0xB8); /* mov eax, 27 (ESC key input) */ \ write_int(0x481B2B, 27); \ signal_end_game +*/ /////////////////////////////////////////////////// AUTOMAGICK ZONE /////////////////////////////////////////////////// // diff --git a/Fallout2/Fallout1in2/ddraw.fo1in2.ini b/Fallout2/Fallout1in2/ddraw.fo1in2.ini index 74dc056bd..6bcacb3b4 100644 --- a/Fallout2/Fallout1in2/ddraw.fo1in2.ini +++ b/Fallout2/Fallout1in2/ddraw.fo1in2.ini @@ -136,7 +136,7 @@ GlobalScriptPaths=scripts\gl_*.int,scripts\sfall\gl*.int Enable=1 ConsoleWindow=0 -AllowUnsafeScripting=2 +AllowUnsafeScripting=1 DebugMode=0