From 441b98a31eab6b187c921055a252bc05f8fb1662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 9 Nov 2020 16:17:29 +0100 Subject: [PATCH] ksys/gdt: Add getFlagGenericBool/S32 --- data/uking_functions.csv | 4 ++-- src/KingSystem/GameData/gdtCommonFlagsUtils.cpp | 3 +++ src/KingSystem/GameData/gdtCommonFlagsUtils.h | 3 +++ tools/generate_gdt_common_flags.py | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index caf37b27..494119f8 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -52415,8 +52415,8 @@ 0x00000071008e4080,getTrackBlockSaveNumberFlag,12, 0x00000071008e408c,getTrackBlockSaveNumberFlagHard,12, 0x00000071008e4098,getFlag_100enemy_Activated,168,_ZN4ksys3gdt26getFlag_100enemy_ActivatedEb -0x00000071008e4140,getBoolFlag,168, -0x00000071008e41e8,getIntFlag,168, +0x00000071008e4140,getBoolFlag,168,_ZN4ksys3gdt18getFlagGenericBoolENS0_10FlagHandleEb +0x00000071008e41e8,getIntFlag,168,_ZN4ksys3gdt17getFlagGenericS32ENS0_10FlagHandleEb 0x00000071008e43a4,getFlag_100enemy_IsPlayNow_ActivatedDemo,172, 0x00000071008e4450,sub_71008E4450,172, 0x00000071008e44fc,sub_71008E44FC,180, diff --git a/src/KingSystem/GameData/gdtCommonFlagsUtils.cpp b/src/KingSystem/GameData/gdtCommonFlagsUtils.cpp index ddaa2dc7..2c04d70f 100644 --- a/src/KingSystem/GameData/gdtCommonFlagsUtils.cpp +++ b/src/KingSystem/GameData/gdtCommonFlagsUtils.cpp @@ -6,6 +6,9 @@ namespace ksys::gdt { // clang-format off +bool getFlagGenericBool(FlagHandle handle, bool debug) { return getBool(handle, debug); } +s32 getFlagGenericS32(FlagHandle handle, bool debug) { return getS32(handle, debug); } + bool getFlag_100enemy_Activated(bool debug) { return getBool(flag_100enemy_Activated(), debug); } void setFlag_100enemy_Activated(bool const& value, bool debug) { setBool(value, flag_100enemy_Activated(), debug); } bool getFlag_100enemy_Battle(bool debug) { return getBool(flag_100enemy_Battle(), debug); } diff --git a/src/KingSystem/GameData/gdtCommonFlagsUtils.h b/src/KingSystem/GameData/gdtCommonFlagsUtils.h index d550a8a1..0ab984b8 100644 --- a/src/KingSystem/GameData/gdtCommonFlagsUtils.h +++ b/src/KingSystem/GameData/gdtCommonFlagsUtils.h @@ -9,6 +9,9 @@ namespace ksys::gdt { // clang-format off +bool getFlagGenericBool(FlagHandle handle, bool debug = false); +s32 getFlagGenericS32(FlagHandle handle, bool debug = false); + bool getFlag_100enemy_Activated(bool debug = false); void setFlag_100enemy_Activated(bool const& value, bool debug = false); bool getFlag_100enemy_Battle(bool debug = false); diff --git a/tools/generate_gdt_common_flags.py b/tools/generate_gdt_common_flags.py index acfe3965..06b11808 100755 --- a/tools/generate_gdt_common_flags.py +++ b/tools/generate_gdt_common_flags.py @@ -233,6 +233,9 @@ namespace ksys::gdt { // clang-format off +bool getFlagGenericBool(FlagHandle handle, bool debug = false); +s32 getFlagGenericS32(FlagHandle handle, bool debug = false); + """) for i, name in enumerate(exe_flag_list): info = flag_type_info[flag_types[name]] @@ -265,6 +268,9 @@ namespace ksys::gdt { // clang-format off +bool getFlagGenericBool(FlagHandle handle, bool debug) { return getBool(handle, debug); } +s32 getFlagGenericS32(FlagHandle handle, bool debug) { return getS32(handle, debug); } + """) for i, name in enumerate(exe_flag_list): info = flag_type_info[flag_types[name]]