Skip to content

Commit 9517741

Browse files
committed
v10 newly supported games
Newly supported games | No One Lives Forever (PS2), Monster Attack (PS2), Turok: Evolution (GC)
1 parent df40a05 commit 9517741

File tree

11 files changed

+802
-3
lines changed

11 files changed

+802
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ avoid clicking off the window.
5858
| Die Hard: Vendetta | Fair | <sup>Sentry mode not supported</sub> |
5959
| Trigger Man | Good | <sup>None</sub> |
6060
| Geist | Fair | <sup> ** *Requires MMU be disabled for game in Dolphin* ** <br />Camera broken on elevators, truck sentry on motorcycle level broken</sub> |
61+
| Turok: Evolution | Good | <sup>Optional cheats/patches in **'cheats/TurokEvolutionGTKE51.txt'**</sub> |
6162

6263
## Supported PS1 Titles
6364
| Game Title | Serial | Mouse Support | Issues | Cheat File |
@@ -129,8 +130,10 @@ avoid clicking off the window.
129130
| Robotech: Invasion (USA) | SLUS-20823 | Fair | <sup>Turrets not supported</br>Not fully tested</sub> | - | - |
130131
| Serious Sam: Next Encounter (USA) | SLUS-20907 | Good | <sup>Vehicles not supported</br>Not fully tested</sub> | <sup>Auto Center: Off</br>Auto Aim: Off</sub> | - |
131132
| Armored Core 2 (USA) | SLUS-20014 | Good | <sup>Arena replays broken</br>Not fully tested</sub> | - | - |
132-
| Global Defence Force (PAL) / Chikyū Bōeigun 2 (Japan) | SLES-54464 / SLPM-62652 | Good | <sup>Vehicle mouse control is experimental</br>Not fully tested</sub> | Control Type: Technical | - |
133-
| Jurassic: The Hunted (USA) | SLUS-21907 | Good | <sup>**Requires supplied cheat file**</br>Optional 60FPS cheat recommended</sub> | Aim Assist: Off | **EFE4448F.pnach** |
133+
| Global Defence Force (PAL) / Chikyū Bōeigun 2 (Japan) | SLES-54464, SLPM-62652 | Good | <sup>Vehicle mouse control is experimental</br>Not fully tested</sub> | <sup>Control Type: Technical</sub> | - |
134+
| Jurassic: The Hunted (USA) | SLUS-21907 | Good | <sup>**Requires supplied cheat file**</br>Optional 60FPS cheat recommended</sub> | <sup>Aim Assist: Off</sub> | **EFE4448F.pnach** |
135+
| Monster Attack (PAL) / Chikyū Bōeigun (Japan) | SLES-51856, SLPM-62344 | Good | <sup>Vehicle mouse control is experimental</br>Not fully tested</sub> | <sup>Control Type: Technical</sub> | - |
136+
| No One Lives Forever (USA) | SLUS-20028 | Good | <sup>Not fully tested</sub> | <sup>Auto-targeting: Off</sub> | - |
134137
* NOTE: PCSX2 will only hook with **BIOS versions 5XXXX and up**.
135138
* NOTE: Some aspects may break when a game is started with overclocking. Requires testing.
136139
* PCSX2 Settings: **Disable** *'Settings->Interface->Double-Click Toggles Fullscreen'* | **Enable** *'Settings->Interface->Hide Cursor In Fullscreen'*

TODO

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Find better checks for N64 status
1010
*DONE* Different time/sleep implementation for more consistent tickrate
1111
Some PS2 titles (or all?) seem to be affected
1212
Options stuct defined in each game
13+
Frequently Asked Questions at top of README
14+
Tested working on Windows 10 only
15+
Downloaded source files and there's no exe, not the release
16+
Restore Defaults
17+
Restart emulator and injector
18+
Proper BIOS
19+
PCSX2 | use pointer to PS2 RAM? "pcsx2-qtx64-avx2.exe"+342CDD0
20+
seems to be static
1321

1422
-- Long term --
1523
Add auto-updater

