Mouse wheel support

Issue #2 resolved
RayeR created an issue

Hi, I just tested mouse wheel in Hexen II HoT and it works, I can bind weapon change to MWHEELUP/MWHEELDOWN so it could be ported from this engine

Comments (20)

  1. RayeR reporter

    Sure :) I recompiled today source and got error in snddma_dos.c missing size structure member but I see that it was updated again so now compiled OK. Is there HDA code to test?

  2. RayeR reporter

    Yeah, I got recognized my SB Audigy2 now: http://rayer.g6.cz/1tmp/quake2snd.png unfortunatelly the sound is choppy - like something wrong with DMA buffer not properly filled and when I start a new game it crash: eax=00000000 ebx=001b75cc ecx=b9786000 edx=00000055 esi=00000001 edi=0 20:43:50 ebp=00000000 esp=00b976dc program=I:\QUAKE2\QUAKE2D.EXE
    cs: sel=00a7 base=00400000 limit=0a84ffff
    ds: sel=00af base=00400000 limit=ffffffff
    es: sel=00af base=00400000 limit=ffffffff
    fs: sel=008f base=0000ecf0 limit=0000ffff
    gs: sel=00cf base=00000000 limit=0010ffff
    ss: sel=00af base=00400000 limit=ffffffff
    App stack: [00b97730..00b17734] Exceptn stack: [00b16940..00b14a00]
    Call frame traceback EIPs:
    0x00b98763
    But you are on a good way :)

  3. Frank Sapone

    look closely in your screenshot, the audio drive is setting 96khz but s_khz is 44khz. Could be part of your issue. The code is very basic at this point I'm unsure if it's even checking s_khz properly for the mpxplayer driver.

    Also, crash dumps like that are pretty useless to me.

  4. Frank Sapone

    Also, mouse wheel should work. Are you unable to bind MWHEELUP/MWHEELDOWN? I think the code allows it now. I don't have anything with a mouse wheel (I'm a trackball man) so I can't test it.

  5. RayeR reporter

    No, binding doesn't work (master, yesterday) while in Hexen II DOS does. The SBA sound driver seems to be removed/disabled from current master...

  6. Frank Sapone

    Also the binding should work. I just tested in DOSBox typing in "bind mwheelup +hook" and it accepted the command.

  7. RayeR reporter

    It cannot be selected via options|customize controls so I directly wrote it in config.cfg. Also bind command passed in console. Then the binding appeared in options|customize controls but doesn't react on wheel roll.

  8. Frank Sapone

    A couple of things, there is this line of code in DOS\IN_DOS.C:

     if (regs.x.ax == 0x574D && regs.h.cl == 1)
     {
         mouse_wheel = true;
         Com_Printf("mouse wheel support available\n");
     }
    

    Do you see mouse wheel support available at startup?

    If so, refer to this in DOS\IN_DOS.C:

         if (mouse_wheel) // FS: From HoT
         {
             if (mouse_wheelcounter < 0)
             {
                 Key_Event (K_MWHEELUP, true, sys_msg_time);
                 Key_Event (K_MWHEELUP, false, sys_msg_time);
             }
             else if (mouse_wheelcounter > 0)
             {
                 Key_Event (K_MWHEELDOWN, true, sys_msg_time);
                 Key_Event (K_MWHEELDOWN, false, sys_msg_time);
             }
         }
    

    You can try adding Com_Printf's to verify that it's even reading your keys i.e.

         if (mouse_wheel) // FS: From HoT
         {
                 Com_Printf("\n\nCHECK MWHEEL EVENTS!!\n\n");
    
             if (mouse_wheelcounter < 0)
             {
                 Com_Printf("\n\nMWHEEL UP EVENT!!\n\n");
                 Key_Event (K_MWHEELUP, true, sys_msg_time);
                 Key_Event (K_MWHEELUP, false, sys_msg_time);
             }
             else if (mouse_wheelcounter > 0)
             {
                 Com_Printf("\n\nMWHEEL DOWN EVENT!!\n\n");
                 Key_Event (K_MWHEELDOWN, true, sys_msg_time);
                 Key_Event (K_MWHEELDOWN, false, sys_msg_time);
             }
         }
    

    If it still doesn't work I don't know what it is because I have the same code from HoT, unless theres some other specific stuff happening in keys.c or other places specifically for DOS but I would doubt that.

    Frank

  9. Frank Sapone

    lol!

     if (!COM_CheckParm ("-mwheel")) // FS: From HoT
         return;
    

    Are you sure mouse wheel works in HoT? Because it appears he requires

  10. RayeR reporter

    No, it just prints that 3-button mouse available. Oh, wat? Do I need extra cmdline option? But I swear that I don't use any extra param for Hexen and it works there (also binding via controls menu).

  11. RayeR reporter

    Yeah, it works now, better documentation needed :) But with some quirk. I have binded mid button to jump and right buton to move forward. Then if I bind weapon next to mouse wheel down and press mid or right button it changes weapon together with jumping or moving forward. If I bind weapon next to mouse wheel up then it works without this side effect and change weapon only on wheel roll. I checked cfg but don't see any conflicts.

  12. Frank Sapone

    I used an old version of your code (from 2011) that required -mwheel. I just assumed it was on purpose because mousewheel isn't entirely standard across DOS apparently.

    Frank

  13. sezero

    Well yeah, I initially required -mwheel swith to enable it, but then I got usual user reports like 'hey it's not working' while they didn't read the readme. Then I enabled it by default and provided -nowheel to disable it.

    What should we do?

  14. Log in to comment