Skip to content

Commit 7919b25

Browse files
Clippy95Clippy95marinesciencedude
committed
Red Dead Redemption Support (#29)
* Basic support for Red Dead Redemption GOTY Disk 1 * Support for Red Dead Redemption Normal(OG) TU0 * Fix auto centering, included address for GOTY D1 * Fix mount centering, provided address for GOTY D1 * Added RDR GOTY Disk 2 support. Make finding addresses faster, will find auto_center_strength if we have the x address * Fix sens * Provide pointer for camera base * Add cover mousehook, (GOTY DISK 1) * Add mounted guns mouse hook (Address for GOTY 1) * Implement Carriage mousehook * TU0 Parity with GOTY * Initial bindings * cover base address, pause flag, TU0 fix? * Pointer for cam type, GOTY Disk 1 + TU0 * Pointer for cam type, and ADS fovscale. * Aim Assist / Auto-center removal for GOTY Disk 1 and TU0 * Basic Weapon Wheel support for GOTY Disk 1 * Fix mounted guns X axis address, static FOV address. and unify the GOTY 1 & 2 addresses, Disk 1, UN (no mounted yet), and Reality Redemption should work. * GOTY Disk 2 mounted gun address * Lint * Comment equivalents to @DottierGalaxy50 cheat engine table. comment out printf for FOV * Auto center / Aim Assist removal for GOTY Disk 2 * lint again * Fix Gatling gun not being detected * Auto center cover address (it's offseted from mounting_center_address) * Fovscale address for TU0 * Turret cam for TU0 * Weapon wheel base addresses, correct turret cam address for TU0 * Add extra auto center address to nop * fovscale;turret;weapon wheel address: TU0; linted * correct alt auto center * RDR TU9 support * RDR Undead Nightmare standalone TU4 Correct cover address / offsets for TU9 * Replace MAP with struct in attempt to fix crashes at runtime. * lint sturct * Different weapon wheel logic * Snappy wheel test * IsWeaponWheelShown function, and stop camera from moving while in cover * lint * CinematicType addresses and handleRigthStick emulation for duels and horseshoe minigame * Limit Y axis correctly as game doesn't handle it * Fix camera not moving while in a carriage as a passenger and let the right stick move in a duel * GetCamType function, fixes crashes. * FOV sensitivity * IsPaused function * Turbo sprint * Option to enable turbo gallop for horses/coaches * Sanity check for mounting horses auto center * pattern scan test * cover sanity and lower start_address * sanity check for cover auto center * Fix carriage camera locking * Sanity check for carriage and a pattern scan if it's invalid. * Pattern scan horse auto center if sanity fails * Invert X and Invert Y, and refix pessanger carriage / cleanup for cover / mounted guns * lint * fix lint breaking * Bindings by @A1eNaz * Remove alt auto center address for Disk 2 as it required protect_zero=false * Expand binding * numbers as dpad * Add snappy wheel as a toggle, and rename config options to point they're for RDR * RDR in readme * Mid game bindings for horse * Print *what* pattern it finds in the console * Change pointer for disk 2 cover camera * Fovscale pointer * Allow RS binds to be used for weapon wheel * Better check for if mouse is moving. * lint mouse check * Change variable names --------- Co-authored-by: Clippy95 <[email protected]> Co-authored-by: Marine Biologist <[email protected]>
1 parent 0329e63 commit 7919b25

File tree

6 files changed

+1058
-0
lines changed

6 files changed

+1058
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ This is a fork of [emoose's Xenia build](https://github.com/emoose/xenia) as ori
5656
| Crackdown 2 | TU0/TU5 |
5757
| Saints Row 2 | TU3 |
5858
| Dark Messiah of Might and Magic | Singleplayer & Multiplayer |
59+
| Red Dead Redemption | Original TU0/TU9, Undead Nightmare (Platinum Hits) TU4 & Game Of The Year Edition Disk 1/2 TU0|
5960
| Far Cry Instincts: Predator | TU0 |
6061
| Dead Rising 2 Case West | TU0 |
6162
| Dead Rising 2 Case Zero | TU0 |

bindings.ini

+72
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,78 @@ Tab = Back
256256
Enter = Start
257257
CapsLock= Modifier
258258

259+
[5454082B Default - Red Dead Redemption]
260+
W = LS-Up
261+
S = LS-Down
262+
A = LS-Left
263+
D = LS-Right
264+
Space = X
265+
R = B
266+
;RDR modifier spams A to full sprint, and spams A on horses if turbo_gallop_horse = true in config.
267+
LShift = Modifier
268+
E = RB
269+
F = Y
270+
Mouse4 = LB
271+
Mouse5 = LB
272+
Q = LB
273+
C = RB
274+
LClick = RT
275+
MClick = RS
276+
G = RS
277+
RClick = LT
278+
Enter = Start
279+
Tab = Back
280+
Ctrl = LS
281+
H = Up
282+
V = Down
283+
1 = Up
284+
2 = Down
285+
3 = Right
286+
4 = Left
287+
Z = Left
288+
X = Right
289+
Up = RS-Up
290+
Down = RS-Down
291+
Left = RS-Left
292+
Right = RS-Right
293+
CapsLock = A
294+
295+
[5454082B Horse - Red Dead Redemption]
296+
W = LS-Up
297+
S = LS-Down
298+
A = LS-Left
299+
D = LS-Right
300+
Space = X
301+
R = B
302+
;RDR modifier spams A to full sprint, and spams A on horses if turbo_gallop_horse = true in config.
303+
LShift = Modifier
304+
E = RB
305+
F = Y
306+
Mouse4 = LB
307+
Mouse5 = LB
308+
Q = LB
309+
C = RB
310+
LClick = RT
311+
MClick = RS
312+
G = RS
313+
RClick = LT
314+
Enter = Start
315+
Tab = Back
316+
Ctrl = LS
317+
H = Up
318+
V = Down
319+
1 = Up
320+
2 = Down
321+
3 = Right
322+
4 = Left
323+
Z = Left
324+
X = Right
325+
Up = RS-Up
326+
Down = RS-Down
327+
Left = RS-Left
328+
Right = RS-Right
329+
CapsLock = A
330+
259331
[545107FC Default - Saints Row 2]
260332
W = LS-Up
261333
S = LS-Down

src/xenia/emulator.cc

+43
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,49 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
17761776
}
17771777
}
17781778

1779+
if (module->title_id() == 0x5454082B) {
1780+
struct RDRPatchOffsets {
1781+
uint32_t check_addr;
1782+
uint32_t check_value;
1783+
uint32_t BENop;
1784+
uint32_t BEStub;
1785+
uint32_t auto_center_read_address; // We can only move the camera values
1786+
// on foot/horse if the in-game auto
1787+
// center option is disabled.
1788+
uint32_t aim_assist_function_address;
1789+
uint32_t alt_auto_center_read_address; // Most likely either horz or vert
1790+
};
1791+
std::vector<RDRPatchOffsets> supported_builds = {
1792+
// RDR GOTY DISK 1
1793+
{0x82010BEC, 0x7A3A5C72, 0x60000000, 0x4e800020, 0x82371E78, 0x822F9E60,
1794+
0x82371E58},
1795+
// RDR GOTY DISK 2
1796+
{0x82010C0C, 0x7A3A5C72, 0x60000000, 0x4e800020, 0x82371E58, 0x822F9F60,
1797+
NULL},
1798+
// RDR TU0
1799+
{0x8201071C, 0x7A3A5C72, 0x60000000, 0x4e800020, 0x82370C08, 0x822F83B0,
1800+
0x82370C28},
1801+
// RDR TU9
1802+
{0x82010C1C, 0x7A3A5C72, 0x60000000, 0x4e800020, 0x823717D8, 0x822F97C8,
1803+
0x823717FC},
1804+
// RDR Undead Nightmare Standalone TU4 #5B48AF70
1805+
{0x82010B9C, 0x7A3A5C72, 0x60000000, 0x4e800020, 0x82371C80, 0x822D1690,
1806+
0x82371CA0}};
1807+
for (auto& build : supported_builds) {
1808+
auto* test_addr = (xe::be<uint32_t>*)module->memory()->TranslateVirtual(
1809+
build.check_addr);
1810+
if (*test_addr != build.check_value) {
1811+
continue;
1812+
}
1813+
patch_addr(build.auto_center_read_address, build.BENop);
1814+
if (build.alt_auto_center_read_address)
1815+
patch_addr(build.alt_auto_center_read_address, build.BENop);
1816+
if (cvars::disable_autoaim && build.aim_assist_function_address) {
1817+
patch_addr(build.aim_assist_function_address, build.BEStub);
1818+
}
1819+
}
1820+
}
1821+
17791822
const uint32_t kTitleIdCODGhostsDEV = 0x4156088E;
17801823
const uint32_t kTitleIdCODNX1 = 0x4156089E;
17811824
const uint32_t kTitleIdCODBO2 = 0x415608C3;

0 commit comments

Comments
 (0)