Virtual joystick support (games.h) for more targets

Requests for features
Post Reply
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Virtual joystick support (games.h) for more targets

Post by RobertK »

It would be nice to have games.h virtual joystick support for more targets. QAOP-NM and Cursor-Keys (if available) would be good for a start, additional joystick support even better. Here is my wish list:

1. Interesting targets for my Deepspace game (all these have well performing high-res graphics):
Hübler Grafik-MC
Robotron Z1013 (see below)
Otrona Attachè
Mitsubishi Multi8
Robotron HC-900, KC85/2..KC85/5
Sharp X1
Tatung Einstein

2. Philips VG5000: the AZERTY keyboard requires special handling of keyboard input, virtual joystick support would make it much easier.
"AQOP-N," would be the equvialent to QAOP-NM
"Cursor and Space" would also be nice to have.
Joysticks 1 and 2 would make it complete.

3. Robotron Z1013
This one is complicated...
The Z1013 initially came with a terrible membrane keyboard with an alphabetic layout:
Image
See http://www.kc85.de/Service/Dokus/z1013HB.pdf (keyboard matrix: see p.74)
Naturally, you can't use QAOP-NM or full Cursor control with that keyboard.
In the J1013 emulator, the membrane keyboard can be activated using "Extras" -> "Peripherie" -> "Folientastatur". In JKCEMU: "Extras" -> "Tastatur".
There are no cursor up/down keys, only left and right.
Holding the S4-Key and pressing R,S,P,Q gives all four directions, the codes are:
S4-R 10h down
S4-S 11h up
S4-P 08h left
S4-Q 09h right
But this of course cannot be used for game control.

Later, better keyboards ("Alpha", "Brosig") with a QWERTZ layout and full cursor control were developed and widely used.
See here: https://hc-ddr.hucki.net/wiki/doku.php/ ... n/tastatur

Conclusion: it would be nice to have "QAOP-NM" and "Cursor + Space" for the QWERTZ keyboards, and an extra set for the mebrane keyboard. On the Robotron forum they told me that "Cursor L R / U / Space" was often used for directional controls on the membrane keyboard, but there was no standard for the Fire button, so I would propose P and Q.

Regarding Joystick support on the Z1013, there have been various solutions, all connected to the user port and working independently of the keyboard:
https://hc-ddr.hucki.net/wiki/doku.php/z1013/joystick
1. practic 1/1988 --> two sticks (multiplex), sound output, widely used
2. jugend+technik 6/1987 --> one stick, sound output
3. practic 4/1987 --> two sticks, fire using diodes, no sound
4. ERF-Soft --> like 1., but directions are mixed up

They told me that practic 1/1988 was the most common joystick type, so I think it would be enough to support this one.

The practic 1/1988 joystick is described here (p.21 of the PDF):
https://www.tiffe.de/robotron/Z1013/Practic_z1013.pdf

For testing the joystick support, I would recommend the JKCEmu emulator instead of J1013 and using a USB joystick/gamepad. In JKCEmu, first go to "Extras" - "Einstellungen" -> Z1013 -> "Anwendertor" -> "2 Spielhebel nach practic 01/1988". Then "Extras" - "Joystick" -> "Verbinden".
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Virtual joystick support (games.h) for more targets

Post by dom »

Todays build should have virtual joysticks for: Einstein, Multi8, HGMC, Attache, KC, X1.

As far as I can tell, vg5k has had support for the two physical and 4 virtual joysticks for quite a while.

I've not taken a look at z1013 yet, but it should be possible to get the two standard virtuals: qaop, 8246 + hardware joystick + a layout for membrane working. At the moment it looks like there's just the two virtuals but the strings definitions are missing.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Virtual joystick support (games.h) for more targets

Post by RobertK »

dom wrote: Sat Feb 19, 2022 10:53 amTodays build should have virtual joysticks for: Einstein, Multi8, HGMC, Attache, KC, X1.
Thank you so much! All of them are working perfectly, Deepspace is already functional on these targets.

The VG 5000: my mistake, it already had virtual joystick support. Ah, it's "AQOP-MN" instead of "AQOP-N," - très bien!

I'll keep waiting for the Z1013...
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Virtual joystick support (games.h) for more targets

Post by dom »

I've copy pasted some code for z1013 for 1/88 support - I've not got/can't find a usb joystick unfortunately so it's completely blind work. qaop and 8246 are also available of course.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Virtual joystick support (games.h) for more targets

Post by RobertK »

Thanks for QAOP and 8246, that makes my game work on the Z1013!

However, there is no reaction from the 1/88 joysticks...

I don't know if it helps, but when I select "2 Spielhebel practic 4/1987", pressing Up, Fire 1 or Fire 2 on the USB Joystick triggers "Fire 1" on both 4/87 joysticks.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Virtual joystick support (games.h) for more targets

Post by dom »

Ah, there was a little issue where joystick1 and joystick2 were both read as joystick1 so it did help slightly!

I've just transcribed the code from here: https://hc-ddr.hucki.net/wiki/doku.php/z1013/joystick to here: https://github.com/z88dk/z88dk/blob/mas ... ck.asm#L44 so in theory it should work assuming I've not made any typos.

I've just checked the jkcemu source code and it looks like I'm out of luck (I use a Mac):

Code: Select all

  public static Joystick openJoystick( int joyNum )
  {
    Joystick joystick = null;
    switch( Main.getOS() ) {
      case LINUX:
        joystick = LinuxDeviceIO.openJoystick( joyNum );
        break;
      case WINDOWS:
        joystick = WinDeviceIO.openJoystick( joyNum );
        break;
    }
    return joystick;
  }
Post Reply