Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Mouse Injector for Dolphin 5.0, DuckStation, PCSX2, and other emulators

An external app that injects cursor input into game memory.
An external app that injects cursor input into game memory.

### *This fork incorporates the work from https://github.com/vl4sty/MouseInjectorDolphinDuck in order to hook to newer versions of duckstation and pcsx2, however with support for some more games added by myself and vl4sty.*

I would have liked to simply fork their repo but Github doesn't allow you to fork a repo if you have already forked its upstream.

### !This fork is focused only on Duckstation and PCSX2 emulators!
## Additional games for PS2 - NTSC ONLY:
| Game Title | Issues |
| --------- | ------------------ |
| 007: Quantum of Solace | <sup>Needs a cheat file enabled to fix aiming in a cover: [5A6A935D.pnach](https://github.com/vl4sty/MouseInjectorDolphinDuck/blob/master/cheats/PS2/5A6A935D.pnach)</sub> |
| Medal of Honor: Frontline | <sup>None.</sub> |
| Medal of Honor: Rising Sun | <sup>X-axis while ADS is not working in the truck section in the mission "The Fall of the Philippines".</sub> |


### *If you have a game request, please go to the 'Discussions' tab and post it!*
### _Scroll to bottom for_ <font color="red"> *FREQUENTLY ASKED QUESTIONS* </font>


## Supported Emulators
## This fork maintains only these emulators, thus they will work
| Emulator/Frontend | Version | Executable name (case sensitive) |
| --- | :---: | :---: |
| Dolphin | 5.0 and up | dolphin.exe |
| DuckStation | 0.1-5943 | duckstation-qt-x64-ReleaseLTCG.exe |
| PCSX2 Nightly | latest | pcsx2-qt.exe<br>pcsx2-qtx64.exe<br>pcsx2-qtx64-avx2.exe |
| RetroArch (see cores below) | 1.14.0 | retroarch.exe |
| PPSSPP | 1.14.4 | PPSSPPWindows.exe / PPSSPPWindows64.exe |
| Project64 | >=3.0.1 | Project64.exe |
| PCSX2 | Stable 2.0.0, nightly| pcsx2-qt.exe<br>pcsx2-qtx64.exe<br>pcsx2-qtx64-avx2.exe |
* NOTE: Versions given are the latest that have been tested working, may work with newer
* NOTE: PCSX2 will only hook with **BIOS versions 5XXXX and up**.

Expand Down Expand Up @@ -81,6 +90,7 @@ avoid clicking off the window.
|<sup> Echo Night (USA) |<sup> SLUS-00820 |<sup> Good |<sup> Not fully tested |<sup> - |<sup> - |
|<sup> Future Cop: L.A.P.D. (USA) |<sup> SLUS-00739 |<sup> Fair |<sup> Not fully tested |<sup> - |<sup> - |
|<sup> G-Police (USA) |<sup> SLUS-00544</br>SLUS-00556 |<sup> Good |<sup> Not full tested |<sup> - |<sup> - |
|<sup> Germs : Nerawareta Machi (JP) |<sup> SLPS-02107 |<sup> Good |<sup> Not full tested |<sup> - |<sup> **Germs Nerawareta Machi(JP).cht** |
|<sup> Hellnight (Europe) |<sup> SLES-01562 |<sup> Good |<sup> Requires supplied cheat file</br>Not fully tested |<sup> - |<sup> **Hellnight_SLES-10562.cht** |
|<sup> Hybrid (Japan, Europe) |<sup> SLPS-01102</br>SLES-03531 |<sup> Fair |<sup> Requires supplied cheat file<br>Not fully tested |<sup> - |<sup> **Hybrid_SLPS-01102.cht (Japan)<br>Hybrid_SLES-03531.cht (Europe)** |
|<sup> Iron Soldier 3 (USA) |<sup> SLUS-01061 |<sup> Good |<sup> Advanced Controls not supported</br>Requires supplied cheat file</br>Not fully tested |<sup> - |<sup> **IronSoldier3_SLUS-01061.cht** |
Expand Down Expand Up @@ -150,6 +160,7 @@ avoid clicking off the window.
| Destroy All Humans! (USA) | SLUS-20945 | Good | <sup>**Requires supplied cheat file to disable aim-assist**</sub> | - | **67A29886.pnach** |
| Destroy All Humans! 2 (USA) | SLUS-21439 | Good | <sup>**Requires supplied cheat file**</sub> | <sup>Not fully tested</sub> | **42DF8C8C.pnach** |
| Dirge of Cerberus - Final Fantasy VII (USA) | SLUS-21419 | Good | <sup>**Requires supplied cheat file to disable auto-lookahead**</sub> | <sup>Not fully tested</sub> | **44A5FA15.pnach** |
| Fugitive hunter - War on Terror (USA) | SLUS-20464 | Good | <sup> Not fully tested </sub> | - | - |
| Eternal Ring (USA) | SLUS-20015 | Good | <sup>Not fully tested</sub> | - | - |
| Ghost in the Shell: Stand Alone Complex (USA) | SLUS-21006 | Fair | <sup>Horizontal camera while climbing not clamped</sub> | - | - |
| 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> | - |
Expand All @@ -168,6 +179,7 @@ avoid clicking off the window.
| Return to Castle Wolfenstein: Operation Resurrection (USA) | SLUS-20297 | Good | <sup>Not fully tested</sub> | <sup>Auto Center View: Off</br>Always Aim: Off</sub> | - |
| Robotech: Invasion (USA) | SLUS-20823 | Fair | <sup>Turrets not supported</br>Not fully tested</sub> | - | - |
| SOCOM U.S. Navy SEALs (USA) | SCUS-97134 | Fair | <sup>Not fully tested</sub> | <sup>Aim Assist: Off</sub> | - |
| Shadow Tower: Abyss (English Patch) | SLPS-25217 | Good | <sup>Strange vertex stretching across screen when turning too quickly. Not fully tested. </sub> | - | | - |
| 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> | - |
| SWAT: Global Strike Team (USA) | SLUS-20433 | Good | <sup>Not fully tested</sub> | <sup>Auto Leveling: Off</br>Auto Aim: Off</br>Targeting Aid: Off</sub> | - |
| Time Crisis II (USA) | SLUS-20219 | Good | <sup>Not fully tested</sub> | - | - |
Expand Down
9 changes: 9 additions & 0 deletions cheats/PS1/Germs Nerawareta Machi(JP).cht
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#group=Ungrouped
#type=Gameshark
#activation=EndFrame
#Author = Unicorngoulash (Giovanni van den Heuvel)
#Description = Forces the camera to update even without controller input. Made by Unicorngoulash (Giovanni van den Heuvel)
[*Auto update camera read]
80197A26 1000


11 changes: 11 additions & 0 deletions cheats/PS1/Tom Clancy's Rainbow Six (USA).cht
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#group=Ungrouped
#type=Gameshark
#activation=EndFrame
[*Disable Camera Centering]
9003E9CC 0000
9003E988 0000
9003E9B8 0000
9003E974 0000
9003E9A8 0000
9003E960 0000

4 changes: 4 additions & 0 deletions cheats/PS2/5A6A935D.pnach
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gametitle=007 - Quantum of Solace SLUS-21813 0x5A6A935D

// Disable wait on right stick input fuction while in cover
patch=1,EE,001DE778,word,00000000
21 changes: 20 additions & 1 deletion games/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ extern const GAMEDRIVER *GAME_PS2_DAEMONSUMMONER;
extern const GAMEDRIVER *GAME_PS2_MACEGRIFFIN;
extern const GAMEDRIVER *GAME_PS2_AREA51;
extern const GAMEDRIVER *GAME_PS2_REDFACTION2;
extern const GAMEDRIVER *GAME_PS2_MOHFRONTLINE;
extern const GAMEDRIVER *GAME_PS2_MOHRISINGSUN;
extern const GAMEDRIVER *GAME_PS1_RS6;
extern const GAMEDRIVER *GAME_PS2_007QS;
extern const GAMEDRIVER *GAME_PS2_SFDM;
extern const GAMEDRIVER *GAME_PS2_FUGITIVE_HUNTER;
extern const GAMEDRIVER *GAME_PS1_GERMS;
extern const GAMEDRIVER *GAME_PS3_DEMONSSOULS;
extern const GAMEDRIVER *GAME_PS3_AC4A;


static const GAMEDRIVER **GAMELIST[] =
{ // UNF - Unfinished
Expand Down Expand Up @@ -253,7 +263,7 @@ static const GAMEDRIVER **GAMELIST[] =
&GAME_SNES_CYBERNATOR, // UNF
&GAME_N64_TUROK3, // UNF
&GAME_PS2_MICHIGAN,
&GAME_PS2_STABYSS, // UNF
&GAME_PS2_STABYSS,
&GAME_PS2_AVPEXTINCTION, // UNF
&GAME_N64_007WINE,
&GAME_PS2_GEROGUEAGENT, // UNF
Expand Down Expand Up @@ -284,6 +294,8 @@ static const GAMEDRIVER **GAMELIST[] =
&GAME_PS2_JURASSICTHEHUNTED,
&GAME_PS2_MONSTERHUNTER, // UNF
&GAME_PS3_HAZE, // UNF
&GAME_PS3_DEMONSSOULS,
&GAME_PS3_AC4A,
&GAME_PS2_NOONELIVESFOREVER,
&GAME_SS_VIRTUALHYDLIDE, // UNF
&GAME_PS2_EARTHDEFENSEFORCE,
Expand Down Expand Up @@ -339,6 +351,13 @@ static const GAMEDRIVER **GAMELIST[] =
// &GAME_PS2_MACEGRIFFIN, // UNF
// &GAME_PS2_AREA51, // UNF
// &GAME_PS2_REDFACTION2 // UNF
&GAME_PS2_MOHFRONTLINE,
&GAME_PS2_MOHRISINGSUN,
&GAME_PS1_RS6, // UNF
&GAME_PS2_007QS,
&GAME_PS2_FUGITIVE_HUNTER,
&GAME_PS1_GERMS,
// &GAME_PS2_SFDM // UNF
};

static const GAMEDRIVER *CURRENT_GAME = NULL;
Expand Down
153 changes: 153 additions & 0 deletions games/ps1_germs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
//===========================================================
// Mouse Injector for Dolphin
//==========================================================================
// Copyright (C) 2019-2020 Carnivorous
// All rights reserved.
//
// Mouse Injector is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, visit http://www.gnu.org/licenses/gpl-2.0.html
//==========================================================================
#include <stdint.h>
#include "../main.h"
#include "../memory.h"
#include "../mouse.h"
#include "game.h"

#define TAU 6.2831853f // 0x40C90FDB

#define GERMS_CAMY 0x1E068C
#define GERMS_CAMX 0x1E068E
#define GERMS_TRAIN_CAMY 0x1E114C
#define GERMS_TRAIN_CAMX 0x1E114E
#define GERMS_CAR_CAMY 0x1E117C
#define GERMS_CAR_CAMX 0x1E117E

static uint8_t PS1_GERMS_Status(void);
static void PS1_GERMS_Inject(void);

static const GAMEDRIVER GAMEDRIVER_INTERFACE =
{
"Germs : Nerawareta Machi\n Make sure to use the required cheat file for this game.",
PS1_GERMS_Status,
PS1_GERMS_Inject,
1, // 1000 Hz tickrate
0 // crosshair sway not supported for driver
};

const GAMEDRIVER *GAME_PS1_GERMS = &GAMEDRIVER_INTERFACE;

static float xAccumulator = 0.f;
static float yAccumulator = 0.f;

//==========================================================================
// Purpose: return 1 if game is detected
//==========================================================================
static uint8_t PS1_GERMS_Status(void)
{
//534C5053
//5F303231
//2E30373B

return (PS1_MEM_ReadWord(0x92EC) == 0x534C5053U && PS1_MEM_ReadWord(0x92F0) == 0x5F303231U && PS1_MEM_ReadWord(0x92F4) == 0x2E30373BU);
}

static void PS1_GERMS_Inject(void)
{
if(xmouse == 0 && ymouse == 0) // if mouse is idle
return;

uint16_t camX = PS1_MEM_ReadHalfword(GERMS_CAMX);
uint16_t camY = PS1_MEM_ReadHalfword(GERMS_CAMY);

uint16_t trainCamX = PS1_MEM_ReadHalfword(GERMS_TRAIN_CAMX);
uint16_t trainCamY = PS1_MEM_ReadHalfword(GERMS_TRAIN_CAMY);

uint16_t carCamX = PS1_MEM_ReadHalfword(GERMS_CAR_CAMX);
uint16_t carCamY = PS1_MEM_ReadHalfword(GERMS_CAR_CAMY);

float camXF = (float)camX;
float camYF = (float)camY;

float trainCamXF = (float)trainCamX;
float trainCamYF = (float)trainCamY;

float carCamXF = (float)carCamX;
float carCamYF = (float)carCamY;

const float Yscale = .1f;
const float Xscale = .1f;
const float looksensitivity = (float)sensitivity / 20.f;

//NORMAL LOOK
float dx = (float)xmouse * looksensitivity * Xscale;
AccumulateAddRemainder(&camXF, &xAccumulator, xmouse, dx);

float ym = -(float)(invertpitch ? -ymouse : ymouse);
float dy = ym * looksensitivity * Yscale;
AccumulateAddRemainder(&camYF, &yAccumulator, ym, dy);

//TRAIN LOOK
float trainDX = (float)xmouse * looksensitivity * Xscale;
AccumulateAddRemainder(&trainCamXF, &xAccumulator, xmouse, trainDX);

float trainDY = ym * looksensitivity * Yscale;
AccumulateAddRemainder(&trainCamYF, &yAccumulator, ym, trainDY);

//CAR LOOK
float carDX = (float)xmouse * looksensitivity * Xscale;
AccumulateAddRemainder(&carCamXF, &xAccumulator, xmouse, carDX);

float carDY = ym * looksensitivity * Yscale;
AccumulateAddRemainder(&carCamYF, &yAccumulator, ym, carDY);

// clamp y-axis
// range is larger than game usually allows but feels better
if (camYF > 65 && camYF < 32000)
camYF = 65;


if (camYF < 65511 && camYF > 32000)
camYF = 65511;

/*if (camXF < 0)
camXF = 360 - camXF;
if (camXF > 359)
camXF = 0 + camXF;*/

//clamp train view rotations
if (trainCamYF > 65 && trainCamYF < 32000)
trainCamYF = 65;


if (trainCamYF < 65511 && trainCamYF > 32000)
trainCamYF = 65511;

//clamp car view rotations
if (carCamXF > 65 && carCamXF < 32000)
carCamXF = 65;
if (carCamXF < 65471 && carCamXF > 32000)
carCamXF = 65471;

if (carCamYF > 20 && carCamYF < 32000)
carCamYF = 20;
if (carCamYF < 65516 && carCamYF > 32000)
carCamYF = 65516;


PS1_MEM_WriteHalfword(GERMS_CAMX, (uint16_t)camXF);
PS1_MEM_WriteHalfword(GERMS_CAMY, (uint16_t)camYF);
PS1_MEM_WriteHalfword(GERMS_TRAIN_CAMX, (uint16_t)trainCamXF);
PS1_MEM_WriteHalfword(GERMS_TRAIN_CAMY, (uint16_t)trainCamYF);
PS1_MEM_WriteHalfword(GERMS_CAR_CAMX, (uint16_t)carCamXF);
PS1_MEM_WriteHalfword(GERMS_CAR_CAMY, (uint16_t)carCamYF);
}
Loading