-
Notifications
You must be signed in to change notification settings - Fork 128
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
joystick.d: Mapping issues on Linux, but only in release builds #326
Comments
You running on linux? And release mode you mean dmd -release or something else? |
Yep, running on Linux and building with |
ok, it is possible one of the asserts is more important than i thought or some optimization done in there actually broke things... ill have to look later |
OK, yeah, I can reproduce strange behavior with dub build release. dub release uses -release -inline -O to dmd.... three flags I recommend people never use. Strangely any one of those flags seems to break it. Adding -debug fixes it again. oh dear. |
This is weird.... it does seem to work better if you set auto isPressed = false;//upd.buttonWasJustPressed(Button.cross); to ensure it does at least two reads. But I still don't really know what is going on. The different build flags read the same data off the js file, yet react differently and I don't see why. |
riddle me this
js_event(1612852304, 0, 129, 0) So the value is zero every time. That should set it to zero, right? Yet it says 255. |
And adding writeln(player, " ", event.number, " ", event.value, " ", joystickState[player].buttons[event.number]);//, " != ", event.value ? 255 : 0); uncommenting that print changes the value. I'm pretty sure this is a bug in dmd. |
I tried rolling back to an older version of joystick.d that had worked for me previously and I'm seeing the same behavior, so it's seeming more and more like a compiler issue to me too. |
yeah i haven't changed joystick.d much for a long time. I'd suggest just avoiding that -release thing. ldc's optimizations seem to work without breaking it, i think it is a dmd bug specifically. it is really messed up, i think it is incorrectly extending the byte or something like that. i guess i could disassemble it but ugh |
I'm running into a strange issue with joystick.d. When compiling a debug build everything seems to work correctly, but on compiling a release build the joystick mappings seem to get all jumbled up. In the example below, in debug mode the program will loop until the cross button is pressed, as expected, but in release mode the cross button is inverted and the program will only loop while the button is held. Other buttons seem to get mixed up in different ways beyond just being inverted, too.
The text was updated successfully, but these errors were encountered: