nfg.forums

NFG Forums => SIG X68000 => Topic started by: neko68k on January 31, 2018, 07:51:44 AM

Title: joystick test program with source code
Post by: neko68k on January 31, 2018, 07:51:44 AM
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 (http://retropc.net/x68000/software/system/iocs/hiocsp14/)

Download:
joytest (https://www.dropbox.com/s/nsf4ew2jie6aetj/joytest_2018-19-2.zip?dl=0)

Repo:
BitBucket (https://bitbucket.org/neko68k/joytest)

Known issues:
None known.

(http://x.rokumanhassen.jp/joytest3.png)

Title: Re: joystick test program with source code
Post by: samaron on January 31, 2018, 08:58:16 AM
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
Title: Re: joystick test program with source code
Post by: kamiboy on January 31, 2018, 07:09:16 PM
Incredible work! This will come in very handy, cheers.
Title: Re: joystick test program with source code
Post by: hyrulebr on January 31, 2018, 08:22:00 PM
Nice!  :D

Thank you!
Title: Re: joystick test program with source code
Post by: hoshikawa on January 31, 2018, 09:08:02 PM
scrolls like crazy on my XVI, totally unusable.
Title: Re: joystick test program with source code
Post by: neko68k on February 01, 2018, 12:52:20 AM
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
Title: Re: joystick test program with source code
Post by: neko68k on February 01, 2018, 08:21:02 AM
Added V2 to the first post and a link to a Git repo.
Title: Re: joystick test program with source code
Post by: samaron on February 03, 2018, 01:30:40 AM
Finally got around to testing it out. V2 were scrolling on my XVI, so still needs some work I suppose. :P
Title: Re: joystick test program with source code
Post by: neko68k on February 03, 2018, 12:17:13 PM
uff. it works on my pro. does it work in 10mhz mode?
Title: Re: joystick test program with source code
Post by: samaron on February 03, 2018, 11:38:41 PM
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.
Title: Re: joystick test program with source code
Post by: neko68k on February 13, 2018, 05:31:57 AM
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 (https://www.youtube.com/watch?v=hVR0I_WOVNE)

Title: Re: joystick test program with source code
Post by: samaron on February 13, 2018, 08:13:47 AM
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?
Title: Re: joystick test program with source code
Post by: neko68k on February 13, 2018, 08:55:14 AM
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.
Title: Re: joystick test program with source code
Post by: samaron on February 14, 2018, 06:42:22 AM
I see, thank you!
Title: Re: joystick test program with source code
Post by: neko68k on February 20, 2018, 06:50:57 AM
version 3 is up with support for joystick 2 port.
Title: Re: joystick test program with source code
Post by: samaron on February 20, 2018, 08:00:59 AM
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. :)
Title: Re: joystick test program with source code
Post by: neko68k on February 20, 2018, 08:03:08 AM
They're both on the front on the pro, yay