VOGONS


First post, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

http://sourceforge.net/tracker/index.php?func … 551&atid=467234

New joystick patch.

Joysticks handled through the mapper.

Emulation of Gravis PC Gamepad, CH Flightstick Pro &
Virtualpilot Pro, Thrustmaster FCS joysticks, CH Gamecard 3
Automatic, Quickshot QS-163 Smartcard game port cards and
the Gravis Ultrasound's speed compensation ports.

Joysticks selectable by dosbox.conf and hotkeys.

Gravis PC Gamepad - As if two gamepads were connected. Maps
to standard joystick positions + a1, a2
(autofire1 & 2) for each joystick. Autofire and digital
movement are emulated. Autofire rate is adjustable by
config or hotkeys.

CH Flightstick Pro & Virtualpilot Pro - Maps to standard
joystick positions with throttle on joy b's y-axis + hu, hd,
hl, hr
(up, down, left, right) hat positions. Virtualpilot Pro has
two additional buttons 5 & 6, and a second hat: hu2, hd2,
hl2, hr2.
These CH sticks use button combinations to create the
additional positions.

Thrustmaster FCS - Maps to standard joystick positions + hu,
hd, hl, hr hat positions. The FCS uses joy b's y-axis to
implement its hat positions.

Speed compensation adjusted by emulated card utils, or
through dosbox.conf, dbjoy, and hotkeys.
dbjoy emulates Ultrasound's ultrajoy util and also selects
between gamecard3 and smartcard emulation.

The hotkey adjustments emulate smartcard's speed compensation
util's sound effects.

dosbox.conf examples in joy.conf
apply to CVS source: patch -up1 < joypatch

one thing still to do is handling of hat designated sdl input isn't finished.

Enjoy!

Attachments

  • Filename
    joypatch.zip
    File size
    45.62 KiB
    Downloads
    317 downloads
    File license
    Fair use/fair dealing exception

Reply 1 of 14, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Though accurate, some of the programs I've tested don't like absolute min axis value so the changes below adjusts it so they're happy.

static void write_p201(Bitu port,Bitu val,Bitu iolen) {
joytimer = -1;
stick[0].xcount=(Bitu)(((long)stick[0].xpos+34000)>>joyspeed); // gravutil & dynamix aoe don't like full min value
stick[0].ycount=(Bitu)(((long)stick[0].ypos+34000)>>joyspeed); // so we shift it a little(+3400 instead of 32768).
stick[1].xcount=(Bitu)(((long)stick[1].xpos+34000)>>joyspeed);
stick[1].ycount=(Bitu)(((long)stick[1].ypos+34000)>>joyspeed);
}

Reply 4 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

i don't want to be rude but i prefer unified diffs

cvs diff -u 

But if you don't feel like it. don't do it. I'll manage.

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 14, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

I noticed there's a couple of //todo beep comments; could use the sound effect function I made for the hotkeys for those. Perhaps move the effect stuff to speaker.cpp and available from speaker.h. For kicks could add a startup beep:)

Reply 8 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

joystick.cpp fails with current cvs. I manually added it.

It compiled and starting some testing in the near future (when I get joystick running under linux) I personally think you've added a bit too many keybinds for it. I don't think many people will enjoy/have the need to change the joysticktype during runtime. The other variables i doubt even as well. Although it's nice to see somebody using different keys then the F-serie. (Gives some inspiration)

Water flows down the stream
How to ask questions the smart way!

Reply 9 of 14, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

I checked the patch and ran into the same thing and also manually added it to be sure the patched worked. When cvs created the patch it just minused the whole old joystick.cpp file and plused the whole new one. Why it did that or not take the patch...

The speed compensation hotkeys; I was just emulating smartcard's util. They could be removed since there's dbjoy and dosbox.conf(read my comment in the code). Autofire rate.. once the setting works, I don't find a need for changing it. You're wrong about cycling through the joysticks with a hotkey though; depending on the game, it's different which joystick type is better to use; whether going from a game like raptor which benefits from gamepad's digital axis movement to a flightsim like aoe or cycling to determine which hat type is preferable in a single game. Restarting dosbox quickly becomes inconvenient.

Reply 10 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

usually it's because of line ends.
i think there is an option -b to deal with that.
Either way.

I think it's too much to have hotkeys+dbjoy+configfile.
While only one is really1 needed. (not speaking about conviance here)

I think I'll include it in my beta testers build and hear from them.

Water flows down the stream
How to ask questions the smart way!

Reply 11 of 14, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Beta testers sounds good. Cycling joysticks is only hotkey+configfile but if I had to choose it'd be hotkey. dbjoy is an emulation of ultrajoy and switch between port 200h emulation type. If you wanted to reduce the code, dbjoy could be removed. Port 200h emulation too for that matter. I'd leave the gus sc handling for completeness though.

Reply 12 of 14, by priestlyboy

User metadata
Rank Oldbie
Rank
Oldbie

It's because you have the old Preamble with the mistake word Library in the way. So you have to remove that from your patch for it to patch correctly on the CVS versions. Lol.

Ieremiou
----------
Helping Debug DOSBox.

Reply 13 of 14, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

There's one potential problem I found...by default both joysticks are enabled. This might lead to some confusion when user maps joystick_0 correctly, but the game defaults to joystick_1 which is not mapped. Perhaps only the number of real joysticks should be enabled - BUT, as I understand, the point of the mapper is that joystick axes and buttons could be mapped to a key or a mouse? In this case a user with no joysticks won't have any virtual joysticks enabled. Perhaps it would be best to add an option in the config file where it would be possible to select the number of emulated joysticks...Some games also autodetect the joystick and require you to calibrate it. Since I am not always using it, it would be helpful to disable all joystick emulation in this case.

Reply 14 of 14, by priestlyboy

User metadata
Rank Oldbie
Rank
Oldbie

Got the same problem gulikoza and an example:

Since both joysticks are on by default. WC:Privateer thinks I have a joystick enabled.
And of course I don't even have a joystick ported to my computer.. D'oh.
So there should be an option to turn on/off joystick detection or a better/more real joystick
detecting routine by DOSBox.

Ieremiou
----------
Helping Debug DOSBox.