summaryrefslogtreecommitdiffstats
path: root/src/ControllerConfig.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2019-06-02 05:00:38 +0200
committerFire-Head <Fire-Head@users.noreply.github.com>2019-06-02 05:00:38 +0200
commitb1f9e28cd155459ab2843690c248ed9f4767bc3f (patch)
tree8e7d2a33d4c5109ea3c3562940268afc57d0915c /src/ControllerConfig.cpp
parentrw skeleton (diff)
downloadre3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar.gz
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar.bz2
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar.lz
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar.xz
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.tar.zst
re3-b1f9e28cd155459ab2843690c248ed9f4767bc3f.zip
Diffstat (limited to '')
-rw-r--r--src/ControllerConfig.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/ControllerConfig.cpp b/src/ControllerConfig.cpp
index 30f3e144..10997bce 100644
--- a/src/ControllerConfig.cpp
+++ b/src/ControllerConfig.cpp
@@ -1,6 +1,10 @@
+ #define DIRECTINPUT_VERSION 0x0800
+ #include <dinput.h>
#include "common.h"
#include "patcher.h"
#include "ControllerConfig.h"
+#include "Pad.h"
+#include "FileMgr.h"
CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4;
@@ -8,4 +12,37 @@ WRAPPER void CControllerConfigManager::UpdateJoyButtonState(int padnumber) { EAX
WRAPPER void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber) { EAXJMP(0x58C5E0); }
WRAPPER void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int button, eControllerType type) { EAXJMP(0x58C730); }
WRAPPER void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber) { EAXJMP(0x58CE80); }
-WRAPPER void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int button, int padnumber) { EAXJMP(0x58CFD0); } \ No newline at end of file
+WRAPPER void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int button, int padnumber) { EAXJMP(0x58CFD0); }
+WRAPPER void CControllerConfigManager::MakeControllerActionsBlank() { EAXJMP(0x58B7A0); }
+WRAPPER void CControllerConfigManager::InitDefaultControlConfiguration() { EAXJMP(0x58B930); }
+WRAPPER void CControllerConfigManager::InitDefaultControlConfigMouse(CMouseControllerState const &mousestate) { EAXJMP(0x58BD00); }
+WRAPPER Int32 CControllerConfigManager::GetJoyButtonJustDown() { EAXJMP(0x58B7D0); }
+
+void CControllerConfigManager::LoadSettings(Int32 file)
+{
+ Bool bValid = true;
+
+ if ( file )
+ {
+ Char buff[29];
+ CFileMgr::Read(file, buff, sizeof(buff));
+
+ if ( !strncmp(buff, "THIS FILE IS NOT VALID YET", sizeof(buff) - 3) )
+ bValid = false;
+ else
+ CFileMgr::Seek(file, 0, 0);
+ }
+
+ if ( bValid )
+ {
+ ControlsManager.MakeControllerActionsBlank();
+
+ for ( int i = 0; i < 4; i++ )
+ {
+ for ( int j = 0; j < 41; j++ )
+ {
+ CFileMgr::Read(file, (Char *)&ControlsManager.m_aSettings[j][i], sizeof(tControllerConfigBind));
+ }
+ }
+ }
+}