A recap first. There are two approaches for a user program, game in this case, to determine the keys being pressed:
1) rely on the ROM interrupt routine that will store the result in LASTK system variable
2) read the rows of the keyboard with IN Z80 instruction outside of the ROM routine
The former having the advantage of needing less code by the developer. However aside from SHIFT + Key combinations, it does not work for simultaneous keypresses. The latter approach is more involved to incorporate in programs but can be used to determine multiple simultaneous keypresses.
Chopper Drop 3000 is a great game to have in the emulator so I was delighted when you allowed me to include it. You may recall that the initial versions of this iOS app had a bug and made the game run at an unplayable speed. Once I fixed that point and started added the gamepad controls I was keen to see how playable this game would be. As per your post we can tell it uses the ROM interrupt routine approach. Hence, at the time I added the single key press mode in the gamepad settings screen specifically with this game in mind. This option started off pretty much as your suggestion described, but I evolved the concept so that multiple keys could be pressed but the last key would take precedence in terms of the value that the ROM routine would see as being pressed and when released would then return to previous keys if still pressed. There is also some special timing logic to ensure keypresses were kept long enough to be logged despite another newer key then being pressed - this results in a small but sometimes perceptible time lag. Basically it's a fudge but most of the time a direction movement shouldn't stop a fire action.nama wrote: ↑Fri Oct 06, 2017 8:38 pm Hi,
Is there a way to have an option where the virtual joystick activates in 'single push' mode. In other words, and as an example, if you push the virtual joystick left, and continue to hold it left, can it just be register as a single keystroke (on then off), as opposed to being seen as still having the key held down. Games like Chopperdrop act on single keypresses where only one key can be pressed at any one time. So presently when the joystick is pushed left and held there, you can't fire. Not fun.
Would be a great option.
Phil
As an experiment try quitting the game and see the effects of toggling the single key press mode on and off in conjunction with the characters displayed on the BASIC input screen. Other things to try are switching to the direction pad mode (as I suspect slight movement unintended vertical movement of the joystick control could be preempting the fire button sometimes) and also holding the fire key perhaps slightly longer to see that it does fire even when pressing another key.
The above aside, the ideal solution would be to remove the single keypress limitation from the game. So I contacted Johan Koelman of Dr Beep fame to ask if he would be willing to try and update Chopper Drop 3000 to use the other keyboard reading approach. He agreed. Obviously we're not talking TheMrCerebro rewrite or any branding changes. So Phillip if you agree, can Dr Beep have your blessing and take a look? If you have the source code that would be ideal but Johan says he's quite handy with a hex editor.
With the rate that Dr Beep releases new games the Software section of this iOS app could be called "Dr Beep et al." at this stage...
Kevin