parent
1184d3d77a
commit
90052257bb
@ -73,14 +73,14 @@ pub fn init(
|
||||
data,
|
||||
})
|
||||
} else {
|
||||
println!("Could not parse data for: {}", cheat_setting.0);
|
||||
eprintln!("Could not parse data for: {}", cheat_setting.0);
|
||||
};
|
||||
}
|
||||
if !decoded_cheat.is_empty() {
|
||||
device.cheats.cheats.push(decoded_cheat);
|
||||
}
|
||||
} else {
|
||||
println!("Could not find cheat: {}", cheat_setting.0);
|
||||
eprintln!("Could not find cheat: {}", cheat_setting.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ pub fn process(device: &mut device::Device, channel: usize) {
|
||||
device.pif.channels[channel].rx_buf.unwrap(),
|
||||
channel,
|
||||
),
|
||||
_ => println!("unknown controller command {cmd}"),
|
||||
_ => eprintln!("unknown controller command {cmd}"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -227,7 +227,7 @@ fn write_mbc5(
|
||||
} else if address < 0x6000 {
|
||||
cart.ram_bank = (value & 0xf) as u16;
|
||||
} else if address < 0xa000 {
|
||||
println!("Unknown MBC5 write address {address:x}");
|
||||
eprintln!("Unknown MBC5 write address {address:x}");
|
||||
} else if (0xa000..0xc000).contains(&address) {
|
||||
if !cart.ram_enabled {
|
||||
return;
|
||||
|
||||
@ -61,7 +61,7 @@ pub fn read(device: &mut device::Device, channel: usize, address: u16, data: usi
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
println!("unknown transfer pak read {:x}", address >> 12);
|
||||
eprintln!("unknown transfer pak read {:x}", address >> 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ pub fn write(device: &mut device::Device, channel: usize, address: u16, data: us
|
||||
}
|
||||
pak.enabled = true;
|
||||
}
|
||||
_ => println!("unknown transfer pak value"),
|
||||
_ => eprintln!("unknown transfer pak value"),
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -127,7 +127,7 @@ pub fn write(device: &mut device::Device, channel: usize, address: u16, data: us
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
println!("unknown transfer pak write {:x}", address >> 12);
|
||||
eprintln!("unknown transfer pak write {:x}", address >> 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,12 +235,13 @@ async fn main() -> std::io::Result<()> {
|
||||
if device.ui.config.input.transfer_pak[i]
|
||||
&& !device.ui.config.input.gb_ram_path[i].is_empty()
|
||||
&& !device.transferpaks[i].cart.ram.is_empty()
|
||||
{
|
||||
let _ = tokio::fs::write(
|
||||
&& let Err(e) = tokio::fs::write(
|
||||
&device.ui.config.input.gb_ram_path[i],
|
||||
&device.transferpaks[i].cart.ram,
|
||||
)
|
||||
.await;
|
||||
.await
|
||||
{
|
||||
eprintln!("Error writing GB RAM: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ pub fn assign_controller(ui: &mut ui::Ui, controller: i32, port: usize) {
|
||||
Some(unsafe { std::ffi::CStr::from_ptr(path).to_str().unwrap().to_string() });
|
||||
}
|
||||
} else {
|
||||
println!("Invalid controller number")
|
||||
eprintln!("Invalid controller number")
|
||||
}
|
||||
}
|
||||
|
||||
@ -556,7 +556,7 @@ pub fn bind_input_profile(ui: &mut ui::Ui, profile: String, port: usize) {
|
||||
if ui.config.input.input_profiles.contains_key(&profile) {
|
||||
ui.config.input.input_profile_binding[port - 1] = profile;
|
||||
} else {
|
||||
println!("Invalid profile name")
|
||||
eprintln!("Invalid profile name")
|
||||
}
|
||||
}
|
||||
|
||||
@ -595,11 +595,11 @@ pub fn configure_input_profile(ui: &mut ui::Ui, profile: String, dinput: bool, d
|
||||
ui::ttf_init();
|
||||
|
||||
if profile == "default" {
|
||||
println!("Profile name cannot be default");
|
||||
eprintln!("Profile name cannot be default");
|
||||
return;
|
||||
}
|
||||
if profile.is_empty() {
|
||||
println!("Profile name cannot be empty");
|
||||
eprintln!("Profile name cannot be empty");
|
||||
return;
|
||||
}
|
||||
let mut open_joysticks: Vec<*mut sdl3_sys::joystick::SDL_Joystick> = Vec::new();
|
||||
@ -1069,7 +1069,7 @@ pub fn init(ui: &mut ui::Ui) {
|
||||
if !profile.dinput {
|
||||
let gamepad = unsafe { sdl3_sys::gamepad::SDL_OpenGamepad(joystick_id) };
|
||||
if gamepad.is_null() {
|
||||
println!("could not connect gamepad: {}", u32::from(joystick_id))
|
||||
eprintln!("could not connect gamepad: {}", u32::from(joystick_id))
|
||||
} else {
|
||||
ui.input.controllers[i].game_controller = gamepad;
|
||||
ui.input.controllers[i].guid =
|
||||
@ -1077,7 +1077,7 @@ pub fn init(ui: &mut ui::Ui) {
|
||||
let properties =
|
||||
unsafe { sdl3_sys::gamepad::SDL_GetGamepadProperties(gamepad) };
|
||||
if properties == 0 {
|
||||
println!("could not get gamepad properties");
|
||||
eprintln!("could not get gamepad properties");
|
||||
}
|
||||
ui.input.controllers[i].rumble = unsafe {
|
||||
sdl3_sys::properties::SDL_GetBooleanProperty(
|
||||
@ -1090,7 +1090,7 @@ pub fn init(ui: &mut ui::Ui) {
|
||||
} else {
|
||||
let joystick = unsafe { sdl3_sys::joystick::SDL_OpenJoystick(joystick_id) };
|
||||
if joystick.is_null() {
|
||||
println!("could not connect joystick: {}", u32::from(joystick_id))
|
||||
eprintln!("could not connect joystick: {}", u32::from(joystick_id))
|
||||
} else {
|
||||
ui.input.controllers[i].joystick = joystick;
|
||||
ui.input.controllers[i].guid =
|
||||
@ -1098,7 +1098,7 @@ pub fn init(ui: &mut ui::Ui) {
|
||||
let properties =
|
||||
unsafe { sdl3_sys::joystick::SDL_GetJoystickProperties(joystick) };
|
||||
if properties == 0 {
|
||||
println!("could not get joystick properties");
|
||||
eprintln!("could not get joystick properties");
|
||||
}
|
||||
ui.input.controllers[i].rumble = unsafe {
|
||||
sdl3_sys::properties::SDL_GetBooleanProperty(
|
||||
@ -1110,7 +1110,7 @@ pub fn init(ui: &mut ui::Ui) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println!("Could not bind assigned controller");
|
||||
eprintln!("Could not bind assigned controller");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,9 +121,12 @@ fn populate_server_names<T: ComponentHandle + NetplayPages + 'static>(weak: slin
|
||||
&& let Ok(_) = broadcast_sock.set_broadcast(true)
|
||||
{
|
||||
let data: [u8; 1] = [1];
|
||||
let _ = broadcast_sock
|
||||
if let Err(e) = broadcast_sock
|
||||
.send_to(&data, (std::net::Ipv4Addr::BROADCAST, 45000))
|
||||
.await;
|
||||
.await
|
||||
{
|
||||
eprintln!("Error sending broadcast: {}", e);
|
||||
}
|
||||
let mut buffer = [0; 1024];
|
||||
if let Ok(Ok(result)) = tokio::time::timeout(
|
||||
std::time::Duration::from_millis(200),
|
||||
@ -1126,7 +1129,7 @@ fn setup_wait_window(
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
println!("Unknown netplay message type: {}", response.message_type);
|
||||
eprintln!("Unknown netplay message type: {}", response.message_type);
|
||||
}
|
||||
},
|
||||
Err(tokio::sync::broadcast::error::RecvError::Lagged(_)) => {
|
||||
|
||||
Reference in New Issue
Block a user