Virtual I/O / USB Joystick Driver / Zsnes

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Virtual I/O / USB Joystick Driver / Zsnes

Postby raeumler » Sun Mar 20, 2011 10:50 pm

hi there,

i have a problem using usbjstik with zsnes (snes emulator, also nlke doenst regognize the gamepad). i'v testet the gamepad with thrust.com and the J option, everything works fine. but when i start the emulator, no button press is regognized. i thought it would be the virtual i/o emulation, but this doesnt work. when i set l:1 (there comes an errormsg when i use port numbers, so i thought 1 is for on and 0 for off) and i check it with option S, it displays "Virtual i/o: No".

did i something wrong? i don't have any dos game to test, only the emulators (also i have no hd or cdrom just floppy ^^)

thx in advanced for any solution!

greets

raeumler
raeumler
 
Posts: 5
Joined: Sun Mar 20, 2011 10:38 pm

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby Bret » Mon Mar 21, 2011 4:36 am

I don't use SNES myself, so can't help you directly with that.

When using the /I:# option with USBJSTIK, the # must be a number between 200h & 20Fh (decimal 512-527). There is rarely a reason to use the /I:# option, though. It's there mostly for when you have a regular game port (or another program that emulates a regular game port), and you want the USB joystick/gamepad to emulate a second physical game port. None of this will do you any good unless you have a program that actually understands how to address more than one game port at the same time, and such programs are EXTREMELY rare. It's best not to mess with the/I:# option unless you really understand what you're doing.

You can't do anything to directly enable or disable I/O virtualization except make sure a compatible memory manager is installed: 386MAX or later versions of Microsoft EMM386 are the only ones I know of that are compatible. None of the other memory managers (including JEMM and older versions of MS EMM386) are compatible, as far as I know. If a compatible memory manager is installed, USBJSTIK will detect it and automatically enable I/O virtualization. If the USBJSTIK status shows that I/O virtualization is disabled, it means either that you don't have a memory manager installed at all, or the one you have installed does not support I/O virtualization.

When you use THRUST to test things, you need to use it with the B, P, or I options (all equivalent to each other) to test I/O virtualization. If you don't use one of those options and are testing with USBJSTIK installed, it will test the joystick BIOS instead of testing the game port I/O address.

I suspect SNES may require I/O virtualization, since it probably tries to access the I/O port directly instead of using the joystick BIOS (many joystick programs do it this way, even when they shouldn't). If the joystick BIOS works properly (which it doesn't on all computers), it is ALWAYS better to use the BIOS instead of the I/O port. SNES might have an option somewhere that will tell it to use the joystick BIOS instead of the game port I/O, and if it does, you should select that option. If it doesn't, then you will probably need to enable I/O virtualization (by installing an appropriate memory manager) before SNES will work.

Bret
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby raeumler » Mon Mar 21, 2011 5:02 am

hi bret,

thx for the fast answer.

i thought the virtual i/o is to emulate a standart gameport (is it? also if you have no other real gameport installed?). zsnes don't have an option to change between bios and i/o port, but it has an option to use port 209h. i've tried the emm386.exe that comes with partition magic (i use win7, so there is no standart emm386.exe anymore), but good to know, so i can try a different manager.
for understand: for turning on the virtualization, i need an ems manager that is supported and if a memory manager is regognized it will turn on automaticly on addr 201h (also i dont understand addressing anyway ^^), could it be that the gameport is asked on another address by zsnes or is it a range that is requested by standart? (so i don't have to try out different addresses)

i will try an different ems manager....

if you want to try out, maybe for checking compatiblity (i think much users need an working usb driver for joypads, for changing old computers in standalone emulatormachines, like i did)
the emulator is up there: http://www.zsnes.com/

greets and thanks in advanced

raeumler
raeumler
 
Posts: 5
Joined: Sun Mar 20, 2011 10:38 pm

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby raeumler » Mon Mar 21, 2011 6:20 am

hi again,

mouse works fine., virtualisation works fine, also thrust D and B works fine @ 201h with another ems manager. but it doesn't work in zsnes. can you tell me how do i set the address to 209h? cause there is an option to use a gameport on 209h (dez 521). usbjstik l:521 or usbjstik l:209 doesn't work, comes with an error message, only 1 or 0 is regognized also with no effect..... any idea?!
raeumler
 
Posts: 5
Joined: Sun Mar 20, 2011 10:38 pm

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby Bret » Mon Mar 21, 2011 6:57 am

Looking at ZSNES, I suspect you may not be able to get it to work with USBJSTIK. In just a quick look at the source, it looks like ZSNES tries to access the I/O ports directly from protected mode (DPMI), and doesn't even have an option to use the BIOS. I don't think this will work with USBJSTIK, though you can keep trying. ZSNES probably needs to access the game port (or preferably the BIOS) from real (V86) mode, not protected mode, which will require changes in the way ZSNES works internally.

Anyway, it looks like you're using the wrong option with USBJSTIK to select the I/O port. You're using L when it should be I. 0 and 1 are valid values for the L option, which controls whether or not USBJSTIK loads itself automatically into Upper Memory. 0 and 1 are invalid for the I option, which controls which I/O port is virtualized.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby raeumler » Mon Mar 21, 2011 9:48 am

oh ok thank you, i thought I is lower letter for L ^^

changed to 209h but it doesnt work. i think i will have to use another emulator. reporting if it works if it works...

greets

raeumler
raeumler
 
Posts: 5
Joined: Sun Mar 20, 2011 10:38 pm

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby raeumler » Tue Mar 22, 2011 1:45 am

ok, now i've tried every nes and snes emulator for dos what is outthere... not one works with joystick support. start to trying the genesis/megadrive emulators, destroyed my floppy drive, so its now on ice...
raeumler
 
Posts: 5
Joined: Sun Mar 20, 2011 10:38 pm

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby Bret » Tue Mar 22, 2011 3:56 am

Sorry to hear about the floppy drive. You should be able to use a USB floppy drive with my programs, though.

I suspect you're going to run into the same joystick problems with all emulators, though. I think they pretty much all use the same method to access the joysticks (direct I/O access from protected mode). They simply aren't written with modern hardware (USB) in mind, where game ports often don't even exist and joysticks must be emulated. You may want to contact one of the program authors and let them know what you've discovered. I'm sure at least one of them would like to see their program work with USB joysticks & gamepads in DOS -- it would be a major asset to have over their competitors.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Virtual I/O / USB Joystick Driver / Zsnes

Postby jollyllp » Wed Jul 03, 2013 5:46 pm

HIDKeys is a USB keyboard with 17 keys. This is an example demonstrating how to implement HID class compliant USB devices. It uses the operating system built-in driver for USB keyboards and thus needs no additional software on the host. For a full-blown keyboard implementation..........
jollyllp
 
Posts: 2
Joined: Wed Jul 03, 2013 5:26 pm


Return to Programs

Who is online

Users browsing this forum: No registered users and 1 guest

cron