mirror of
https://github.com/kirjavascript/trueLMAO.git
synced 2024-06-02 19:47:21 -04:00
30 lines
889 B
Rust
30 lines
889 B
Rust
pub fn dummy_input(ctx: &egui::Context, emu: &mut emu::Megadrive) {
|
|
let mut value = 0;
|
|
if ctx.input(|i| i.key_down(egui::Key::Enter)) {
|
|
value += emu::io::Gamepad::START;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::W)) {
|
|
value += emu::io::Gamepad::U;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::S)) {
|
|
value += emu::io::Gamepad::D;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::A)) {
|
|
value += emu::io::Gamepad::L;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::D)) {
|
|
value += emu::io::Gamepad::R;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::J)) {
|
|
value += emu::io::Gamepad::A;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::K)) {
|
|
value += emu::io::Gamepad::B;
|
|
}
|
|
if ctx.input(|i| i.key_down(egui::Key::L)) {
|
|
value += emu::io::Gamepad::C;
|
|
}
|
|
|
|
emu.core.mem.io.gamepad[0].set(value);
|
|
}
|