mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2026-04-27 20:51:40 +00:00
Do controller checks and add get_connected_device_info
This commit is contained in:
parent
2f3a9ad2e3
commit
f3d1a112b3
3 changed files with 23 additions and 1 deletions
|
|
@ -79,6 +79,10 @@ bool recomp::get_n64_input(int controller_num, uint16_t* buttons_out, float* x_o
|
|||
uint16_t cur_buttons = 0;
|
||||
float cur_x = 0.0f;
|
||||
float cur_y = 0.0f;
|
||||
|
||||
if (controller_num != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!recomp::game_input_disabled()) {
|
||||
for (size_t i = 0; i < n64_button_values.size(); i++) {
|
||||
|
|
|
|||
|
|
@ -447,7 +447,24 @@ void recomp::poll_inputs() {
|
|||
}
|
||||
|
||||
void recomp::set_rumble(int controller_num, bool on) {
|
||||
InputState.rumble_active = on;
|
||||
if (controller_num == 0) {
|
||||
InputState.rumble_active = on;
|
||||
}
|
||||
}
|
||||
|
||||
ultramodern::input::connected_device_info_t recomp::get_connected_device_info(int controller_num) {
|
||||
switch (controller_num) {
|
||||
case 0:
|
||||
return ultramodern::input::connected_device_info_t {
|
||||
.connected_device = ultramodern::input::Device::Controller,
|
||||
.connected_pak = ultramodern::input::Pak::RumblePak,
|
||||
};
|
||||
}
|
||||
|
||||
return ultramodern::input::connected_device_info_t {
|
||||
.connected_device = ultramodern::input::Device::None,
|
||||
.connected_pak = ultramodern::input::Pak::None,
|
||||
};
|
||||
}
|
||||
|
||||
static float smoothstep(float from, float to, float amount) {
|
||||
|
|
|
|||
|
|
@ -408,6 +408,7 @@ int main(int argc, char** argv) {
|
|||
.poll_input = recomp::poll_inputs,
|
||||
.get_input = recomp::get_n64_input,
|
||||
.set_rumble = recomp::set_rumble,
|
||||
.get_connected_device_info = recomp::get_connected_device_info,
|
||||
};
|
||||
|
||||
ultramodern::events::callbacks_t thread_callbacks{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue