Walker on Amiga, keyboard issues

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 287
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Walker on Amiga, keyboard issues

Postby Paradroyd » Tue Jun 16, 2015 8:02 pm

This is by no means a priority with everything else going on, but I just thought I'd mention it as it might help fix some other seemingly unrelated issues.

One of my favorite games on the Amiga has always been Walker. You're basically in a time travelling, mech-like walker. It uses the mouse to move the mech's head and aim the chain gun, the left button to fire the gun, and the right button to lock the target. That all works fine.

The game also uses the "z" key on the keyboard to walk forward/left and the "x" key on the keyboard to walk back/right. This is the part that's broken. On the MIST, it seems to drop key events (both key up and key down) so that pressing the walk keys often either has no effect, or letting the key up doesn't stop walking. A few frantic keypresses will usually eventually trigger a key up event and stop the walker. This makes the higher levels of the game pretty much unplayable.

The interesting thing is that Walker has acted this way on the MIST across many versions of firmware (including the latest, with the USB changes) and across every version of the cores (both the ECS-only and AGA cores) that I've tried on it, going back for more than a year. In fact I think it's been this way since the beginning.

I've also tried it with multiple keyboards, everything from a Logitech K400r wireless, to a couple of different generic USB wired keyboards. They all act the same.

Since it's so consistent it might be easy to track down (then again, maybe it won't) but anyway, there it is.
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

User avatar
Newsdee
Atari God
Atari God
Posts: 1471
Joined: Fri Sep 19, 2014 8:40 am

Re: Walker on Amiga, keyboard issues

Postby Newsdee » Tue Jun 16, 2015 10:46 pm

