Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,214 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a1f280
|
||||
byte KAGE::Input::InputDevice::update()
|
||||
{
|
||||
longlong lVar1;
|
||||
longlong lVar2;
|
||||
char isVtableOk;
|
||||
float *stickAxis;
|
||||
int pressedButton;
|
||||
int bindingTable;
|
||||
uint uVar3;
|
||||
uint uVar4;
|
||||
uint uVar5;
|
||||
int unaff_ESI;
|
||||
undefined4 uVar6;
|
||||
float fVar7;
|
||||
float fVar8;
|
||||
float fVar9;
|
||||
ulonglong timeNs;
|
||||
ulonglong uVar10;
|
||||
float afStack_18 [2];
|
||||
float fStack_10;
|
||||
float fStack_c;
|
||||
int bindSlot;
|
||||
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x28)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x20));
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x2c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x24));
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x38)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x30));
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x3c)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
memcpy(*(void **)(GHIDRA_CAST<char *>(this) + 0xc4),*(void **)(GHIDRA_CAST<char *>(this) + 0xc0),
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) >> 4) << 2);
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x20)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x24)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x30)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = 0;
|
||||
memset(*(void **)(GHIDRA_CAST<char *>(this) + 0xc0),0,
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) >> 4) << 2);
|
||||
isVtableOk = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x78))();
|
||||
if (isVtableOk == '\0') {
|
||||
return 0;
|
||||
}
|
||||
isVtableOk = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x80))();
|
||||
if (isVtableOk != '\0') {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(this) + 0x7c))(&fStack_10,0);
|
||||
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd4));
|
||||
if (-fVar8 <= fStack_10) {
|
||||
if (fVar8 < fStack_10) {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 2;
|
||||
goto LAB_00a1f364;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 1;
|
||||
LAB_00a1f364:
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
}
|
||||
if (-fVar8 <= fStack_c) {
|
||||
if (fVar8 < fStack_c) {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 8;
|
||||
goto LAB_00a1f384;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 4;
|
||||
LAB_00a1f384:
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
}
|
||||
stickAxis = GHIDRA_CAST<float *>(FUN_00a1eed0(afStack_18,0));
|
||||
fStack_10 = *stickAxis;
|
||||
fVar8 = stickAxis[1];
|
||||
if (0.0 <= fStack_10) {
|
||||
fVar9 = 0.0;
|
||||
}
|
||||
else {
|
||||
fVar9 = -fStack_10;
|
||||
}
|
||||
fVar7 = fStack_10;
|
||||
if (fStack_10 <= 0.0) {
|
||||
fVar7 = 0.0;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x40)) = fVar9;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x44)) = fVar7;
|
||||
if (0.0 <= fVar8) {
|
||||
fVar9 = 0.0;
|
||||
}
|
||||
else {
|
||||
fVar9 = -fVar8;
|
||||
}
|
||||
if (fVar8 <= 0.0) {
|
||||
fVar8 = 0.0;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x48)) = fVar9;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x4c)) = fVar8;
|
||||
}
|
||||
isVtableOk = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x80))();
|
||||
if (isVtableOk == '\0') goto LAB_00a1f4c9;
|
||||
(**(code **)(*GHIDRA_CAST<int *>(this) + 0x7c))(&fStack_10,1);
|
||||
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd4));
|
||||
if (-fVar8 <= fStack_10) {
|
||||
if (fVar8 < fStack_10) {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 0x20;
|
||||
goto LAB_00a1f43c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 0x10;
|
||||
LAB_00a1f43c:
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
}
|
||||
if (-fVar8 <= fStack_c) {
|
||||
if (fVar8 < fStack_c) {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 0x80;
|
||||
goto LAB_00a1f45f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | 0x40;
|
||||
LAB_00a1f45f:
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
}
|
||||
stickAxis = GHIDRA_CAST<float *>(FUN_00a1eed0(afStack_18,1));
|
||||
fStack_10 = *stickAxis;
|
||||
fVar8 = stickAxis[1];
|
||||
if (0.0 <= fStack_10) {
|
||||
fVar9 = 0.0;
|
||||
}
|
||||
else {
|
||||
fVar9 = -fStack_10;
|
||||
}
|
||||
fVar7 = fStack_10;
|
||||
if (fStack_10 <= 0.0) {
|
||||
fVar7 = 0.0;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x50)) = fVar9;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x54)) = fVar7;
|
||||
if (0.0 <= fVar8) {
|
||||
fVar9 = 0.0;
|
||||
}
|
||||
else {
|
||||
fVar9 = -fVar8;
|
||||
}
|
||||
if (fVar8 <= 0.0) {
|
||||
fVar8 = 0.0;
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x58)) = fVar9;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x5c)) = fVar8;
|
||||
LAB_00a1f4c9:
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xcc)) != 4) {
|
||||
pressedButton = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x3c))(0);
|
||||
if (pressedButton != -1) {
|
||||
bindSlot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xcc));
|
||||
bindingTable = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
|
||||
uVar3 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 200));
|
||||
if (GHIDRA_UINT((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x14)) - bindingTable >> 4)) <= uVar3) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("ActionId is out of range\n"));
|
||||
bindingTable = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10));
|
||||
}
|
||||
*GHIDRA_CAST<int *>((bindingTable + (bindSlot + uVar3 * 4) * 4)) = pressedButton;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 200)) = 0xffffffff;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xcc)) = 4;
|
||||
}
|
||||
}
|
||||
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 8)) & 8) == 0) {
|
||||
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd8));
|
||||
if (0.0 < fVar8) {
|
||||
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xdc));
|
||||
uVar6 = 0;
|
||||
fStack_10 = fVar8;
|
||||
timeNs = GetTimeNs();
|
||||
uVar5 = GHIDRA_UINT((timeNs >> 0x20));
|
||||
uVar10 = (ulonglong)uVar5 * 0xd7b634db + ((timeNs & 0xffffffff) * 0xd7b634db >> 0x20);
|
||||
uVar4 = GHIDRA_UINT((uVar10 >> 0x20));
|
||||
fVar9 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd8));
|
||||
uVar3 = GHIDRA_UINT(((timeNs & 0xffffffff) * 0x431bde82 + (uVar10 & 0xffffffff) >> 0x20));
|
||||
lVar1 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar4,uVar3),uVar4 + uVar3)
|
||||
;
|
||||
uVar5 = GHIDRA_UINT(((ulonglong)lVar1 >> 0x20));
|
||||
uVar3 = GHIDRA_UINT(lVar1) >> 0x12 | uVar5 * 0x4000;
|
||||
afStack_18[0] = fVar9;
|
||||
if (((uVar5 >> 0x12) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xe4)) !=
|
||||
GHIDRA_UINT((uVar3 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0xe0))))) || (uVar3 != *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0xe0)))) {
|
||||
FUN_00aefe20();
|
||||
fVar9 = afStack_18[0] - (float)(double)CONCAT44(uVar6,fVar8) * 0.001;
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd8)) = fVar9;
|
||||
}
|
||||
if (0.0 < fVar9) {
|
||||
fVar8 = fStack_10;
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xd8)) = 0;
|
||||
fVar9 = 0.0;
|
||||
fVar8 = 0.0;
|
||||
}
|
||||
(**(code **)(*GHIDRA_CAST<int *>(this) + 0x84))(fVar9,fVar8);
|
||||
uVar10 = GetTimeNs();
|
||||
uVar5 = GHIDRA_UINT((uVar10 >> 0x20));
|
||||
lVar1 = (uVar10 & 0xffffffff) * 0x431bde82;
|
||||
lVar2 = (ulonglong)uVar5 * 0xd7b634db + ((uVar10 & 0xffffffff) * 0xd7b634db >> 0x20);
|
||||
uVar4 = GHIDRA_UINT(((ulonglong)lVar2 >> 0x20));
|
||||
uVar3 = GHIDRA_INT(((ulonglong)lVar1 >> 0x20)) + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar1),GHIDRA_UINT(lVar2)));
|
||||
lVar1 = (ulonglong)uVar5 * 0x431bde82 + (ulonglong)CONCAT14(CARRY4(uVar4,uVar3),uVar4 + uVar3)
|
||||
;
|
||||
uVar3 = GHIDRA_UINT(((ulonglong)lVar1 >> 0x20));
|
||||
*GHIDRA_CAST<uint *>((unaff_ESI + 0xe0)) = GHIDRA_UINT(lVar1) >> 0x12 | uVar3 * 0x4000;
|
||||
*GHIDRA_CAST<uint *>((unaff_ESI + 0xe4)) = uVar3 >> 0x12;
|
||||
return 1;
|
||||
}
|
||||
if (fVar8 < 0.0) {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(this) + 0x84))(fVar8,*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xdc)));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a22940
|
||||
void KAGE::Input::InputDeviceGamepad::vfunc_30()
|
||||
{
|
||||
ushort uVar1;
|
||||
uint local_EAX_6;
|
||||
int boundButton;
|
||||
uint local_ECX_26;
|
||||
uint *bindingCursor;
|
||||
int *axisBindingCursor;
|
||||
uint maskHigh;
|
||||
int *piVar2;
|
||||
float axisValue;
|
||||
uint axisButton;
|
||||
uint axisHalf;
|
||||
int *savedDevice;
|
||||
uint isPassUnbound;
|
||||
byte isNegativeHalf;
|
||||
float axisRest;
|
||||
|
||||
local_EAX_6 = 0;
|
||||
local_ECX_26 = DAT_00c79bf0 - GHIDRA_INT(g_gamepadDevices) >> 2;
|
||||
if (local_ECX_26 != 0) {
|
||||
do {
|
||||
piVar2 = g_gamepadDevices[local_EAX_6];
|
||||
if (*piVar2 == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x370))) {
|
||||
if (piVar2 == GHIDRA_CAST<int *>(0x0)) {
|
||||
return 0;
|
||||
}
|
||||
local_EAX_6 = 0;
|
||||
uVar1 = *GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(this) + 8)) & 0x20;
|
||||
isPassUnbound = GHIDRA_UINT(uVar1);
|
||||
if (piVar2[5] != 0) goto LAB_00a229a0;
|
||||
goto LAB_00a22a04;
|
||||
}
|
||||
local_EAX_6 = local_EAX_6 + 1;
|
||||
} while (local_EAX_6 < local_ECX_26);
|
||||
}
|
||||
return 0;
|
||||
LAB_00a229a0:
|
||||
do {
|
||||
if (0x1f < local_EAX_6) break;
|
||||
local_ECX_26 = 0;
|
||||
bindingCursor = GHIDRA_CAST<uint *>((GHIDRA_INT(this) + 0x38c));
|
||||
do {
|
||||
if (*bindingCursor == local_EAX_6) {
|
||||
boundButton = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + local_ECX_26 * 8 + 0x388));
|
||||
goto LAB_00a229c9;
|
||||
}
|
||||
local_ECX_26 = local_ECX_26 + 1;
|
||||
bindingCursor = bindingCursor + 2;
|
||||
} while (local_ECX_26 < 0x1d);
|
||||
boundButton = -1;
|
||||
LAB_00a229c9:
|
||||
if (((uVar1 != 0) || (boundButton != -1)) && (*GHIDRA_CAST<char *>((local_EAX_6 + piVar2[7])) != '\0')) {
|
||||
local_ECX_26 = 1 << (local_EAX_6 & 0x1f);
|
||||
maskHigh = 0;
|
||||
if (0x1f < local_EAX_6) {
|
||||
maskHigh = local_ECX_26;
|
||||
}
|
||||
local_ECX_26 = local_ECX_26 ^ maskHigh;
|
||||
if (0x3f < local_EAX_6) {
|
||||
maskHigh = local_ECX_26;
|
||||
}
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x20)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x20)) | local_ECX_26;
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x24)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x24)) | maskHigh;
|
||||
}
|
||||
local_EAX_6 = local_EAX_6 + 1;
|
||||
} while (local_EAX_6 < GHIDRA_UINT(piVar2[5]));
|
||||
LAB_00a22a04:
|
||||
axisHalf = 0;
|
||||
savedDevice = piVar2;
|
||||
if ((piVar2[4] & 0x7fffffffU) != 0) {
|
||||
do {
|
||||
if (0x1f < axisHalf) break;
|
||||
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 8)) & 0x40) == 0) {
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + axisHalf * 4 + 0x470)) =
|
||||
*GHIDRA_CAST<undefined4 *>((piVar2[6] + (axisHalf >> 1) * 4));
|
||||
}
|
||||
else {
|
||||
axisRest = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + axisHalf * 4 + 0x470));
|
||||
isNegativeHalf = ~(byte)axisHalf & 1;
|
||||
axisValue = *GHIDRA_CAST<float *>((piVar2[6] + (axisHalf >> 1) * 4)) - axisRest;
|
||||
if (axisRest < 0.0) {
|
||||
axisValue = axisValue / (1.0 - axisRest);
|
||||
}
|
||||
axisButton = 0xffffffff;
|
||||
if ((short)isPassUnbound == 0) {
|
||||
local_EAX_6 = 0;
|
||||
axisBindingCursor = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x38c));
|
||||
do {
|
||||
piVar2 = savedDevice;
|
||||
if (*axisBindingCursor == axisHalf + 0xabab) {
|
||||
axisButton = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + local_EAX_6 * 8 + 0x388));
|
||||
goto LAB_00a22ac5;
|
||||
}
|
||||
local_EAX_6 = local_EAX_6 + 1;
|
||||
axisBindingCursor = axisBindingCursor + 2;
|
||||
} while (local_EAX_6 < 0x1d);
|
||||
axisButton = 0xffffffff;
|
||||
}
|
||||
LAB_00a22ac5:
|
||||
if (isNegativeHalf == 0) {
|
||||
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd4)) < axisValue) goto LAB_00a22ae2;
|
||||
LAB_00a22b4a:
|
||||
if (axisValue <= 0.0) {
|
||||
axisValue = 0.0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (axisValue < -*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0xd4))) {
|
||||
LAB_00a22ae2:
|
||||
if (((short)isPassUnbound != 0) || (axisButton != 0xffffffff)) {
|
||||
this->FUN_00a1f910(&axisButton);
|
||||
if (axisButton == 0xffffffff) {
|
||||
axisButton = axisHalf;
|
||||
}
|
||||
local_EAX_6 = 1 << (axisButton & 0x1f);
|
||||
local_ECX_26 = 0;
|
||||
if (0x1f < axisButton) {
|
||||
local_ECX_26 = local_EAX_6;
|
||||
}
|
||||
local_EAX_6 = local_EAX_6 ^ local_ECX_26;
|
||||
if (0x3f < axisButton) {
|
||||
local_ECX_26 = local_EAX_6;
|
||||
}
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x30)) | local_EAX_6;
|
||||
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x34)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(this) + 0x34)) | local_ECX_26;
|
||||
}
|
||||
if (isNegativeHalf == 0) goto LAB_00a22b4a;
|
||||
}
|
||||
if (0.0 <= axisValue) {
|
||||
axisValue = 0.0;
|
||||
}
|
||||
else {
|
||||
axisValue = -axisValue;
|
||||
}
|
||||
}
|
||||
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + axisHalf * 4 + 0x40)) = axisValue;
|
||||
}
|
||||
axisHalf = axisHalf + 1;
|
||||
} while (axisHalf < GHIDRA_UINT((piVar2[4] * 2)));
|
||||
}
|
||||
*GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(this) + 8)) = *GHIDRA_CAST<ushort *>((GHIDRA_CAST<char *>(this) + 8)) | 0x40;
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a6c650
|
||||
void KAGE::Input::InputDeviceKeyboard::vfunc_30()
|
||||
{
|
||||
char cVar1;
|
||||
byte bVar2;
|
||||
void *pvVar3;
|
||||
int *windowSize;
|
||||
int *in_ECX;
|
||||
int iVar4;
|
||||
int extraout_ECX;
|
||||
int extraout_ECX_00;
|
||||
int extraout_ECX_01;
|
||||
int extraout_ECX_02;
|
||||
int unused;
|
||||
int unaff_ESI;
|
||||
undefined4 *puVar5;
|
||||
undefined4 *dst;
|
||||
double dVar6;
|
||||
int iStack_98;
|
||||
float local_8c [2];
|
||||
int *self;
|
||||
undefined8 local_80;
|
||||
undefined8 uStack_78;
|
||||
int iStack_70;
|
||||
int iStack_6c;
|
||||
int iStack_68;
|
||||
int iStack_64;
|
||||
int iStack_60;
|
||||
undefined8 uStack_5c;
|
||||
int iStack_48;
|
||||
int iStack_44;
|
||||
int local_40;
|
||||
int local_3c;
|
||||
undefined4 local_38;
|
||||
undefined4 local_34;
|
||||
undefined4 local_30;
|
||||
uint local_2c;
|
||||
undefined4 local_28;
|
||||
|
||||
bVar2 = (byte)DAT_00c57b1c & 4;
|
||||
puVar5 = GHIDRA_CAST<undefined4 *>(&DAT_00c78c10);
|
||||
dst = GHIDRA_CAST<undefined4 *>(&DAT_00c78950);
|
||||
for (iVar4 = 0x57; iVar4 != 0; iVar4 = iVar4 + -1) {
|
||||
*dst = *puVar5;
|
||||
puVar5 = puVar5 + 1;
|
||||
dst = dst + 1;
|
||||
}
|
||||
*GHIDRA_CAST<undefined1 *>(dst) = *GHIDRA_CAST<undefined1 *>(puVar5);
|
||||
puVar5 = &DAT_00c78ab0;
|
||||
dst = GHIDRA_CAST<undefined4 *>(&DAT_00c78c10);
|
||||
for (iVar4 = 0x57; iVar4 != 0; iVar4 = iVar4 + -1) {
|
||||
*dst = *puVar5;
|
||||
puVar5 = puVar5 + 1;
|
||||
dst = dst + 1;
|
||||
}
|
||||
*GHIDRA_CAST<undefined1 *>(dst) = *GHIDRA_CAST<undefined1 *>(puVar5);
|
||||
pvVar3 = g_glfwWindow;
|
||||
self = in_ECX;
|
||||
if (bVar2 != 0) {
|
||||
iVar4 = 0;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
||||
,0x2f9);
|
||||
iVar4 = extraout_ECX;
|
||||
}
|
||||
if (_glfw != 0) {
|
||||
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar3) + 0x74));
|
||||
if (cVar1 == '\x03') {
|
||||
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(pvVar3) + 0x74)) = 0;
|
||||
}
|
||||
else if (cVar1 != '\x01') goto LAB_00a6c6cb;
|
||||
pvVar3 = g_glfwWindow;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
||||
,0x310);
|
||||
iVar4 = extraout_ECX_00;
|
||||
}
|
||||
local_80 = 0.0;
|
||||
uStack_78 = 0.0;
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
iVar4 = extraout_ECX_01;
|
||||
}
|
||||
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x70)) == 0x34003) {
|
||||
local_80 = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar3) + 0x1e0));
|
||||
uStack_78 = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar3) + 0x1e8));
|
||||
}
|
||||
else {
|
||||
(*DAT_00c736a0)(pvVar3,&local_80,&uStack_78);
|
||||
iVar4 = extraout_ECX_02;
|
||||
}
|
||||
windowSize = glfw_get_window_size(GHIDRA_CAST<int *>(local_8c),iVar4);
|
||||
if (local_80 <= 0.0) {
|
||||
local_80 = 0.0;
|
||||
}
|
||||
dVar6 = (double)*windowSize + __uint_to_double_fixup[-(*windowSize >> 0x1f)];
|
||||
if (dVar6 <= local_80) {
|
||||
local_80 = dVar6;
|
||||
}
|
||||
windowSize = glfw_get_window_size(GHIDRA_CAST<int *>(local_8c),unused);
|
||||
if (uStack_78 <= 0.0) {
|
||||
uStack_78 = 0.0;
|
||||
}
|
||||
local_38 = 0;
|
||||
local_3c = 0;
|
||||
local_30 = 0;
|
||||
local_34 = 0;
|
||||
local_28 = 0;
|
||||
dVar6 = (double)windowSize[1] + __uint_to_double_fixup[-(windowSize[1] >> 0x1f)];
|
||||
local_2c = 0;
|
||||
if (dVar6 <= uStack_78) {
|
||||
uStack_78 = dVar6;
|
||||
}
|
||||
local_8c[0] = (float)uStack_78;
|
||||
(**(code **)(*self + 0x68))(&local_40,1,0xcdcd);
|
||||
iStack_68 = local_38;
|
||||
iStack_64 = local_34;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_5c)) + 0x0))) = local_2c;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_5c)) + 0x4))) = local_28;
|
||||
iStack_6c = iStack_98;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4))) = 1;
|
||||
iStack_60 = 0xcdcd;
|
||||
iStack_70 = unaff_ESI;
|
||||
memset(self + 0x3a,0,0x284);
|
||||
if ((local_2c & 3) == 0) {
|
||||
iStack_64 = iStack_98;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_78)) + 0x4))) = iStack_98;
|
||||
uStack_5c = CONCAT44((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_5c)) + 0x4))),3);
|
||||
iStack_68 = unaff_ESI;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_78)) + 0x0))) = unaff_ESI;
|
||||
}
|
||||
else {
|
||||
iStack_68 = local_40;
|
||||
iStack_64 = local_3c;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_78)) + 0x0))) = iStack_48;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_78)) + 0x4))) = iStack_44;
|
||||
uStack_5c = CONCAT44((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_5c)) + 0x4))),2);
|
||||
}
|
||||
if ((char)uStack_5c == '\0') {
|
||||
return 1;
|
||||
}
|
||||
self[0x3a] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_80)) + 0x4)));
|
||||
self[0x3b] = GHIDRA_INT(uStack_78);
|
||||
self[0x3c] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(uStack_78)) + 0x4)));
|
||||
self[0x3d] = iStack_70;
|
||||
self[0x3e] = iStack_6c;
|
||||
self[0x3f] = iStack_68;
|
||||
self[0x40] = iStack_64;
|
||||
self[0x41] = iStack_60;
|
||||
*GHIDRA_CAST<undefined8 *>((self + 0x42)) = uStack_5c;
|
||||
self[0xda] = self[0xda] + 1;
|
||||
return 1;
|
||||
}
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
LAB_00a6c6cb:
|
||||
memset(self + 0x3a,0,0x284);
|
||||
return 1;
|
||||
}
|
||||
Reference in new issue
Block a user