Skip to content

Commit 5b188b9

Browse files
committed
v8: newly supported games and cores
1 parent 8bd8efc commit 5b188b9

12 files changed

+770
-46
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ An external app that injects cursor input into game memory.
2020
| :---: | :---: | :---: |
2121
| N64 | Mupen64Plus-Next | 2.4-Vulkan bc24153 |
2222
| PS1 | Beetle PSX HW | 0.9.44.1 234433f |
23+
| PS1 | Beetle PSX | 0.9.44.1 6ed5790 |
24+
| PS1 | PCSX-ReARMed | r23l 4373e29 |
2325
| PS1 | DuckStation | |
2426
| PS1 | SwanStation | 1.00 bc5f6c8 |
2527
| SNES | bsnes-mercury Balanced | v094 |
2628
* NOTE: For RetroArch the window needs to be focused for it to hook initially.
29+
* NOTE: All cores have not been tested exhaustively
2730

2831
## How to Use
2932
1. Start emulator first
@@ -80,6 +83,8 @@ avoid clicking off the window.
8083
| Hellnight (Europe) | SLES-01562 | Good | <sup>Requires supplied cheat file, Not fully tested</sub> | **Hellnight_SLES-10562.cht** |
8184
| Aquanaut's Holiday (USA) | SCUS-94603 | Good | <sup>Requires supplied cheat file, Very little testing</sub> | **AquanautsHoliday_SCUS-94603.cht** |
8285
| Future Cop: L.A.P.D. (USA) | SLUS-00739 | Fair | <sup>Not fully tested</sub> | |
86+
| Duke Nukem: Time to Kill (USA) | SLUS-00583 | Fair | <sup>Requires supplied cheat file, Not fully tested</sub> | **DukeNukemTimeToKill_SLUS-00583.cht** |
87+
| Jumping Flash (USA) | SCUS-94103 | Good | <sup>Requires supplied cheat file</sub> | **JumpingFlash_SCUS-94103.cht** |
8388
* NOTE: If DuckStation is not hooking, try restoring the default settings. 'Settings->General->Restore Defaults'
8489
* Importing cheat files in DuckStation: 'Tools->Cheat Manager->Cheat List->Import->From File'
8590

@@ -121,6 +126,8 @@ avoid clicking off the window.
121126
| Resident Evil: Dead Aim (USA) | SLUS-20669 | Good | <sup>**Requires supplied cheat file**, Third-person camera y-axis not supported</sub> | | **FBB5290C.pnach** |
122127
| Michigan: Report from Hell (Europe) | SLES-53073 | Fair | <sup>Door peek camera not supported, Not fully tested</sub> | | |
123128
| Ninja Assault (USA) | SLUS-20492 | Good | <sup>**Requires supplied cheat file to disable aim-lock**, Not fully tested</sub> | | **785B28DA.pnach** |
129+
| Robotech: Invasion (USA) | SLUS-20823 | Fair | <sup>Turrets not supported, Not fully tested</sub> | | |
130+
| Serious Sam: Next Encounter (USA) | SLUS-20907 | Good | <sup>Not fully tested</sub> | Auto Center: Off, Auto Aim: Off | |
124131
* NOTE: PCSX2 will only hook with **BIOS versions 5XXXX and up**.
125132
* NOTE: Some aspects may break when a game is started with overclocking. Requires testing.
126133
* PCSX2 Settings: **Disable** *'Settings->Interface->Double-Click Toggles Fullscreen'* | **Enable** *'Settings->Interface->Hide Cursor In Fullscreen'*
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#group=MouseInjector
2+
#type=Gameshark
3+
#activation=EndFrame
4+
[*Disable Rotate X]
5+
E00092D4 0053
6+
80057ADC 0000
7+
E00092D4 0053
8+
80057ADE 0000
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#group=Mouse Injector
2+
#type=Gameshark
3+
#activation=EndFrame
4+
[*Disable CamY]
5+
D00DD762 AC82
6+
800DD75C 0000
7+
D00DD762 AC82
8+
800DD75E 0000
9+
D00DD762 AC82
10+
800DD770 0000
11+
D00DD762 AC82
12+
800DD772 0000
13+
D00DD3E2 AC82
14+
800DD3DC 0000
15+
D00DD3E2 AC82
16+
800DD3DE 0000
17+
D00DD3E2 AC82
18+
800DD3F0 0000
19+
D00DD3E2 AC82
20+
800DD3F2 0000
21+
D00CB7B2 AC82
22+
800CB7AC 0000
23+
D00CB7B2 AC82
24+
800CB7AE 0000
25+
D00CB7B2 AC82
26+
800CB7C0 0000
27+
D00CB7B2 AC82
28+
800CB7C2 0000
29+
D00DD54E AC82
30+
800DD548 0000
31+
D00DD54E AC82
32+
800DD54A 0000
33+
D00DD54E AC82
34+
800DD55C 0000
35+
D00DD54E AC82
36+
800DD55E 0000
37+
D00E2432 AC82
38+
800E242C 0000
39+
D00E2432 AC82
40+
800E242E 0000
41+
D00E2432 AC82
42+
800E2440 0000
43+
D00E2432 AC82
44+
800E2442 0000
45+
D00DAFCA AC82
46+
800DAFC4 0000
47+
D00DAFCA AC82
48+
800DAFC6 0000
49+
D00DAFCA AC82
50+
800DAFD8 0000
51+
D00DAFCA AC82
52+
800DAFDA 0000
53+
D00DD3F2 AC82
54+
800DD3EC 0000
55+
D00DD3F2 AC82
56+
800DD3EE 0000
57+
D00DD3F2 AC82
58+
800DD400 0000
59+
D00DD3F2 AC82
60+
800DD402 0000
61+
D00DD566 AC82
62+
800DD560 0000
63+
D00DD566 AC82
64+
800DD562 0000
65+
D00DD566 AC82
66+
800DD574 0000
67+
D00DD566 AC82
68+
800DD576 0000
69+
D00E2336 AC82
70+
800E2330 0000
71+
D00E2336 AC82
72+
800E2332 0000
73+
D00E2336 AC82
74+
800E2344 0000
75+
D00E2336 AC82
76+
800E2346 0000
77+