I've come across similar behavior while doing joypad -> keyboard mapping. I'm not sure what triggers it exactly (I'm still learning how the code works), but I had to call this function every time to avoid the problem:

Code: Select all

user_io_kbd(0x00, buf);

Originally I would only call thsi function when "buf" wasn't zero, but I maybe it's needed so the MiST knows the key is no longer pressed?

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1273
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby MasterOfGizmo » Mon Jun 22, 2015 11:36 am

Newsdee wrote:had to call this function every time to avoid the problem:

Code: Select all

user_io_kbd(0x00, buf);

Originally I would only call thsi function when "buf" wasn't zero, but I maybe it's needed so the MiST knows the key is no longer pressed?


Exactly. Unlike PS2 which sends separate codes for "pressing" and "releasing" a key the USB keyboard simply transfers a list of all keys which are currently being pressed. So if you want to state that no key is pressed anymore then you have to send this empty list.

You might run into some messy results if you press key on the keyboard while using your joystick/key mapping as you'd claim that all key have been release which may not be true. But i don't think that's a problem ...
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1273
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby MasterOfGizmo » Mon Jun 22, 2015 11:37 am

Paradroyd wrote:The game also uses the "z" key on the keyboard to walk forward/left and the "x" key on the keyboard to walk back/right. This is the part that's broken. On the MIST, it seems to drop key events (both key up and key down) so that pressing the walk keys often either has no effect, or letting the key up doesn't stop walking. A few frantic keypresses will usually eventually trigger a key up event and stop the walker. This makes the higher levels of the game pretty much unplayable.


I'll try to reduce the rate at which keyboard events are being sent into the amiga core ...
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 287
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby Paradroyd » Fri Jul 31, 2015 4:23 pm

I haven't spent a ton of time in the CLI/Shell on MIST, but the few times I have, I've noticed something that appears to be similar to the above mentioned problem in Walker. Lots of duplicate characters being generated and / or dropped characters when a key is pressed when trying to type. I have to type very slowly and deliberately to get commands entered properly. I really noticed this a few days ago while using the latest AGA core with the latest firmware. I don't think that this is new to the latest core/firmware though, at least on my MIST.
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1273
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby MasterOfGizmo » Tue Aug 25, 2015 12:36 pm

I have reduced the maximum keyboard report rate from 100 keys/sec to 20 keys/sec in the latest firmware.

This might solve the issue. The latest firmware is available at:

https://github.com/mist-devel/mist-bina ... r/firmware
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 287
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby Paradroyd » Wed Aug 26, 2015 4:06 am

MasterOfGizmo wrote:I have reduced the maximum keyboard report rate from 100 keys/sec to 20 keys/sec in the latest firmware.



I got around to trying it tonight and it looks like it didn't really solve the problem. The keys still seem to get stuck down (and up) a lot. I can't really tell if it's better or not, as the "sticking" seems to be pretty random. At any rate, thanks for looking into it.
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1273
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby MasterOfGizmo » Thu Aug 27, 2015 7:16 am

Paradroyd wrote:I got around to trying it tonight and it looks like it didn't really solve the problem. The keys still seem to get stuck down (and up) a lot. I can't really tell if it's better or not, as the "sticking" seems to be pretty random. At any rate, thanks for looking into it.


Hmm, i'll have another look at it ...
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

chaos
Atari nerd
Atari nerd
Posts: 47
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Walker on Amiga, keyboard issues

Postby chaos » Wed Sep 09, 2015 1:35 pm

Hi,

I think I know what might be the problem - I was fixing some mouse issues, and I checked how the keyboard is handled in the core, it looks like the keyboard signals from the ARM CPU are not crossing the clock domains properly. I'll try to fix it in the evening ...
** my minimig builds: http://somuch.guru/ **

User avatar
alexh
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2748
Joined: Wed Oct 20, 2004 1:52 pm
Location: UK - Oxford
Contact:

Re: Walker on Amiga, keyboard issues

Postby alexh » Wed Sep 09, 2015 3:49 pm

Cool.

Will the solution be a simple double register to avoid metastability?

Or perhaps an async FIFO with Gray code pointers?

Or is it going from Fast-to-Slow or vice versa where you need to pulse stretch or edge detect?

Ricky2u
Atarian
Atarian
Posts: 6
Joined: Tue Sep 08, 2015 6:01 am

Re: Walker on Amiga, keyboard issues

Postby Ricky2u » Thu Sep 10, 2015 10:19 am

Hi Chaos,

Could the fix you are adding correct the issue with Flashtro trainers not responding to mouse commands correctly?

Cheers,

Ricky2u

chaos
Atari nerd
Atari nerd
Posts: 47
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Walker on Amiga, keyboard issues

Postby chaos » Thu Sep 10, 2015 10:24 am

The keyboard / mouse signals come from the SPI clock domain, and there's a flag generated. I did the usual - convert the flag to level change (XOR), sync (double regs) the level change across clock domains, re-generate the flag on the other clock (XOR). Data is just double registered, it should be stable for a longer time anyway. If there'll be any more problems, I'll change it to a CDC FIFO.
** my minimig builds: http://somuch.guru/ **

chaos
Atari nerd
Atari nerd
Posts: 47
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Walker on Amiga, keyboard issues

Postby chaos » Thu Sep 10, 2015 10:38 am

Ricky2u: the mouse issue is already fixed. Will be in next release.
** my minimig builds: http://somuch.guru/ **

Ricky2u
Atarian
Atarian
Posts: 6
Joined: Tue Sep 08, 2015 6:01 am

Re: Walker on Amiga, keyboard issues

Postby Ricky2u » Thu Sep 10, 2015 1:10 pm

Thanks Chaos, that's great news. :D

chaos
Atari nerd
Atari nerd
Posts: 47
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Walker on Amiga, keyboard issues

Postby chaos » Thu Sep 10, 2015 1:18 pm

OK, I think I fixed the Walker keyboard issues, there's just some strange things going on, I 'll have to test some more ...
** my minimig builds: http://somuch.guru/ **

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 287
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Walker on Amiga, keyboard issues

Postby Paradroyd » Thu Feb 25, 2016 6:53 pm

chaos wrote:OK, I think I fixed the Walker keyboard issues, there's just some strange things going on, I 'll have to test some more ...


I completely missed the fact that you were referring to an alternate build and had been trying to get Walker working on the main build and had pretty much given up on it.

Now that I've stumbled across your build, I can confirm that Walker does work perfectly on it, as do a few other things that didn't work before (Nightdawn, etc).

Thanks for your hard work!
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 4 guests