VOGONS

Common searches


First post, by ledow

User metadata
Rank Newbie
Rank
Newbie

I was just wondering if there is any chance of getting support in DOSBox for the LPT Joystick adaptor used in the game Slicks 'n' Slides. I registered this game YONKS ago because we used to play it in school every lunchtime and I'm now creating a multi-emulator "console" using a set of USB joypad adaptors and a TV Out to play all the games that I used to play.

It comes with a diagram (attached) which basically uses a different pin on the LPT port for each joypad movement (up, down, left, right, fire) so allowing all four players to simultaneously move diagonally and fire without interfering with each other. The diagram contains no electronics other than protective diodes so emulating it would simply be a matter of "setting" the bits on the "virtual" LPT data input pins (and possibly things like the paper out pins etc.) to correspond to the controller buttons.

Would it be possible and/or likely to see support for this sort of input system? I know joystick support in general is limited currently but it looks like an interesting, simple project for someone with programming ability, as well as a good test of any joystick input system - mapping up to four "real" USB or gameport joysticks (via SDL/DirectInput one would assume) to "virtual" LPT pin inputs. Also, I don't think that Slicks was the ONLY game to use this kind of adaptor.

I've attached the ASCII circuit diagram from the game (although you may have trouble reading it in "modern" Windows editors as the character set makes it awkward - an old DOS editor like EDIT does the trick).

Thanks

Attachments

  • Filename
    SS-LPTC.TXT
    File size
    2.08 KiB
    Downloads
    133 downloads
    File comment
    Circuit diagram included in Slicks 'n' Slides.
    File license
    Fair use/fair dealing exception

Reply 1 of 2, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The general "wiring" of the joystick input to an emulated lpt port should
be not much of a problem, sdl should support 4 joysticks.
The timing might be a problem, depends a bit on how they query the
lpt ports. Do you have some sort of programming information about
that device?

Reply 2 of 2, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's only polling switches in a matrix, timing shouldn't be a problem.

Pin 6 is always set to 1.
It switches pin2 off and 3-5 on.
Now it can read the button states of Controller1 on pin 10-13,15.

Next it switches pin3 off and 2,4,5 on.
Now it can read the button states of Controller2 on pin 10-13,15.

Next it switches pin4 off and 2,3,5 on and reads controller 3...

Pseudocode how this could be emulated:


Bitu datareg;

void write_lpt_data(value){
datareg=value;
}

Bitu read_lpt_status(){
Bitu controller;
switch(datareg&0x1f)
{
case 0x1e: controller=0; break;
case 0x1d: controller=1; break;
case 0x1b: controller=2; break;
case 0x17: controller=3; break;
default: return 0;
}
Bitu retval = 0x78; // no button pressed

if(controllers[controller].up) retval ^= 0x40;
else if(controllers[controller].down) retval ^= 0x80;

if(controllers[controller].left) retval ^= 0x20;
else if(controllers[controller].right) retval ^= 0x10;

if(controllers[controller].buttonpressed) retval ^= 0x08;

return retval;
}

No warranty though 😉

Edit: ignore unused bits