games/game.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ extern const GAMEDRIVER *GAME_PS2_GREGMAXD;
114114
extern const GAMEDRIVER *GAME_PS2_SHSHATTEREDMEMORIES;
115115
extern const GAMEDRIVER *GAME_PS1_DUKETIMETOKILL;
116116
extern const GAMEDRIVER *GAME_PS1_FUTURECOP;
117+
extern const GAMEDRIVER *GAME_PS2_ROBOTECHINVASION;
118+
extern const GAMEDRIVER *GAME_PS2_SERIOUSSAMNE;
119+
extern const GAMEDRIVER *GAME_SS_PANZERDRAGOON;
120+
extern const GAMEDRIVER *GAME_PS2_STATEOFEMERGENCY2;
121+
extern const GAMEDRIVER *GAME_PS2_RACUPYOURARSENAL;
117122

118123
static const GAMEDRIVER **GAMELIST[] =
119124
{
@@ -168,7 +173,7 @@ static const GAMEDRIVER **GAMELIST[] =
168173
&GAME_PS1_JUMPINGFLASH,
169174
&GAME_PS1_KINGSFIELD,
170175
&GAME_PS1_KINGSFIELD2,
171-
&GAME_SS_POWERSLAVE,
176+
// &GAME_SS_POWERSLAVE,
172177
&GAME_PS1_KINGSFIELD3,
173178
&GAME_PS2_KINGSFIELD4,
174179
&GAME_SD_MAKENX,
@@ -208,7 +213,12 @@ static const GAMEDRIVER **GAMELIST[] =
208213
&GAME_PS2_GREGMAXD,
209214
&GAME_PS2_SHSHATTEREDMEMORIES,
210215
&GAME_PS1_DUKETIMETOKILL,
211-
&GAME_PS1_FUTURECOP
216+
&GAME_PS1_FUTURECOP,
217+
&GAME_PS2_ROBOTECHINVASION,
218+
&GAME_PS2_SERIOUSSAMNE,
219+
&GAME_SS_PANZERDRAGOON,
220+
&GAME_PS2_STATEOFEMERGENCY2,
221+
&GAME_PS2_RACUPYOURARSENAL
212222
};
213223

214224
static const GAMEDRIVER *CURRENT_GAME = NULL;

games/ps1_dukettk.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
// 0808 climbing mount/dismount
4545
// 0909 jumping/falling
4646

47+
#define TTK_CLIMB_MEDIUM 0xD71FD
48+
4749
static uint8_t PS1_TTK_Status(void);
4850
static uint8_t PS1_TTK_CanRotate(void);
4951
static void PS1_TTK_Inject(void);
@@ -88,11 +90,19 @@ static uint8_t PS1_TTK_CanRotate(void)
8890
switch (action) {
8991
case TTK_ACTION_SWIMMING:
9092
case TTK_ACTION_FLOATING:
91-
case TTK_ACTION_CLIMBING:
9293
case TTK_ACTION_JETPACK:
9394
return 1;
9495
}
9596

