Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Toggle low battery signal #63

Closed
KR155E opened this issue Mar 24, 2021 · 9 comments
Closed

[Feature Request] Toggle low battery signal #63

KR155E opened this issue Mar 24, 2021 · 9 comments

Comments

@KR155E
Copy link

KR155E commented Mar 24, 2021

Since 1.22.0-UNSTABLE, Mednafen supports toggling the state of the low battery sensor bit with the W button, which is a neat feature for homebrew developers.

The Beetle VB core has been updated to 1.23.0 with #45, but as far as I can tell, the low battery toogle is not wired up to libretro and not available in RetroArch.

Would love to see it supported. :-)

@negativeExponent
Copy link
Contributor

negativeExponent commented Jun 23, 2021

there should only be 1-bit needed for this to happen, but, how to test for this and which button should this be mapped to?

https://files.virtual-boy.com/download/978651/stsvb.html#game_pad_data_registers

@KR155E
Copy link
Author

KR155E commented Jun 29, 2021

I'd stick to the Mednafen key binding and map the function to the W button by default.

If it helps with testing, I can create a quick test ROM that shows a low battery indicator when the respective flag is set. Let me know.

@negativeExponent
Copy link
Contributor

negativeExponent commented Jul 2, 2021

sent PR, assigning button X or Y as the trigger. See if this is enough for whatever its needed for...

seems to work in Warioland:
image

@RokkumanX
Copy link
Contributor

Nice work, looks really good.

Now, might I ask what that battery icon does? Does it show how much battery that is left on a wireless controller or heck even the laptop battery?

@KR155E
Copy link
Author

KR155E commented Jul 3, 2021

Fantastic, thank you @negativeExponent!

Does this work as a toggle or do you have to keep the button pressed for the indicator to appear? Toggle would be best.

Wouldn't we want to route this through a new config value like "vb_input_toggle_low_battery" or something similar, so the button can be reassigned?

@RokkumanX - The Virtual Boy is powered from either an AC adapter or a battery pak attached to the back of the controller. Alongside regular button presses, the controller sends a low battery status bit to the head unit. So if the Virtual Boy is running on batteries and these are getting low on power, that status bit will be 1. It's then up to the game to display the indicator you see in the above screenshot. Being able to toggle the status bit manually is of no value to the end user, but is quite useful for homebrew developers to implement such indicator.

@RokkumanX
Copy link
Contributor

Thank you very much for the explanation!

@KR155E
Copy link
Author

KR155E commented Jul 7, 2021

I was able to test the feature on the online emulator today and it works as expected. Thanks again!

@KR155E KR155E closed this as completed Jul 7, 2021
@negativeExponent
Copy link
Contributor

negativeExponent commented Jul 7, 2021

ok forgot about adding the key to input so it can be remapped. ill deal with later if no one else does ahead of me by then... i may need then to just assign one button for it.

UPDATE:
Done. used X button as the default
#66

@KR155E
Copy link
Author

KR155E commented Sep 21, 2021

Sorry for reviving this old thread, but I tried remapping the input for the low battery toggle from a config file and it does not seem to work. I tried remapping the following value: input_player1_x_btn. Is this the wrong one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants