Skip to content

Commit

Permalink
Minecraft TU75 support
Browse files Browse the repository at this point in the history
New address set-up, hotbar selection, pause flag found by Clippy95. Hotbar can now be instantly switched to the relevant position with the number keys - this new functionality can be used for other games in future. Inventory-specific bindings have been added - B button has been left at Q for now, shift without click is Y, distribute items (R) cannot currently be set to mouse buttons, E cannot currently be set to close interfaces. Inventory cursor no longer snaps onto item slots.

Co-authored-by: Clippy95 <[email protected]>
  • Loading branch information
marinesciencedude and Clippy95 committed Nov 13, 2024
1 parent 85933c7 commit 165effd
Show file tree
Hide file tree
Showing 37 changed files with 656 additions and 18 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ This is a fork of [emoose's Xenia build](https://github.com/emoose/xenia) as ori
| Call Of Duty Ghosts Alpha | 2-iw6mp.exe / 1-iw6sp.exe / default.xex "May 08 2013 build" |
| Call Of Duty Advanced Warfare | Singleplayer & Multiplayer TU17 |
| Wolfenstein | Singleplayer TU0 |
| Gears Of Wars 1 | TU0/TU5 |
| Gears Of Wars 2 | TU0/TU6 |
| Gears Of Wars 3 | TU0/TU6 |
| Gears Of Wars Judgement | TU0/TU4|
| Gears Of War 1 | TU0/TU5 |
| Gears Of War 2 | TU0/TU6 |
| Gears Of War 3 | TU0/TU6 |
| Gears Of War Judgement | TU0/TU4|
| Minecraft | TU75 (1.0.80) |

### [Netplay Mousehook](https://github.com/marinesciencedude/xenia-canary-mousehook/tree/netplay_canary_experimental)

Expand Down
53 changes: 53 additions & 0 deletions bindings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,59 @@ Down = Down
Left = Left
Right = Right

; Configure these binds in-game.
; Sprint = D-PAD LEFT
; Pick Block = D-PAD RIGHT
[584111F7 Default - Minecraft]
W = LS-Up
S = LS-Down
A = LS-Left
D = LS-Right
Ctrl = Left
LClick = RT
RClick = LT
MClick = Right
MWheelUp = LB
MWheelDown = RB
Space = A
Q = B
E = Y
R = X
Up = Up
Down = Down
Left = Left
Right = Right
LShift = RS
Tab = Back
Enter = Start
1 = weapon1
2 = weapon2
3 = weapon3
4 = weapon4
5 = weapon5
6 = weapon6
7 = weapon7
8 = weapon8
9 = weapon9

[584111F7 Inventory - Minecraft]
W = LS-Up
S = LS-Down
A = LS-Left
D = LS-Right
LClick = A
RClick = X
Q = B
R = LT
F = RT
Up = Up
Down = Down
Left = Left
Right = Right
LShift = Y
Tab = Back
Enter = Start

[545107D1 Default - Saints Row 1]
W = LS-Up
S = LS-Down
Expand Down
10 changes: 10 additions & 0 deletions src/xenia/emulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,16 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
}
}

if (module->title_id() == 0x584111F7) { // Minecraft - Prevent game from writing to inventory cursor
std::map<std::string, uint32_t> supported_builds = {{"1.0.80", 0x827594EC}};
for (auto& build : supported_builds) {
if (build.first == title_version_) {
patch_addr(build.second, 0x60000000);
break;
}
}
}

// Initializing the shader storage in a blocking way so the user doesn't
// miss the initial seconds - for instance, sound from an intro video may
// start playing before the video can be seen if doing this in parallel with
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/CallOfDuty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ bool CallOfDutyGame::ModifierKeyHandler(uint32_t user_index,
} else
return false;
}

void CallOfDutyGame::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

bool CallOfDutyGame::Dvar_GetBool(std::string dvar, uint32_t dvar_address) {
XThread* current_thread = XThread::GetCurrentThread();

Expand Down
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/CallOfDuty.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class CallOfDutyGame : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

bool Dvar_GetBool(std::string dvar, uint32_t dvar_address);

private:
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/Crackdown2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ bool Crackdown2Game::ModifierKeyHandler(uint32_t user_index,
X_INPUT_STATE* out_state) {
return false;
}

void Crackdown2Game::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

} // namespace winkey
} // namespace hid
} // namespace xe
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/Crackdown2.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class Crackdown2Game : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

private:
GameBuild game_build_ = GameBuild::Unknown;
};
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/DeadRising.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ bool DeadRisingGame::ModifierKeyHandler(uint32_t user_index,
// won't be used
return true;
}

void DeadRisingGame::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

} // namespace winkey
} // namespace hid
} // namespace xe
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/DeadRising.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class DeadRisingGame : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

private:
GameBuild game_build_ = GameBuild::Unknown;
};
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/Farcry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ bool FarCryGame::ModifierKeyHandler(uint32_t user_index,
X_INPUT_STATE* out_state) {
return false;
}

void FarCryGame::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

} // namespace winkey
} // namespace hid
} // namespace xe
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/Farcry.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class FarCryGame : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

private:
GameBuild game_build_ = GameBuild::Unknown;
};
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/GearsOfWars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ bool GearsOfWarsGame::ModifierKeyHandler(uint32_t user_index,
}
return true;
}

void GearsOfWarsGame::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

} // namespace winkey
} // namespace hid
} // namespace xe
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/GearsOfWars.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class GearsOfWarsGame : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

private:
GameBuild game_build_ = GameBuild::Unknown;
// Timer variables to hold the state for a while // this is probably not ideal
Expand Down
5 changes: 5 additions & 0 deletions src/xenia/hid/winkey/hookables/JustCause.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ bool JustCauseGame::ModifierKeyHandler(uint32_t user_index,
X_INPUT_STATE* out_state) {
return false;
}

void JustCauseGame::WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons) {}

} // namespace winkey
} // namespace hid
} // namespace xe
4 changes: 4 additions & 0 deletions src/xenia/hid/winkey/hookables/JustCause.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class JustCauseGame : public HookableGame {
bool ModifierKeyHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state);

void WeaponSwitchHandler(uint32_t user_index, RawInputState& input_state,
X_INPUT_STATE* out_state, int weapon,
uint16_t buttons);

private:
GameBuild game_build_ = GameBuild::Unknown;
};
Expand Down
Loading

0 comments on commit 165effd

Please sign in to comment.