97+
if (action == TTK_ACTION_CLIMBING)
98+
{
99+
// on chain?
100+
if (PS1_MEM_ReadByte(TTK_CLIMB_MEDIUM) == 0x9)
101+
return 1;
102+
else
103+
return 0;
104+
}
105+
96106
if (!action)
97107
return 1;
98108

@@ -105,18 +115,17 @@ static uint8_t PS1_TTK_CanRotate(void)
105115
static void PS1_TTK_Inject(void)
106116
{
107117
// TODO: disable 1st-person to previous 3rd-person snap
108-
// TODO: disable rotation while on ladders but not chains
109118

110119
if(xmouse == 0 && ymouse == 0) // if mouse is idle
111120
return;
112121

113-
const float scale = 250.f;
114122
const float looksensitivity = (float)sensitivity / 20.f;
123+
const float scale = 3.f;
115124

116125
int32_t camY = PS1_MEM_ReadInt(TTK_CAMY);
117126
float camYF = (float)camY;
118127
float ym = (float)(invertpitch ? -ymouse : ymouse);
119-
camYF += ym * looksensitivity / (scale / (scale * 16.f));
128+
camYF += ym * looksensitivity / 0.5f * scale;
120129

121130
camYF = ClampFloat(camYF, -4070.f, 4070.f);
122131

@@ -129,7 +138,7 @@ static void PS1_TTK_Inject(void)
129138
if (camXCosF < 0)
130139
angle -= TAU / 2.f;
131140

132-
angle += (float)xmouse * looksensitivity / (scale / (scale * 0.0025f));
141+
angle += (float)xmouse * looksensitivity / 2592.f * scale;
133142

134143
camXSinF = sin(angle) * 4096;
135144
camXCosF = cos(angle) * 4096;
@@ -138,7 +147,7 @@ static void PS1_TTK_Inject(void)
138147
{
139148
uint16_t camXRot = PS1_MEM_ReadHalfword(TTK_CAMX_ROT);
140149
float camXRotF = (float)camXRot;
141-
float dx = (float)xmouse * looksensitivity * (scale / (scale * 0.95f));
150+
float dx = (float)xmouse * looksensitivity / 4.f * scale;
142151
AccumulateAddRemainder(&camXRotF, &xAccumulator, (float)xmouse, dx);
143152

144153
while (camXRotF > 4096)
@@ -154,7 +163,7 @@ static void PS1_TTK_Inject(void)
154163
{
155164
int16_t camYRot = PS1_MEM_ReadInt16(TTK_CAMY_ROT);
156165
float camYRotF = (float)camYRot;
157-
float dy = -(float)ymouse * looksensitivity * (scale / (scale * 0.95));
166+
float dy = -(float)ymouse * looksensitivity / 4.5f * scale;
158167
AccumulateAddRemainder(&camYRotF, &yAccumulator, -(float)ymouse, dy);
159168

160169
camYRotF = ClampFloat(camYRotF, -900.f, 900.f);

games/ps1_jumpingflash.c

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
#define JF_CAMBASE 0x1FFE7C
2727
#define JF_CAMBASE_SANITY_1_VALUE 0x450B0010
28+
#define JF_CAMBASE_SANITY_2_VALUE 0x17040010
2829
// offsets from cambase
2930
#define JF_CAMX 0x74
3031
#define JF_CAMY 0x78
3132
#define JF_CAMY_SIGN 0x7A
3233
#define JF_CAMBASE_SANITY_1 -0x30
33-
#define JF_DISABLE_CAMY 0xDD760
3434

35-
// #define JF_CAMX 0x138144
36-
// #define JF_CAMY 0x138148
37-
// #define JF_CAMY_SIGN 0x13814A
38-
#define JF_AUTO_LOOK_BELOW 0x102724
3935
#define JF_IS_STAGE_CLEAR 0x1FDBE0
36+
#define JF_IS_PAUSED 0x47E54
4037

4138
static uint8_t PS1_JF_Status(void);
4239
static uint8_t PS1_JF_IsCambaseValid(void);
@@ -63,12 +60,20 @@ static float yAccumulator = 0.f;
6360
//==========================================================================
6461
static uint8_t PS1_JF_Status(void)
6562
{
66-
return (PS1_MEM_ReadWord(0x943C) == 0x53435553U && PS1_MEM_ReadWord(0x9440) == 0x5F393431U && PS1_MEM_ReadWord(0x9444) == 0x2E30333BU);
63+
return (PS1_MEM_ReadWord(0x943C) == 0x53435553U &&
64+
PS1_MEM_ReadWord(0x9440) == 0x5F393431U &&
65+
PS1_MEM_ReadWord(0x9444) == 0x2E30333BU);
66+
67+
// for no$psx debugger
68+
// return (PS1_MEM_ReadWord(0x0) == 0x03000000 &&
69+
// PS1_MEM_ReadWord(0x4) == 0x800C5A27 &&
70+
// PS1_MEM_ReadWord(0x8) == 0x08004003);
6771
}
6872

6973
static uint8_t PS1_JF_IsCambaseValid(void)
7074
{
71-
if (PS1_MEM_ReadWord(camBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_1_VALUE){
75+
if (PS1_MEM_ReadWord(camBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_1_VALUE ||
76+
PS1_MEM_ReadWord(camBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_2_VALUE){
7277
return 1;
7378
}
7479
return 0;
@@ -77,7 +82,8 @@ static uint8_t PS1_JF_IsCambaseValid(void)
7782
static uint8_t PS1_JF_DetectCambase(void)
7883
{
7984
uint32_t tempCamBase = PS1_MEM_ReadPointer(JF_CAMBASE);
80-
if (PS1_MEM_ReadWord(tempCamBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_1_VALUE)
85+
if (PS1_MEM_ReadWord(tempCamBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_1_VALUE ||
86+
PS1_MEM_ReadWord(tempCamBase + JF_CAMBASE_SANITY_1) == JF_CAMBASE_SANITY_2_VALUE)
8187
{
8288
camBase = tempCamBase;
8389
return 1;
@@ -91,14 +97,7 @@ static uint8_t PS1_JF_DetectCambase(void)
9197
//==========================================================================
9298
static void PS1_JF_Inject(void)
9399
{
94-
// TODO: find auto-center cheat/solution that doesn't wholly disable camY movement with controller
95-
// TODO: disable mouse movement on stage clear, on platform, boss defeated
96-
// TODO: disable mouse movement in menu/paused
97-
// TODO: find cheat for Extra World 2
98-
99-
// PS1_MEM_WriteWord(JF_AUTO_LOOK_BELOW, 0x0);
100-
101-
// PS1_MEM_WriteWord(JF_DISABLE_CAMY, 0x0);
100+
// TODO: find better camBase sanity
102101

103102
if(xmouse == 0 && ymouse == 0) // if mouse is idle
104103
return;
@@ -112,9 +111,12 @@ static void PS1_JF_Inject(void)
112111

113112
if (PS1_MEM_ReadWord(JF_IS_STAGE_CLEAR))
114113
return;
114+
115+
if (PS1_MEM_ReadWord(JF_IS_PAUSED))
116+
return;
115117

116118
uint16_t camX = PS1_MEM_ReadHalfword(camBase + JF_CAMX);
117-
uint16_t camY = PS1_MEM_ReadHalfword(camBase + JF_CAMY);
119+
int16_t camY = PS1_MEM_ReadInt16(camBase + JF_CAMY);
118120
float camXF = (float)camX;
119121
float camYF = (float)camY;
120122

@@ -128,26 +130,9 @@ static void PS1_JF_Inject(void)
128130
float dy = -ym * looksensitivity * scale;
129131
AccumulateAddRemainder(&camYF, &yAccumulator, -ym, dy);
130132

131-
camX = (uint16_t)camXF;
132-
camY = (uint16_t)camYF;
133-
134-
// if (camYF < 0 || camY > 32000)
135-
if (camY > 32000)
136-
PS1_MEM_WriteHalfword(camBase + JF_CAMY_SIGN, 0xFFFF);
137-
else
138-
PS1_MEM_WriteHalfword(camBase + JF_CAMY_SIGN, 0x0);
139-
140-
141133
// clamp y-axis
142-
if (camY > 776 && camY < 32000)
143-
camY = 776;
144-
if (camY < 64640 && camY > 32000)
145-
camY = 64640;
146-
147-
PS1_MEM_WriteHalfword(camBase + JF_CAMX, (uint16_t)camX);
148-
PS1_MEM_WriteHalfword(camBase + JF_CAMY, (uint16_t)camY);
134+
camYF = ClampFloat(camYF, -896, 896);
149135

150-
// PS1_MEM_WriteHalfword(JF_CAMX, (uint16_t)camXF);
151-
// PS1_MEM_WriteHalfword(JF_CAMY, (uint16_t)camYF);
152-
// PS1_MEM_WriteWord(JF_CAMY, (uint32_t)camYF);
136+
PS1_MEM_WriteHalfword(camBase + JF_CAMX, (uint16_t)camXF);
137+
PS1_MEM_WriteInt16(camBase + JF_CAMY, (int16_t)camYF);
153138
}

0 commit comments

Comments
 (0)