some cleanup

This commit is contained in:
Logan McNaughton 2025-12-10 15:12:56 +01:00
parent 0aa5c3e63a
commit c6fcfddf8c

View File

@ -56,17 +56,14 @@ pub fn process(device: &mut device::Device, channel: usize) {
}
JCMD_CONTROLLER_READ => {
let offset = device.pif.channels[channel].rx_buf.unwrap();
let input = if device.netplay.is_none() {
ui::input::get(&device.ui, channel)
} else {
if let Some(netplay) = &mut device.netplay
&& netplay.player_number as usize == channel
{
let input = if let Some(netplay) = &mut device.netplay {
if netplay.player_number as usize == channel {
let local_input = ui::input::get(&device.ui, 0);
netplay::send_input(netplay, local_input);
}
netplay::get_input(device, channel)
} else {
ui::input::get(&device.ui, channel)
};
device.pif.ram[offset..offset + 4].copy_from_slice(&input.data.to_ne_bytes());