-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSetupStat.h
174 lines (156 loc) · 3.2 KB
/
SetupStat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#include "stdio.h"
#include "InGameFunctions.h"
void __declspec(naked) SetupStat_AccumulatedCash() // 34FACD79 - PRS_ACCUMULATED_CASH
{
_asm
{
push ecx
push esi
mov esi, ecx
mov eax, [esi + 0x1D4]
mov ecx, dword ptr ds : [0x91E000]
push edi
push eax
call GRaceStatus_GetRacerInfo
mov ecx, [eax + 0x120]
mov [esp + 8], ecx
mov ecx, dword ptr ds : [0x91E000]
call GRaceStatus_GetRaceTimeElapsed
fcomp ds:0x890968
fnstsw ax
test ah, 0x41
mov eax, [esi + 0x1D4]
jnz NoData
mov ecx, [esp + 8]
push 0x89D89C // "%$0.0f"
push 0
push 0x34FACD79 // Accumulated Cash
lea edx, [eax + eax * 2]
push ecx
lea ecx, [esi + edx * 8 + 0x2C]
call StatsPanel_AddGenericStat
pop edi
pop esi
pop ecx
retn
NoData:
push 0xFC1BF40 // --
lea eax, [eax + eax*2]
push 0x34FACD79 // Accumulated Cash
lea ecx, [esi + eax*8 + 0x2C]
call StatsPanel_AddInfoStat
pop edi
pop esi
pop ecx
retn
}
}
void __declspec(naked) SetupStat_CashVariance() // 482039FA - PRS_CASH_VARIANCE
{
_asm
{
sub esp,8
push esi
mov esi, ecx
mov eax, [esi + 0x1D4]
mov ecx, dword ptr ds : [0x91E000]
push eax
call GRaceStatus_GetRacerInfo
mov ecx, [esi + 0x1D4]
push ecx
mov ecx, dword ptr ds : [0x91E000]
call GRaceStatus_GetBestSpeedTrapSpeed
fstp dword ptr ds: [esp+8]
mov edx, [esi + 0x1D4]
mov ecx, dword ptr ds : [0x91E000]
push edx
call GRaceStatus_GetWorstSpeedTrapSpeed
fstp dword ptr ds : [esp + 4]
fld dword ptr ds : [esp + 8]
fcomp ds : 0x890968
fnstsw ax
test ah, 0x41
jnz NoData
fld dword ptr ds : [esp + 4]
fcomp ds : 0x890968
fnstsw ax
test ah, 0x41
jnz NoData
fld dword ptr ds : [esp + 4]
fsub dword ptr ds : [esp + 8]
fstp dword ptr ds : [esp + 4]
push 0x89D89C // "%$0.0f"
push 0
mov eax, [esp + 0x0C]
push 0x482039FA // Cash Variance
push eax
mov eax, [esi + 0x1D4]
lea ecx, [eax + eax * 2]
lea ecx, [esi + ecx * 8 + 0x2C]
call StatsPanel_AddGenericStat
pop esi
add esp, 8
retn
NoData :
mov eax, [esi+0x1D4]
push 0xFC1BF40 // --
lea edx, [eax + eax * 2]
push 0x482039FA // Cash Variance
lea ecx, [esi + edx * 8 + 0x2C]
call StatsPanel_AddInfoStat
pop esi
add esp,8
retn
}
}
void __declspec(naked) SetupStat_CashBehind() // 2F787FDB - PRS_CASH_BEHIND
{
_asm
{
push ecx
push ebx
push esi
mov esi, ecx
mov eax, [esi + 0x1D4]
mov ecx, dword ptr ds : [0x91E000]
push eax
call GRaceStatus_GetRacerInfo
mov ebx, eax
mov eax, [esi + 0x1D0]
test eax, eax
jl NoData
mov ecx, dword ptr ds : [0x91E000]
push edi
push eax
call GRaceStatus_GetRacerInfo
fld dword ptr ds: [eax + 0x120]
fsub dword ptr ds: [ebx + 0x120]
fabs
fstp dword ptr ds: [esp + 0x0C]
mov eax, [esp + 0x0C]
push 0x89D89C // "%$0.0f"
push 0
push 0x2F787FDB // Cash Behind
push eax
mov eax, [esi + 0x1D4]
lea ecx, [eax + eax * 2]
lea ecx, [esi + ecx * 8 + 0x2C]
call StatsPanel_AddGenericStat
pop edi
pop esi
pop ebx
pop ecx
retn
NoData :
mov eax, [esi + 0x1D4]
push 0xFC1BF40 // --
lea edx, [eax + eax * 2]
push 0x2F787FDB // Cash Behind
lea ecx, [esi + edx * 8 + 0x2C]
call StatsPanel_AddInfoStat
pop esi
pop ebx
pop ecx
retn
}
}