joystick test program with source code

Started by neko68k, January 31, 2018, 07:51:44 AM

Previous topic - Next topic

neko68k

I wrote a little program for joystick testing so I could learn how all the controllers work. Supports CPSF, MSX, and all other 'generic' controllers, MegaDrive 3 and 6 button with auto detection, and Cyberstick digital and analog modes. Source code is included if you want to see how the controllers work. Cyberstick modes require ajoy.x to be loaded.

Updates:
V1 - original release
V2 - probably fixed vblank problem
V3 - added joystick 2 support

Requirements
IOCS.X or HIOCS

Download:
joytest

Repo:
BitBucket

Known issues:
None known.




samaron

Neat! I'll give this a try tomorrow. Should have a 6-button Mega Drive controller arrive then. Hopefully I wired the adapter right. :P

kamiboy

Incredible work! This will come in very handy, cheers.

hyrulebr


hoshikawa

scrolls like crazy on my XVI, totally unusable.

neko68k

Quote from: hoshikawa on January 31, 2018, 09:08:02 PM
scrolls like crazy on my XVI, totally unusable.

I forgot to put it all back in the vblank handler. I'll put an update and a repo or something later today

neko68k

Added V2 to the first post and a link to a Git repo.

samaron

Finally got around to testing it out. V2 were scrolling on my XVI, so still needs some work I suppose. :P

neko68k

uff. it works on my pro. does it work in 10mhz mode?

samaron

Unfortunately, switching it to 10 MHz didn't work either. Was still scrolling. My XVI is fitted with a MC68882 FPU, if that is of any relevance.

neko68k

I did some investigating and was able to reproduce the scrolling issue. Maybe this isn't the case for everyone but here's what I found. When using ROM IOCS it seems like setting the position of the cursor is unsupported. This causes the screen to scroll instead of redraw. So that means that IOCS.X/HIOCS.X is required.

I first noticed this when I quit LHES on the games hard disk and ran joytest.x. The games disk unloads IOCS.X after LHES quits, so ROM IOCS is being used. So if you've got a !Start.bat for joytest.x and you use the QQ method to run it, quit LHES, or unload IOCS.X/HIOCS.X you will be using ROM IOCS and joytest.x won't work correctly. Simple. :)

Here is a video demonstrating. The first run of joytest.x is with IOCS.X loaded. The second run is with IOCS.X unloaded, thus using ROM IOCS.

Basically, never use ROM IOCS anyway. The games disk does this for a reason and is fine though.

https://www.youtube.com/watch?v=hVR0I_WOVNE


samaron

#11
Tested this just now, and indeed the scrolling was gone after loading IOCS.X. :)

EDIT: A bit off-topic.... what is this IOCS.X anyway?

neko68k

#12
IOCS provides high level access to graphics hardware mostly. ROM IOCS is old and buggy so it is replaced with IOCS.X/HIOCS.X I'm not really using it for anything here but I guess ASCII escape codes are handled by IOCS.

samaron


neko68k

version 3 is up with support for joystick 2 port.

samaron

Neat, guess I'll test the 2nd port now. Never actually done so due to the, uhm, convenient placement... :P I'll make sure to remember running IOCS.X/HIOCS.X first this time. :)

neko68k

They're both on the front on the pro, yay