Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Shieldwolf on May 30, 2004, 06:25:36 pm
-
I tried to email Howard, but the emails keep getting sent back.
When I play marvel vs capcom and then try and back out I go back to the game selection menu where I am immediatly relaunched into the game. Does this happen for anyone else. I have tried other games and even reinstalled the rom, but both the rom and other games work fine on command line and DK except for Marvel vs Capcom
-
It's not a game specific thing, you just think it is.....
Probably your problem:
Due to the way directx caches the keyboard keys, they are "saved" when the gui is busy. Let's say you press the select key twice quickly.... Dk launches marvel vs capcom and "freezes" to save memory. Upon exiting mame it "unfreezes" and finds a select key saved in the cache and thus immediately launches the same game again.
So your solution is not to keep pressing a key when the game doesn't launch immediately and not to press keys while mame is exiting and dk is unfreezing itself. Also if you are not using an ipac, the typematic keyrate tends to start repeating a key if it's held down for a while. So don't hold down the select key, just press it.
Unfortunately, there is not much i can do to stop this syndrome as it's just the way keys are handled.
sorry.
-
Just tried it here Shield, It works ok for me.
Tek
-
Due to the way directx caches the keyboard keys, they are "saved" when the gui is busy. Let's say you press the select key twice quickly.... Dk launches marvel vs capcom and "freezes" to save memory. Upon exiting mame it "unfreezes" and finds a select key saved in the cache and thus immediately launches the same game again.
So your solution is not to keep pressing a key when the game doesn't launch immediately and not to press keys while mame is exiting and dk is unfreezing itself. Also if you are not using an ipac, the typematic keyrate tends to start repeating a key if it's held down for a while. So don't hold down the select key, just press it.
Unfortunately, there is not much i can do to stop this syndrome as it's just the way keys are handled.
I don't use DirectX but MAMEWAH has the same problem, particularly if you whack a load of keys while a list is being generated or a game is being launched. It seemed to me that it *should* be possible to stop this problem, turning KeyPreview off and on, or simply ignoring inputs until whatever is happening has completed. I spent a load of time on this but could never eradicate the problem completely :( I must say tho that I don't find it a problem, unless I purposely hit loads of buttons.
Just to add to what Howard said re non-IPAC's, it's worth mentioning that an IPAC in USB mode enables key-repeat (like a keyboard), so if you have one of these I'd recommend you set it to PS/2 mode.
-
It is possible to flush the keyboard cache, so that after you launch a game, all stored keystrokes in memory are discarded.
-PMF
-
It is possible to flush the keyboard cache, so that after you launch a game, all stored keystrokes in memory are discarded.
I'm sure that is so, but I couldn't find a way to do it from VB...any clues?
-
It really depends on how you are reading the keyboard. In my FE, I'm using GetAsyncKeyState, but I could also use DirectInput.
For clearing the windows keyboard buffer, you need to iterate through the messages of the window using PeekMessage, and get the keyboard-specific messages using GetMessage.
I can post a c++ example if you need it.
-PMF
-
It really depends on how you are reading the keyboard. In my FE, I'm using GetAsyncKeyState, but I could also use DirectInput.
For clearing the windows keyboard buffer, you need to iterate through the messages of the window using PeekMessage, and get the keyboard-specific messages using GetMessage.
I can post a c++ example if you need it.
Thanks, but C code is pretty much lost on me ::)
OT Did you get that MW layout code I emailed you? Sorry I haven't checked out Kymaera enough to see if you included it :-[
-
Yeah, I got it a while back, But I was having a hard time making heads or tails of it. It would be nice to create a converter so users of MameWah and Kymaera could swap skins.
-PMF
-
Yeah, I got it a while back, But I was having a hard time making heads or tails of it. It would be nice to create a converter so users of MameWah and Kymaera could swap skins.
It looks worse than it is, purely as there are so many objects (the way I did it is pretty cheap to be honest, just reading values and applying to objects' properties). If anyone wants to make a converter then sure, good idea. I'm not willing to do it really as I know I will be changing the format in the future...and I wouldn't want to have to do it again! If anyone is serious about making the converter, I could turn my code into English so anyone could understand what each line of the LAY file does...
-
If you'd like, I could give you the code for the XML based skin file format I created. It's very flexable, and the way the file format is created, you can add new data types without breaking it and still maintain backward compatibilty. I remember someone asking an open ended question about swapping skins between different FE's and asking if that was possible.
-PMF
-
Getting back to the topic at hand...
I think I found a solution, one that doesn't involve crazy stuff like intercepting the key buffer and clearing it.
It's so stupid, but apparently it works. If you use the setfocus api call (often renamed putfocus in vb) and set the focus to null just before you launch then nothing gets the keys pressed until something else sets focus on itself (in this case the emulator) upon exiting, windows sets the focus back to the next to highest thing in the zorder (which should be your fe). So it doesn't kill the keypresses they just go away to some magical non existant form that we don't care about. :)
-
Getting back to the topic at hand...
I think I found a solution, one that doesn't involve crazy stuff like intercepting the key buffer and clearing it.
It's so stupid, but apparently it works. If you use the setfocus api call (often renamed putfocus in vb) and set the focus to null just before you launch then nothing gets the keys pressed until something else sets focus on itself (in this case the emulator) upon exiting, windows sets the focus back to the next to highest thing in the zorder (which should be your fe). So it doesn't kill the keypresses they just go away to some magical non existant form that we don't care about. :)
Sounds good, I'll have to give it a try :)