-
Notifications
You must be signed in to change notification settings - Fork 3
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
Input doesn't seem to work #4
Comments
Someone else was having such an issue, and I suspect the reason is because
there is something on your system that registers as a game controller.
When a controller is plugged in, input uses that instead of the keyboard.
This is all temporary code; your key settings disappear because they are
not saved to a settings file. In the final version it will check your
controller settings and keyboard settings so this won't happen, but I still
want to know what is causing it to think there is a controller attached
when there seemingly isn't. The other person said he had no controllers
attached.
If you are building the source, can you have it print the names of the
controllers it is detecting?
In the final version, you will be able to specify at least 4 devices for
input, and each device will be polled in order until a key-press is found,
so this won't happen.
…On Thu, Jun 6, 2024 at 8:19 AM FIM43-Redeye ***@***.***> wrote:
Since this is a very small project, I'm not actually sure how to go ahead
and report a bug, What I *do* know is that BeesNES doesn't seem to take
any inputs from my keyboard, and when I do put in new input configs, they
stay temporarily (for as long as the program is running) but disappear on
restart. Any idea what's up?
—
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYFQ2X4GTYGEC5HXE5LO3DZF6MHDAVCNFSM6AAAAABI3UF7N6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZTMOJXHA3DQMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
So I'm building the source, but I'm unfortunately really not adept in C++ at all- I'm mostly really interested in this project and wanted to have a look, but to be honest, I don't really know where to begin, most of what I do is C#. Would a simple printf work? Should I use one for each function in Input that enumerates controllers? Apologies for my ineptitude. |
Find this function (…\BeesNES\Src\Input\LSNDirectInput8.cpp):
BOOL PASCAL CDirectInput8::DIEnumDevicesCallback_GatherDevices(
LPCDIDEVICEINSTANCEW _lpdDi, LPVOID _pvRef ) {
Change it to:
BOOL PASCAL CDirectInput8::DIEnumDevicesCallback_GatherDevices(
LPCDIDEVICEINSTANCEW _lpdDi, LPVOID _pvRef ) {
std::vector<DIDEVICEINSTANCEW> * pvVector =
static_cast<std::vector<DIDEVICEINSTANCEW> *>(_pvRef);
pvVector->push_back( (*_lpdDi) );
::OutputDebugStringW( (*_lpdDi).tszProductName );
::OutputDebugStringW( L"\r\n" );
return DIENUM_CONTINUE;
}
You can also breakpoint that line to see what it prints if you run in the
debugger (via hitting F5).
… Message ID: ***@***.***>
|
So, oddly, that line doesn't seem to be called at all when I run it in the debugger. When I breakpoint it, the breakpoint never trips, and nothing prints to the debug window that looks like a product name. Also, as a side note, I'm getting a 'symbols failed to load for wrap_oal.dll. Failed to find local symbol file wrap_oal.pdb' error too. Nothing big, but I know I installed the OpenAL SDK. |
Try the latest commit. It polls the keyboard even if a controller is
detected.
…On Fri, Jun 7, 2024 at 2:35 AM FIM43-Redeye ***@***.***> wrote:
So, oddly, that line doesn't seem to be called at all when I run it in the
debugger. When I breakpoint it, the breakpoint never trips, and nothing
prints to the debug window that looks like a product name.
—
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYFQ2UZUTJBQCELGJO7RYLZGCMXNAVCNFSM6AAAAABI3UF7N6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGA3DGMJVGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Still nothing, so far. Buttons are useless, but the wrap_oal problem disappeared, so that was probably on my end. Interestingly, when I do hook up a controller, it picks up on it just fine, but then I can't assign inputs with it at all. |
I wanted to redo the CPU and see if that was an issue. So try things now. |
Tried now. Unfortunately input is still broken. No preexisting errors, though. Sorry for such a late response. mincore\com\oleaut32\dispatch\ups.cpp(2126)\OLEAUT32.dll!00007FFC880C470C: (caller: 00007FFC880C49FA) ReturnHr(1) tid(c88) 8002801D Library not registered. |
Registering oleaut32.dll did not seem to help. More concerningly, I can't configure a controller at ALL, and none show up in the input devices list. Running in compatibility mode didn't help either. Anything I can do on this end to make the code give more information as to what's wrong? This dumbfounds me. |
Nothing shows in the list yet and those boxes don’t respond to controllers yet. Input is polled here: https://github.com/L-Spiro/BeesNES/blob/main/Src/Windows/MainWindow/LSNMainWindow.cpp#L1587 |
Found it! So the issue is that the controller dialog appears to not have any effect on what keys are actually recognized . The hardcoded keys starting at line 1158 of LSNMainWindow.cpp work fine (though a little futzing was needed to replace VK_OEM_1 with K at lines 1085 and 1159, I assume that key's nice and handy on your keyboard). Aside from that it's a bit crunchy-sounding (significant slowdown on an R9 7940HS), but that's probably my issue to debug and not yours. Though it IS absolutely tapping out one of my cores. |
My laptop seems much lower-spec than that and it can run at up to 90 FPS. Audio may also be playing a part: |
My laptop has AVX, AVX2, and AVS-512, but not AVX10. Disabling the filter significantly increases performance, but still doesn't hit stable FPS. |
That number is supposed to go down. Higher means worse performance. https://github.com/L-Spiro/BeesNES/blob/main/Src/Audio/LSNAudioBase.h#L142 |
Even with the kernel shrunk to 31, performance appears similar to what it initially was. I think something different from audio is eating cycles. What are the specs of your laptop? If it's Intel, that may explain how optimizations that work excellently on it seem to crash and burn on an AMD system. I can try to get access to another Intel system and test it there to see if the performance is linked to manufacturer. |
I was thinking it is the AMD part too, because your specs are way better than mine: |
I ran the performance profiler- it's a bit clumsy, but here are my results: From my extremely inexpert analysis, it looks like your code is actually running excellently, and there's some kind of user32.dll external call that's devouring CPU. |
I always hate to doublepost, but I think I found the bottleneck: |
I don’t know how that can be such a problem; it’s just peeking for a new message. |
I have embarrassed myself. Turns out I just had to swap it to Release configuration and now it runs smoothly. Swapping PeekMessageW for GetMessageW still uses a very large amount of CPU, if a little less, but I'm not sure how to optimize that - maybe it's just normal and the profiler is just seeing the work that function does.. I think the input issue is solved per earlier. BeesNES now runs beautifully on my system. I don't know how to strip the FPS limit out, so I can't push it to its limit and see just how well it runs, but it handles full speed like a champ. The filters also run buttery smooth, with no FPS drop on your custom ones. I think the AVX optimization is working well on AMD as well. Thanks again for making such an amazing program! I genuinely feel privileged for the opportunity to use a sub-cycle NES emulator in real time. Hope I didn't waste too much of your time, and thanks again for all your help. |
I’m just glad to hear it is working as-expected and input works!!!
…On Fri, Oct 4, 2024 at 2:16 FIM43-Redeye ***@***.***> wrote:
I have embarrassed myself. Turns out I just had to swap it to Release
configuration and now it runs smoothly. Swapping PeekMessageW for
GetMessageW still uses a very large amount of CPU, if a little less, but
I'm not sure how to optimize that - maybe it's just normal and the profiler
is just seeing the work that function does.. I think the input issue is
solved per earlier.
BeesNES now runs beautifully on my system. I don't know how to strip the
FPS limit out, so I can't push it to its limit and see just how well it
runs, but it handles full speed like a champ. The filters also run buttery
smooth, with no FPS drop on your custom ones. I think the AVX optimization
is working well on AMD as well.
Thanks again for making such an amazing program! I genuinely feel
privileged for the opportunity to use a sub-cycle NES emulator in real
time. Hope I didn't waste too much of your time, and thanks again for all
your help.
—
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYFQ2X3RQH5JXB6HGTKQ6TZZV3WRAVCNFSM6AAAAABI3UF7N6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJRHEZDQMZVGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Since this is a very small project, I'm not actually sure how to go ahead and report a bug, What I do know is that BeesNES doesn't seem to take any inputs from my keyboard, and when I do put in new input configs, they stay temporarily (for as long as the program is running) but disappear on restart. Any idea what's up?
The text was updated successfully, but these errors were encountered: