aboutsummaryrefslogtreecommitdiff
path: root/src/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bind.c')
-rw-r--r--src/bind.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/bind.c b/src/bind.c
index a746ef5..3a7cb34 100644
--- a/src/bind.c
+++ b/src/bind.c
@@ -14,15 +14,13 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include "chunklets/x86.h"
#include "con_.h"
-#include "dbg.h"
#include "errmsg.h"
#include "feature.h"
-#include "hook.h"
#include "intdefs.h"
#include "langext.h"
#include "mem.h"
-#include "x86.h"
#include "x86util.h"
FEATURE()
@@ -36,9 +34,8 @@ static struct keyinfo *keyinfo; // engine keybinds list (s_pKeyInfo[])
const char *bind_get(int keycode) { return keyinfo[keycode].binding; }
-static bool find_keyinfo(con_cmdcb klbc_cb) {
+static bool find_keyinfo(const uchar *insns) {
#ifdef _WIN32
- const uchar *insns = (const uchar *)klbc_cb;
for (const uchar *p = insns; p - insns < 64;) {
// key_listboundkeys loops through each index, moving into a register:
// mov <reg>, dword ptr [<reg> * 8 + s_pKeyInfo]
@@ -57,8 +54,7 @@ static bool find_keyinfo(con_cmdcb klbc_cb) {
INIT {
struct con_cmd *cmd_key_listboundkeys = con_findcmd("key_listboundkeys");
- con_cmdcb cb = con_getcmdcb(cmd_key_listboundkeys);
- if_cold (!find_keyinfo(cb)) {
+ if_cold (!find_keyinfo(cmd_key_listboundkeys->cb_insns)) {
errmsg_warnx("couldn't find key binding list");
return FEAT_INCOMPAT;
}