English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   support.WinUAE (http://eab.abime.net/forumdisplay.php?f=5)
-   -   Virocop issue with WinUAE Input>Configuration #1 (http://eab.abime.net/showthread.php?t=98418)

hexaae 12 August 2019 10:17

Virocop issue with WinUAE Input>Configuration #1
Hi Toni,
I've found an issue with Virocop AGA (WHDLoad) and disk version where 2nd joystick button is ignored when I set:

...if I revert to Game Ports Panel it does work instead:

The strange thing is that only Virocop AGA seems affected: ALL other games with a 2nd joy button work fine with Configuration #1 instead.
I use a Speedlink USB Competition Pro SL-650212-BKRD.

My cfg: https://1drv.ms/t/s!ApMUGr0cuN39gcA45Xa8VmLASJE9bA

jotd 12 August 2019 12:33

Virocop AGA with whdload patch... maybe share the full archive so Toni can test?

The joypad read code is as follows:


        movem.l        d1-d7/a3-a5,-(sp)

        lea        (_ciaa),a4
        lea        (_custom),a5

        cmp.w        #0,D0
        beq        .port0
        cmp.w        #1,D0
        beq        .port1
        move.l        #JP_TYPE_NOTAVAIL,D0        ; neither port 0 or 1 !
        bra        .rjexit

        move.w        (joy0dat,a5),d7                ; joystick 1 moves
        bsr        .detect_controller

        moveq        #CIAB_GAMEPORT0,d3        ; 1rst button (left mouse)
        moveq        #10,d4                        ; 2nd button (right mouse)
        move.w        #$F600,d5
        bsr.b        .port_test
        IFD        QUIT_JOYPAD_MASK
        move.l        d0,d1
        and.l        #QUIT_JOYPAD_MASK,d1
        cmp.l        #QUIT_JOYPAD_MASK,d1
        bne.b        .noquit
        pea        TDREASON_OK
        move.l        (_resload,pc),a2
        jmp        (resload_Abort,a2)
        movem.l        (sp)+,d1-d7/a3-a5


        move.w        (joy1dat,a5),d7                ; joystick 1 moves
        bsr        .detect_controller

        moveq        #CIAB_GAMEPORT1,d3        ; 1rst button (red)
        moveq        #14,d4                        ; 2nd button (blue)
        move.w        #$6F00,d5

        bsr        .port_test

        bra        .rjexit

        ; first, perform a 1-button joystick compatible test for red button
        ; then a complete test of the joypad buttons, counterchecked in the end
        ; in order to detect a 2 button joystick (not testing would result in
        ; all buttons pressed, which is wrong)

        moveq        #0,d6

        btst        d3,(a4)
        bne.b        .no_red_button
        bset        #JPB_BUTTON_RED,d0        ; fire/lmb

        ; this is the joypad specific part

        bset        d3,(ciaddra,a4)
        bclr        d3,(a4)
        move.w        d5,(potgo,a5)                ; a5=$DFF034
        moveq        #17-1,d1        ; was done 24 times, not needed

        bra.b        .lbC000746        ; removed: shaving timer issue too close
                                                ; 2017: reinstated (identical as Wepl timing fix)

        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        tst.b        (a4)
        move.w        (potinp,a5),d2                ; a5=$DFF016
        bset        d3,(a4)
        bclr        d3,(a4)
        btst        d4,d2
        bne.b        .lbC00077C
        bset        d1,d6
        dbra        d1,.button_loop
        ; all buttons have been read, reset data direction register

        bclr        d3,(ciaddra,a4)

        ; acknowledge port input

        move.w        #$FF00,(potgo,a5)        ; a5=$DFF034        ; correct value according to robinsonb5@eab

        ; JOTD: added this in 2006 after 8 years of not knowing why
        ; standard 2nd button joystick fails the multi-button test
        ; and re-fixed this in 2019 after many failures
        btst        #9,d6                ; if this bit is set, then there was a read problem
        beq.b        .read_ok        ; meaning this is not a joypad but a joystick

        ; button 2 of the joystick

        bset        #JPB_BUTTON_BLUE,d0        ; fire2/rmb only
        bra.b        .out

        lsl.l        #7,d6        ; correct bits offsets
        ; all button reads are valid
        and.l        #JP_BUTTON_MASK,d6
        or.l        d6,d0
        move.l        D0,-(A7)
        movem.l        D1/D2,-(A7)
        move.l        .old_buttonmask(pc),D0
        bsr        .button_test
        movem.l        (A7)+,D1/D2
        lea        .old_buttonmask(pc),a4
        move.l        D0,(a4)
        or.l        (A7),D0
        move.l        D0,(A7)
        move.l        (A7)+,D0


hexaae 12 August 2019 14:14

Here is the full archive ready to run out-of-the-box in a WB environment with WHDLoad…

jotd 12 August 2019 14:42

but how to switch from standard config to custom? I have tried selecting "gamepad" first, then switching to "input"... but it still works..

I never was able to understand how this remap thing worked... I'm very glad with CD32 joypad setting...

hexaae 12 August 2019 15:48

Look at the pics above: Input, in the upper left and switch to Configuration #1.
Doesn't matter what you set under Game Ports I guess, here is mine:

Toni Wilen 12 August 2019 20:51

Does Gameports panel joystick vs gamepad option make the difference?

hexaae 12 August 2019 21:31

Just found Virocop AGA's 2nd button with Input > Configuration #1 works only when I select Game ports > … CD32 pad.
Selecting Joystick, Gamepad, Default… they don't work as 2nd button. This incompatibillity happens only with Virocop AGA though, strange… Normally I can use Configuration #1 with Joystick, Gamepad, Default with any other 2nd button game (Turrican 2-3, Bubble & Squeak, Bubba 'n' Stix, Lionheart, etc.)

Toni Wilen 16 August 2019 21:46

I can't find anything wrong in normal non-CD32 mode (gameports panel or input panel). Both buttons work correctly and code snipped above looks fine, no weird tricks used.

hexaae 17 August 2019 21:34

Aaargh… Thank you Toni for testing.
Deleted all input section in my old cfg and indeed now it works even in Configuration #1 mode :guru

Here are both (old, not working and new, working) if you care to understand what's wrong in the buggy cfg to screw button1 detection in WinUAE 4.2.1 with Virocop AGA (old buggy cfg: 'Hexaae_UAE_4.2.0.uae'):

Toni Wilen 18 August 2019 09:13

There are too many differences (even different buttons used)..

If you run some joystick tester with your old config, what does it report? Does it report button not working at all or reporting it being stuck in pressed state? (EDIT: actually try this using CD32 boot menu, does 2nd button work there?)

EDIT2: If you map 2nd button to some keyboard key, does it still work incorrectly? (This at least would be something I probably would be able to duplicate)

EDIT3: One more idea: open your old config in text editor, manually cut all lines that begin with "input.1.joystick.0.". Does this change anything? If not, what if you also delete all lines that have ends to =JOY1_3RD_BUTTON?

hexaae 18 August 2019 16:12

Using http://m68k.aminet.net/package/driver/input/JoyPortTest from WB with buggy cfg file I see no button working from Workbench (!!!) but they do work when in games, except 2nd button in Virocop AGA only :nuts

Yes, I deleted every input line from the cfg file to create my new working cfg indeed (must be something in there)…

As for deleting "input.1.joystick.0." only from buggy cfg, yes then 2nd button works again in Virocop AGA.

These are the removed lines:
input.1.joystick.0.friendlyname=HIDI2C Device

This http://truehumandesign.se/s_diffinity.php is excellent to compare cfg files

DamienD 18 August 2019 17:23


Originally Posted by hexaae (Post 1339569)
This http://truehumandesign.se/s_diffinity.php is excellent to compare cfg files

Word's "Compare Documents" does virtually the same things; no need for another tool :p

jotd 18 August 2019 18:51

Beyond Compare is a very good tool. Not free though

hexaae 18 August 2019 22:27

Diffinity is free and graphically shows text insertions etc. Many compare tools just hilite different text strings on both sides, but the graphic approach is faster and smarter IMHO showing missing/added text much easily.
It's also very smart to re-align same text side by side while scrolling up/down.

Tomislav 19 August 2019 12:01

I use WinMerge.

I don't have MS Office, thus I can's use Word. Anyway, Word can't compare binary files.

Toni Wilen 19 August 2019 12:10

Plain diff comparison won't help in this case because input lines depend on header lines (=which device is affected by following lines)

I think I know what is going on (because removing those CD32 lines "fixed" it)..

Toni Wilen 19 August 2019 18:19

Do you have "HIDI2C Device" still in use/plugged in (what is it?)
Does the problem also disappear if you do this change:

input.1.joystick.0.friendlyname=HIDI2C Device

Change this line:




hexaae 19 August 2019 20:10

Changed just that line in old buggy cfg and, yes 2nd button works again in VirocopAGA...

Toni Wilen 19 August 2019 20:43

Does that device appear in winuaebootlog.txt and Input panel device drop down menu? Check also log, does it say "(NO MATCH)"?

This is the most important remaining bit.

hexaae 20 August 2019 01:20

Yes it's in the log and Input panel menu. It's the ASUS custom touchpad I guess.

No "(NO MATCH)" in Winuaeboot.log using buggy cfg where 2nd button doesn't work with VirocopAGA.

All times are GMT +2. The time now is 08:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.

Page generated in 0.06261 seconds with 11 queries