Removed the backported new modes for get_game_mode in commit a93ad5a9ba.

This commit is contained in:
NovaRain
2017-08-24 21:46:42 +08:00
parent 89760235c7
commit 438ea071fc
5 changed files with 30 additions and 75 deletions
+15 -18
View File
@@ -1,22 +1,19 @@
//Recognised modes for set_shader_mode and get_game_mode //Recognised modes for set_shader_mode and get_game_mode
#define WORLDMAP (0x1) #define WORLDMAP (0x1)
#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running #define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running
#define DIALOG (0x4) #define DIALOG (0x4)
#define ESCMENU (0x8) #define ESCMENU (0x8)
#define SAVEGAME (0x10) #define SAVEGAME (0x10)
#define LOADGAME (0x20) #define LOADGAME (0x20)
#define COMBAT (0x40) #define COMBAT (0x40)
#define OPTIONS (0x80) #define OPTIONS (0x80)
#define HELP (0x100) #define HELP (0x100)
#define CHARSCREEN (0x200) #define CHARSCREEN (0x200)
#define PIPBOY (0x400) #define PIPBOY (0x400)
#define PCOMBAT (0x800) #define PCOMBAT (0x800)
#define INVENTORY (0x1000) #define INVENTORY (0x1000)
#define AUTOMAP (0x2000) #define AUTOMAP (0x2000)
#define SKILLDEX (0x4000) #define SKILLDEX (0x4000)
#define INTFACEUSE (0x8000)
#define INTFACELOOT (0x10000)
#define BARTER (0x20000)
//Valid arguments to register_hook //Valid arguments to register_hook
#define HOOK_TOHIT (0) #define HOOK_TOHIT (0)
-3
View File
@@ -246,7 +246,6 @@ const DWORD art_ptr_unlock_ = 0x419260;
const DWORD attack_crit_success_ = 0x423EB4; const DWORD attack_crit_success_ = 0x423EB4;
const DWORD automap_ = 0x41B8BC; const DWORD automap_ = 0x41B8BC;
const DWORD barter_compute_value_ = 0x474B2C; const DWORD barter_compute_value_ = 0x474B2C;
const DWORD barter_inventory_ = 0x4757F0;
const DWORD buf_to_buf_ = 0x4D36D4; const DWORD buf_to_buf_ = 0x4D36D4;
const DWORD check_death_ = 0x410814; const DWORD check_death_ = 0x410814;
const DWORD Check4Keys_ = 0x43F73C; const DWORD Check4Keys_ = 0x43F73C;
@@ -424,7 +423,6 @@ const DWORD loadColorTable_ = 0x4C78E4;
const DWORD LoadGame_ = 0x47C640; const DWORD LoadGame_ = 0x47C640;
const DWORD loadProgram_ = 0x4A3B74; const DWORD loadProgram_ = 0x4A3B74;
const DWORD LoadSlot_ = 0x47DC68; const DWORD LoadSlot_ = 0x47DC68;
const DWORD loot_container_ = 0x473904;
const DWORD main_game_loop_ = 0x480E48; const DWORD main_game_loop_ = 0x480E48;
const DWORD main_menu_hide_ = 0x481A00; const DWORD main_menu_hide_ = 0x481A00;
const DWORD main_menu_loop_ = 0x481AEC; const DWORD main_menu_loop_ = 0x481AEC;
@@ -580,7 +578,6 @@ const DWORD trait_get_ = 0x4B3B54;
const DWORD trait_init_ = 0x4B39F0; const DWORD trait_init_ = 0x4B39F0;
const DWORD trait_level_ = 0x4B3BC8; const DWORD trait_level_ = 0x4B3BC8;
const DWORD trait_set_ = 0x4B3B48; const DWORD trait_set_ = 0x4B3B48;
const DWORD use_inventory_on_ = 0x4717E4;
const DWORD _word_wrap_ = 0x4BC6F0; const DWORD _word_wrap_ = 0x4BC6F0;
const DWORD win_add_ = 0x4D6238; const DWORD win_add_ = 0x4D6238;
const DWORD win_delete_ = 0x4D6468; const DWORD win_delete_ = 0x4D6468;
-3
View File
@@ -420,7 +420,6 @@ extern const DWORD art_ptr_unlock_;
extern const DWORD attack_crit_success_; extern const DWORD attack_crit_success_;
extern const DWORD automap_; extern const DWORD automap_;
extern const DWORD barter_compute_value_; extern const DWORD barter_compute_value_;
extern const DWORD barter_inventory_;
extern const DWORD buf_to_buf_; extern const DWORD buf_to_buf_;
extern const DWORD check_death_; extern const DWORD check_death_;
extern const DWORD Check4Keys_; extern const DWORD Check4Keys_;
@@ -597,7 +596,6 @@ extern const DWORD loadColorTable_;
extern const DWORD LoadGame_; extern const DWORD LoadGame_;
extern const DWORD loadProgram_; // loads script from scripts/ folder by file name and returns pointer to it: char* <eax> - file name (w/o extension) extern const DWORD loadProgram_; // loads script from scripts/ folder by file name and returns pointer to it: char* <eax> - file name (w/o extension)
extern const DWORD LoadSlot_; extern const DWORD LoadSlot_;
extern const DWORD loot_container_;
extern const DWORD main_game_loop_; extern const DWORD main_game_loop_;
extern const DWORD main_menu_hide_; extern const DWORD main_menu_hide_;
extern const DWORD main_menu_loop_; extern const DWORD main_menu_loop_;
@@ -756,7 +754,6 @@ extern const DWORD trait_get_;
extern const DWORD trait_init_; extern const DWORD trait_init_;
extern const DWORD trait_level_; extern const DWORD trait_level_;
extern const DWORD trait_set_; extern const DWORD trait_set_;
extern const DWORD use_inventory_on_;
extern const DWORD _word_wrap_; extern const DWORD _word_wrap_;
extern const DWORD win_add_; extern const DWORD win_add_;
extern const DWORD win_delete_; extern const DWORD win_delete_;
-33
View File
@@ -419,34 +419,6 @@ static void __declspec(naked) HandleInventoryHook() {
} }
} }
static void __declspec(naked) UseInventoryOnHook() {
__asm {
or InLoop, INTFACEUSE;
call use_inventory_on_;
and InLoop, (-1 ^ INTFACEUSE);
retn;
}
}
static void __declspec(naked) LootContainerHook() {
__asm {
or InLoop, INTFACELOOT;
call loot_container_;
and InLoop, (-1 ^ INTFACELOOT);
retn;
}
}
static void __declspec(naked) BarterInventoryHook() {
__asm {
or InLoop, BARTER;
push [ESP + 4];
call barter_inventory_;
and InLoop, (-1 ^ BARTER);
retn 4;
}
}
static void __declspec(naked) AutomapHook() { static void __declspec(naked) AutomapHook() {
__asm { __asm {
or InLoop, AUTOMAP; or InLoop, AUTOMAP;
@@ -518,11 +490,6 @@ void LoadGameHookInit() {
HookCall(0x4434AC, SkilldexHook); HookCall(0x4434AC, SkilldexHook);
HookCall(0x44C7BD, SkilldexHook); HookCall(0x44C7BD, SkilldexHook);
HookCall(0x443357, HandleInventoryHook); HookCall(0x443357, HandleInventoryHook);
HookCall(0x44C6FB, UseInventoryOnHook);
HookCall(0x4746EC, LootContainerHook);
HookCall(0x4A4369, LootContainerHook);
HookCall(0x4A4565, LootContainerHook);
HookCall(0x4466C7, BarterInventoryHook);
HookCall(0x44396D, AutomapHook); HookCall(0x44396D, AutomapHook);
HookCall(0x479519, AutomapHook); HookCall(0x479519, AutomapHook);
} }
+15 -18
View File
@@ -24,24 +24,21 @@ bool IsMapLoaded();
DWORD InWorldMap(); DWORD InWorldMap();
DWORD InCombat(); DWORD InCombat();
#define WORLDMAP (1<<0) // 0x1 #define WORLDMAP (1<<0) // 0x1
#define LOCALMAP (1<<1) // 0x2 No point hooking this: would always be 1 at any point at which scripts are running #define LOCALMAP (1<<1) // 0x2 No point hooking this: would always be 1 at any point at which scripts are running
#define DIALOG (1<<2) // 0x4 #define DIALOG (1<<2) // 0x4
#define ESCMENU (1<<3) // 0x8 #define ESCMENU (1<<3) // 0x8
#define SAVEGAME (1<<4) // 0x10 #define SAVEGAME (1<<4) // 0x10
#define LOADGAME (1<<5) // 0x20 #define LOADGAME (1<<5) // 0x20
#define COMBAT (1<<6) // 0x40 #define COMBAT (1<<6) // 0x40
#define OPTIONS (1<<7) // 0x80 #define OPTIONS (1<<7) // 0x80
#define HELP (1<<8) // 0x100 #define HELP (1<<8) // 0x100
#define CHARSCREEN (1<<9) // 0x200 #define CHARSCREEN (1<<9) // 0x200
#define PIPBOY (1<<10) // 0x400 #define PIPBOY (1<<10) // 0x400
#define PCOMBAT (1<<11) // 0x800 #define PCOMBAT (1<<11) // 0x800
#define INVENTORY (1<<12) // 0x1000 #define INVENTORY (1<<12) // 0x1000
#define AUTOMAP (1<<13) // 0x2000 #define AUTOMAP (1<<13) // 0x2000
#define SKILLDEX (1<<14) // 0x4000 #define SKILLDEX (1<<14) // 0x4000
#define INTFACEUSE (1<<15) // 0x8000
#define INTFACELOOT (1<<16) // 0x10000
#define BARTER (1<<17) // 0x20000
#define RESERVED (1<<31) #define RESERVED (1<<31)
DWORD GetCurrentLoops(); DWORD GetCurrentLoops();