cheats/GC/TurokEvolutionGTKE51.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Turok: Evolution Mouse Injector cheats/patches
2+
3+
**Game must be restarted for cheats and patches to take effect**
4+
5+
=== CHEATS ===
6+
-OPTIONAL- For better mouse flying control
7+
Disable Flying Roll Speed Auto-Center (disables max yaw speed w/ controller)
8+
0C1C0E4C D01F0B4C
9+
041C0E4C 60000000
10+
11+
=== PATCHES ===
12+
-OPTIONAL- adds ability to look around freely while climbing vertically
13+
Disable Climbing Camera Rebound (disables analog-stick control while climbing)
14+
15+
Type: 32-bit
16+
Address: 801cbebc
17+
Value: 60000000
18+
19+
Type: 32-bit
20+
Address: 801cbec4
21+
Value: 60000000

games/game.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ extern const GAMEDRIVER *GAME_PS2_GLOBALDEFENSEFORCE;
125125
extern const GAMEDRIVER *GAME_PS2_JURASSICTHEHUNTED;
126126
extern const GAMEDRIVER *GAME_PS2_MONSTERHUNTER;
127127
extern const GAMEDRIVER *GAME_PS3_HAZE;
128+
extern const GAMEDRIVER *GAME_PS2_NOONELIVESFOREVER;
129+
extern const GAMEDRIVER *GAME_SS_VIRTUALHYDLIDE;
130+
extern const GAMEDRIVER *GAME_PS2_EARTHDEFENSEFORCE;
131+
extern const GAMEDRIVER *GAME_PS2_SHADOWOFROME;
132+
extern const GAMEDRIVER *GAME_GC_TUROKEVOLUTION;
128133

129134
static const GAMEDRIVER **GAMELIST[] =
130135
{
@@ -230,7 +235,12 @@ static const GAMEDRIVER **GAMELIST[] =
230235
&GAME_PS2_GLOBALDEFENSEFORCE,
231236
&GAME_PS2_JURASSICTHEHUNTED,
232237
&GAME_PS2_MONSTERHUNTER,
233-
&GAME_PS3_HAZE
238+
&GAME_PS3_HAZE,
239+
&GAME_PS2_NOONELIVESFOREVER,
240+
&GAME_SS_VIRTUALHYDLIDE,
241+
&GAME_PS2_EARTHDEFENSEFORCE,
242+
&GAME_PS2_SHADOWOFROME,
243+
&GAME_GC_TUROKEVOLUTION
234244
};
235245

236246
static const GAMEDRIVER *CURRENT_GAME = NULL;

