diff --git a/gamebridge/src/main.rs b/gamebridge/src/main.rs index a4b973e..51958ac 100644 --- a/gamebridge/src/main.rs +++ b/gamebridge/src/main.rs @@ -42,7 +42,7 @@ fn main() -> Result<()> { let mut vblank = File::open("vblank")?; let mut input = OpenOptions::new().write(true).open("input")?; - const STICK_LERP_TIME: f64 = 270.0; // 270 frames to lerp stick positions down to 0 + const STICK_LERP_TIME: f64 = 500.0; // 450 frames to lerp stick positions down to 0 const BUTTON_LERP_TIME: f64 = 20.0; // 20 frames to lerp button inputs down to 0 let st = { diff --git a/gamebridge/src/twitch.rs b/gamebridge/src/twitch.rs index e2a327e..0e079a5 100644 --- a/gamebridge/src/twitch.rs +++ b/gamebridge/src/twitch.rs @@ -12,9 +12,9 @@ pub(crate) fn run(st: MTState) { async fn handle(st: MTState) { let (nick, pass) = ( // twitch name - std::env::var("TWITCH_NICK").unwrap(), + std::env::var("TWITCH_NICK").expect("bot nickname to be in the environment"), // oauth token for twitch name - std::env::var("TWITCH_PASS").unwrap(), + std::env::var("TWITCH_PASS").expect("bot password to be in the environment"), ); // putting this in the env so people don't join my channel when running this @@ -87,17 +87,27 @@ async fn run_loop( "a" => data.a_button.add(BUTTON_ADD_AMT), "b" => data.b_button.add(BUTTON_ADD_AMT), "z" => data.z_button.add(BUTTON_ADD_AMT), - "r" => data.r_button.add(BUTTON_ADD_AMT), + "cam" | "camera" => data.r_button.add(BUTTON_ADD_AMT), "cup" => data.c_up.add(BUTTON_ADD_AMT), "cdown" => data.c_down.add(BUTTON_ADD_AMT), "cleft" => data.c_left.add(BUTTON_ADD_AMT), "cright" => data.c_right.add(BUTTON_ADD_AMT), "start" => data.start.add(BUTTON_ADD_AMT), - "up" => data.sticky.add(127), - "down" => data.sticky.add(-128), - "left" => data.stickx.add(-128), - "right" => data.stickx.add(127), + "up" | "u" => data.sticky.add(127), + "down" | "d" => data.sticky.add(-128), + "left" | "l" => data.stickx.add(-128), + "right" | "r" => data.stickx.add(127), "stop" => {data.stickx.update(0); data.sticky.update(0);}, + "unstuck" => { + data.a_button.update(0); + data.b_button.update(0); + data.z_button.update(0); + data.r_button.update(0); + data.c_up.update(0); + data.c_down.update(0); + data.c_left.update(0); + data.c_right.update(0); + } _ => {}, } } diff --git a/src/game/mario.c b/src/game/mario.c index d9bdb16..9f111c1 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1258,6 +1258,7 @@ void debug_print_speed_action_normal(struct MarioState *m) { void update_mario_button_inputs(struct MarioState *m) { if (m->controller->buttonPressed & A_BUTTON) { m->input |= INPUT_A_PRESSED; + print_text(210, 32, "A"); } if (m->controller->buttonDown & A_BUTTON) { @@ -1268,6 +1269,7 @@ void update_mario_button_inputs(struct MarioState *m) { if (m->squishTimer == 0) { if (m->controller->buttonPressed & B_BUTTON) { m->input |= INPUT_B_PRESSED; + print_text(210, 48, "B"); } if (m->controller->buttonDown & Z_TRIG) { diff --git a/src/pc/controller/controller_entry_point.c b/src/pc/controller/controller_entry_point.c index 6c5f93f..b932431 100644 --- a/src/pc/controller/controller_entry_point.c +++ b/src/pc/controller/controller_entry_point.c @@ -9,10 +9,10 @@ static struct ControllerAPI *controller_implementations[] = { &controller_recorded_tas, + &controller_gamebridge, &controller_sdl, &controller_keyboard, - &controller_gamebridge, - &controller_tas_recorder, + //&controller_tas_recorder, }; s32 osContInit(OSMesgQueue *mq, u8 *controllerBits, OSContStatus *status) { diff --git a/src/pc/controller/controller_gamebridge.c b/src/pc/controller/controller_gamebridge.c index 65809a0..a555936 100644 --- a/src/pc/controller/controller_gamebridge.c +++ b/src/pc/controller/controller_gamebridge.c @@ -69,7 +69,7 @@ static void gamebridge_init(void) { printf("[gamebridge] starting rust daemon\n"); fflush(stdout); - system("./target/debug/gamebridge &"); + system("./target/release/gamebridge &"); atexit(gamebridge_close); } diff --git a/src/pc/gfx/gfx_screen_config.h b/src/pc/gfx/gfx_screen_config.h index 5b933f8..b9d5acc 100644 --- a/src/pc/gfx/gfx_screen_config.h +++ b/src/pc/gfx/gfx_screen_config.h @@ -1,7 +1,7 @@ #ifndef GFX_SCREEN_CONFIG_H #define GFX_SCREEN_CONFIG_H -#define DESIRED_SCREEN_WIDTH 640 -#define DESIRED_SCREEN_HEIGHT 480 +#define DESIRED_SCREEN_WIDTH 1366 +#define DESIRED_SCREEN_HEIGHT 768 #endif