ITotalJustice / notorious_beeg

gba emulator written in c++23
https://notorious-beeg.netlify.app/
GNU General Public License v3.0
41 stars 4 forks source link

[Pokemon Emerald] player cannot move left / right when already moving in a up/down direction #15

Open ITotalJustice opened 2 years ago

ITotalJustice commented 2 years ago

if the player is walking forward, then right is pressed, on the gba the player would move right. after releasing right, the player continues to walk forward.

this doesnt happen in my emulator. my guess is that what actually happens on the gba is that the dpad is a rocker, so pressing a direction only presses that single direction.

this is easy to replicate the gba with any controller, but on pc with a keyboard, not so much.

not sure the best path to handle this. i guess having 2 copies of the keystate. when a direction is set, set it. when another direction is set whilst the current direction is set, save the current keystate to the copy, then unset that direction and set the new direction. upon releasing that new direction, load back the previous keystate.