games/gc_turokevolution.c

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
//==========================================================================
2+
// Mouse Injector for Dolphin
3+
//==========================================================================
4+
// Copyright (C) 2019-2020 Carnivorous
5+
// All rights reserved.
6+
//
7+
// Mouse Injector is free software; you can redistribute it and/or modify it
8+
// under the terms of the GNU General Public License as published by the Free
9+
// Software Foundation; either version 2 of the License, or (at your option)
10+
// any later version.
11+
//
12+
// This program is distributed in the hope that it will be useful, but
13+
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14+
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
// for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with this program; if not, visit http://www.gnu.org/licenses/gpl-2.0.html
19+
//==========================================================================
20+
#include <stdint.h>
21+
#include "../main.h"
22+
#include "../memory.h"
23+
#include "../mouse.h"
24+
#include "game.h"
25+
26+
#define PI 3.14159265f // 0x40490FDB
27+
#define TAU 6.2831853f // 0x40C90FDB
28+
29+
#define TE_IS_PAUSED 0x80310A8C
30+
#define TE_IS_PAUSED_TRUE 0x00000002
31+
32+
#define TE_IS_IN_GAME_CUTSCENE 0x8070C834
33+
#define TE_IS_IN_GAME_CUTSCENE_TRUE 0x00000001
34+
35+
#define TE_ONFOOT_CAMBASE 0x803113AC
36+
#define TE_ONFOOT_CAMBASE_SANITY_1_VALUE 0xFFA284BF
37+
// offsets from camBase
38+
#define TE_ONFOOT_CAMBASE_SANITY_1 0x2C
39+
#define TE_ONFOOT_CAMX 0xF0
40+
#define TE_ONFOOT_CAMY 0x41C
41+
#define TE_ONFOOT_FOV 0x8D8
42+
#define TE_CLIMB_CAMX 0x420
43+
#define TE_IS_NOT_CLIMBING 0x400
44+
#define TE_IN_WATER 0x1888
45+
#define TE_TURRET_BASE 0x19FC
46+
// offsets from turret base
47+
#define TE_TURRET_CAMY 0x448
48+
#define TE_TURRET_CAMX 0x44C
49+
#define TE_TURRET_CAMY_BOUND 0x498
50+
#define TE_TURRET_CAMX_BOUND 0x49C
51+
52+
#define TE_IS_CLIMBING 0x807DDF28
53+
#define TE_IS_CLIMBING_TRUE 0xBF000000
54+
55+
#define TE_FLYING_BASE 0x803113AC
56+
#define TE_FLYING_BASE_SANITY_1_VALUE 0x3F7B1D3C
57+
#define TE_FLYING_BASE_SANITY_2_VALUE 0xFFA284FF
58+
// offsets from flying camBase
59+
#define TE_FLYING_BASE_SANITY_1 0x40
60+
#define TE_FLYING_BASE_SANITY_2 0x2C
61+
#define TE_FLYING_ROLL_SPEED 0xB4C
62+
#define TE_FLYING_PITCH_SPEED 0xB50
63+
64+
#define TE_CLIMBING_CAMY_REBOUND_OP 0x801CBEBC
65+
66+
67+
static uint8_t GC_TE_Status(void);
68+
static uint8_t GC_TE_DetectCamBase(void);
69+
static uint8_t GC_TE_DetectFlyingBase(void);
70+
static void GC_TE_Inject(void);
71+
72+
static const GAMEDRIVER GAMEDRIVER_INTERFACE =
73+
{
74+
"Turok: Evolution",
75+
GC_TE_Status,
76+
GC_TE_Inject,
77+
1, // if tickrate is any lower, mouse input will get sluggish
78+
0 // crosshair sway not supported for driver
79+
};
80+
81+
const GAMEDRIVER *GAME_GC_TUROKEVOLUTION = &GAMEDRIVER_INTERFACE;
82+
83+
static uint32_t camBase = 0;
84+
static uint32_t flyingCamBase = 0;
85+
static float scale = 300.f;
86+
static float lastRoll = 0.f;
87+
88+
//==========================================================================
89+
// Purpose: return 1 if game is detected
90+
//==========================================================================
91+
static uint8_t GC_TE_Status(void)
92+
{
93+
// GTKE51
94+
return (MEM_ReadUInt(0x80000000) == 0x47544B45U &&
95+
MEM_ReadUInt(0x80000004) == 0x35310000U);
96+
}
97+
98+
static uint8_t GC_TE_DetectCamBase(void)
99+
{
100+
uint32_t tempCamBase = MEM_ReadUInt(TE_ONFOOT_CAMBASE);
101+
if (tempCamBase &&
102+
MEM_ReadUInt(tempCamBase + TE_ONFOOT_CAMBASE_SANITY_1) == TE_ONFOOT_CAMBASE_SANITY_1_VALUE) // &&
103+
// MEM_ReadUInt(tempCamBase + TE_ONFOOT_CAMBASE_SANITY_2) == TE_ONFOOT_CAMBASE_SANITY_2_VALUE)
104+
{
105+
camBase = tempCamBase;
106+
return 1;
107+
}
108+
return 0;
109+
}
110+
111+
static uint8_t GC_TE_DetectFlyingBase(void)
112+
{
113+
uint32_t tempCamBase = MEM_ReadUInt(TE_FLYING_BASE);
114+
if (tempCamBase &&
115+
MEM_ReadUInt(tempCamBase + TE_FLYING_BASE_SANITY_1) == TE_FLYING_BASE_SANITY_1_VALUE &&
116+
MEM_ReadUInt(tempCamBase + TE_FLYING_BASE_SANITY_2) == TE_FLYING_BASE_SANITY_2_VALUE)
117+
{
118+
flyingCamBase = tempCamBase;
119+
return 1;
120+
}
121+
return 0;
122+
}
123+
124+
//==========================================================================
125+
// Purpose: calculate mouse look and inject into current game
126+
//==========================================================================
127+
static void GC_TE_Inject(void)
128+
{
129+
if(xmouse == 0 && ymouse == 0) // if mouse is idle
130+
return;
131+
132+
if (MEM_ReadUInt(TE_IS_PAUSED) == TE_IS_PAUSED_TRUE)
133+
return;
134+
135+
if (MEM_ReadUInt(TE_IS_IN_GAME_CUTSCENE) == TE_IS_IN_GAME_CUTSCENE_TRUE)
136+
return;
137+
138+
const float looksensitivity = (float)sensitivity / 40.f;
139+
140+
if (GC_TE_DetectFlyingBase())
141+
{
142+
float flyingPitchSpeed = MEM_ReadFloat(flyingCamBase + TE_FLYING_PITCH_SPEED);
143+
flyingPitchSpeed += (float)ymouse * looksensitivity / 100.f;
144+
flyingPitchSpeed = ClampFloat(flyingPitchSpeed, -1.33f, 1.33f);
145+
MEM_WriteFloat(flyingCamBase + TE_FLYING_PITCH_SPEED, flyingPitchSpeed);
146+
147+
float flyingRollSpeed = MEM_ReadFloat(flyingCamBase + TE_FLYING_ROLL_SPEED);
148+
flyingRollSpeed += (float)xmouse * looksensitivity / scale;
149+
// flyingRollSpeed = ClampFloat(flyingRollSpeed, -0.83f, 0.83f);
150+
flyingRollSpeed = ClampFloat(flyingRollSpeed, -1.2f, 1.2f);
151+
MEM_WriteFloat(flyingCamBase + TE_FLYING_ROLL_SPEED, flyingRollSpeed);
152+
lastRoll = flyingRollSpeed;
153+
154+
return;
155+
}
156+
157+
if (!GC_TE_DetectCamBase())
158+
return;
159+
160+
uint32_t turretBase = MEM_ReadUInt(camBase + TE_TURRET_BASE);
161+
162+
if (turretBase)
163+
{
164+
float camX = MEM_ReadFloat(turretBase + TE_TURRET_CAMX);
165+
camX -= (float)xmouse * looksensitivity / scale;
166+
float camXBound = MEM_ReadFloat(turretBase + TE_TURRET_CAMX_BOUND);
167+
camX = ClampFloat(camX, -camXBound, camXBound);
168+
169+
float camY = MEM_ReadFloat(turretBase + TE_TURRET_CAMY);
170+
camY -= (float)(invertpitch ? -ymouse : ymouse) * looksensitivity / scale;
171+
float camYBound = MEM_ReadFloat(turretBase + TE_TURRET_CAMY_BOUND);
172+
camY = ClampFloat(camY, -camYBound, camYBound);
173+
174+
MEM_WriteFloat(turretBase + TE_TURRET_CAMX, camX);
175+
MEM_WriteFloat(turretBase + TE_TURRET_CAMY, camY);
176+
}
177+
else if (!MEM_ReadUInt(camBase + TE_IS_NOT_CLIMBING) && !MEM_ReadUInt(camBase + TE_IN_WATER))
178+
{
179+
// if climbing and not in water
180+
181+
if (MEM_ReadUInt(TE_CLIMBING_CAMY_REBOUND_OP) == 0x60000000) // if patch is enabled
182+
{
183+
float camX = MEM_ReadFloat(camBase + TE_CLIMB_CAMX);
184+
camX -= (float)xmouse * looksensitivity * (360.f / TAU) / scale;
185+
camX = ClampFloat(camX, -110.f, 110.f);
186+
187+
float camY = MEM_ReadFloat(camBase + TE_ONFOOT_CAMY);
188+
camY -= (float)(invertpitch ? -ymouse : ymouse) * looksensitivity * (360.f / TAU) / scale;
189+
camY = ClampFloat(camY, -75.f, 225.f);
190+
191+
MEM_WriteFloat(camBase + TE_CLIMB_CAMX, camX);
192+
MEM_WriteFloat(camBase + TE_ONFOOT_CAMY, camY);
193+
}
194+
195+
return;
196+
}
197+
else
198+
{
199+
float fov = MEM_ReadFloat(camBase + TE_ONFOOT_FOV) / 90.f;
200+
201+
float camX = MEM_ReadFloat(camBase + TE_ONFOOT_CAMX);
202+
camX -= (float)xmouse * looksensitivity / scale * fov;
203+
while (camX >= TAU)
204+
camX -= TAU;
205+
while (camX < 0)
206+
camX += TAU;
207+
208+
float camY = MEM_ReadFloat(camBase + TE_ONFOOT_CAMY);
209+
camY -= (float)(invertpitch ? -ymouse : ymouse) * looksensitivity * (360.f / TAU) / scale * fov;
210+
camY = ClampFloat(camY, -70.f, 70.f);
211+
212+
MEM_WriteFloat(camBase + TE_ONFOOT_CAMX, camX);
213+
MEM_WriteFloat(camBase + TE_ONFOOT_CAMY, camY);
214+
}
215+
}

0 commit comments

Comments
 (0)