View unanswered posts | View active topics It is currently Sat Dec 07, 2019 5:14 pm



This topic is locked, you cannot edit posts or make further replies.  [ 180 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
bsnes v0.041 released 
Author Message
Regular

Joined: Sat Mar 04, 2006 3:17 pm
Posts: 307
Post 
byuu wrote:
2b. Mice [up to 16]: up to three axes (Z, aka scroll wheel, is pretty useless though for the SNES), and up to 8 buttons (though the core APIs for both RawInput and Xlib only provide the first five button states.)


So you can only really use 5 of the 8?
If so one cannot map all snes controller buttons to the mouse :(

Mapping up, down, left, right to the mouse sensor would be annoying anyway i think(never really tried it.)


Thu Mar 26, 2009 3:43 pm
Profile
Post 
Yeah, mouse mode only works on some games, like Super Mario All-Stars: SMB1.

Assign left to left-click, right to right-click, jump to up-arrow, shoot fireball to down-arrow, and start to middle-click. I made it to 8-1 like that :)


Thu Mar 26, 2009 3:59 pm
Regular
User avatar

Joined: Tue Mar 07, 2006 10:32 am
Posts: 347
Location: The Netherlands
Post 
Does horizontal scroll stuff count as two buttons?


Thu Mar 26, 2009 4:05 pm
Profile
Post 
Source fixes for WinXP users:

Forgot to fix the window flashing ...

window.cpp:13:
Code:
  window->move(std::numeric_limits<signed>::max(), std::numeric_limits<signed>::max()); // :D


Seems to be quickly mapping print screen. It was giving me 0x2a and 0x37 messages. Apparently on XP 0x2a is also sent by the arrow keys, so I picked the wrong code to look for.

rawinput.cpp:57:
Code:
      map(0x0037, 2, keyboard<>::print_screen)


-mconsole was throwing a bunch of errors. Need:

ui_qt/Makefile:33:
Code:
  link += $(call mklib,gdi32)


I don't understand why lib file inclusion has to be in a certain order, but whatever.

Random musings:

Pause key returns 0x1d:4, 0x45:0. Num lock gives just 0x45:0. So detecting num lock by itself isn't worth the trouble. EDIT: meh. Cheap fix. Won't detect both held down at the same time, but who really uses num lock and pause as action buttons, anyway?
Code:
      map(0x001d, 4, keyboard<>::pause)
      map(0x0045, 0, keyboard<>::num_lock)
      if(state[keyboard<>::pause]) state[keyboard<>::num_lock] = false;


Spacebar is tough to map because it triggers the mouse context menu. Hmm ...

Seems to be acting weird on the last item when mapping F10 then F11/F12 in a group ... wtf? EDIT: oh yeah, F10 is an alternate to trigger the context menu, heh.

Quote:
Does horizontal scroll stuff count as two buttons?


Depends on the mouse driver, I guess. If it maps them to buttons four and five, you're good. If it maps them to six and seven, then you can't use them.

Xorg / Linux maps buttons 4 and 5 to the scroll wheel up and down, instead of using a separate Z-delta. So horizontal scroll and side buttons won't work at all there.

You can actually catch more, but you have to have a native X11 window to catch events from, which I can't have due to ruby encapsulation from the UI.


Thu Mar 26, 2009 4:57 pm
Lurker

Joined: Tue Apr 10, 2007 4:30 pm
Posts: 152
Location: Sweden
Post 
byuu wrote:

I don't understand why lib file inclusion has to be in a certain order, but whatever.


I do, it is because the symbols in the lib files are only imported if they are on the list, and they are only on the list if another file has requested them.
Importing a lib before it's symbols are on the list results in those symbols not being imported. This obviously doesn't work when the symbols are needed by a later file.


Thu Mar 26, 2009 7:56 pm
Profile WWW
Post 
Well, had to go to Microcenter because my roommate's monitor was screwing up. I noticed they had a wired Xbox 360 controller for $40. So ... fuck it. Picked it up so I could write an Xinput driver. Luckily it works on Win7 64-bit. Some people were saying it didn't work in 64-bit Windows.

Found a bug in the current WIP thanks to that, too. The joypadNumber() test is still using joypad<>::limit instead of joypad<>::length for range testing.

So the only problem with the joypad now is that LT and RT map as a single Z-axis, exactly as I expected. Meaning you can use one or the other, but not both at the same time. They're so much more natural than LB and RB for SNES L+R, and it'll help ruby out by having more flexibility, so whatever. Expect Xinput support soon enough.

Just need to find a less 'taken' name than ruby, get some OS X drivers written, make the video system a bit more flexible, and ruby could probably catch on as a truly viable SDL alternative. If not for the sole reason that the drivers are so much simpler to write: if you need something it lacks, it's feasible to add it.

I wonder how SDL went about its' marketing to get where it is today ...


Fri Mar 27, 2009 9:34 pm
Regular

Joined: Sat Mar 04, 2006 3:17 pm
Posts: 307
Post 
byuu wrote:
I noticed they had a wired Xbox 360 controller for $40. So ... fuck it. Picked it up so I could write an Xinput driver.


byuu wrote:
Expect Xinput support soon enough.


So now you can bring it back and get a refund :P


Fri Mar 27, 2009 9:51 pm
Profile
Post 
Hahah, yeah. But seriously, I return so much crap to Microcenter (most recently those two hard drives, and the first E8400 before due to overheating) that they'll probably ban me if I try it again.


Fri Mar 27, 2009 10:09 pm
Lurker

Joined: Mon Mar 10, 2008 11:36 pm
Posts: 199
Post 
LOL

_________________
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT


Sat Mar 28, 2009 1:23 am
Profile
Trooper
User avatar

Joined: Tue Apr 19, 2005 11:08 pm
Posts: 376
Location: DFW area, TX USA
Post 
Dullaron wrote:
LOL


Seriously, that's it? LOL?


DEEP!!!

(just messin with ya :lol: )

_________________
NES NTSC palette file:

http://www.firebrandx.com/downloads/fbx2pal.zip


Sat Mar 28, 2009 1:58 am
Profile WWW
Official tech support dood

Joined: Wed Jan 25, 2006 7:57 am
Posts: 2092
Post 
byuu wrote:
E8400

mine just arrived via ups yesterday... can't wait to finish that build ;)
[/off-topic]

_________________
Why yes, my shift key *IS* broken.


Sat Mar 28, 2009 2:25 am
Profile
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Okay, so for the latest WIP (first WIP I've used since official), my digital pad refuses to be recognized. When I turn the analog mode on to activate the thumbsticks, all d-pad directions get recognized as a hat. If I then turn it off again, it will recognize certain directions of the d-pad as a "lo" "axis" and ignore others. Very strange behavior here, I should be able to use this thing in digital mode and can't. It always worked before.

Dual Shock 2, Vista 64


Sat Mar 28, 2009 3:10 am
Profile
Post 
New WIP.

Rewrote a large portion of the RawInput driver, cleaning it up substantially. Each API is now its own separate class, and pInputRaw (the ruby private implementation class) pulls data from each separate driver.

For keyboards, I've added the fixes for print screen and pause/num_lock.

For joypads, I added XInput controller detection through RawInput's RIDI_DEVICENAME, instead of that crazy ass COM + wbem shit from MSDN. I also added a proper XInput driver, so now the left and right axes can be mapped independently, and you can use both at the same time. All in all, quite expensive and a lot of work, but it's the little bits of polish that really make an application shine.

Do note that MinGW still doesn't ship with libxinput.a -- it's only been out for four years now, after all. You'll need to take XInput.lib from the DX9 SDK x86\lib folder, copy it to MinGW\lib, and rename it to libxinput.a. I'm surprised that works, but it does. I tried to use LoadLibrary("xinput1_3.dll") + GetProcAddress("XInputGetState"), but the app kept crashing in bsnes when optimizations were enabled. gdb showed it to crash in msvcrt!memcpy() from inside dinput8.dll. No idea what the hell was going on there.

Non-XInput controllers will fall back on using DirectInput, of course.

Fixed the joypad indexing, so multiple joypads should work again. Got the window centering hopefully right on WinXP so that windows opening for the first time won't 'flicker' anymore. Added the mklib(gdi32) entry, so you can compile with -mconsole again.

Re-did the mouse capture stuff. 'Assign Mouse Button' + 'Assign Mouse Axis' are now buttons instead of menu buttons.

For button assignment, you are given a window with a large disabled button named '(capture box)'. The instructions say to put whatever mouse you want over this button and click the mouse button that you want to assign. It'll assign upon release. Right now, assignment won't work for 1-2 seconds to prevent instant assignment when you click. I'll make a button mask in the future to avoid that delay. Also, it only verifies you clicked a mouse button while the capture window was active. I'll need to look into Qt's methods for mapping cursor clicks to control regions onscreen. Good news is it's now much easier to assign extended buttons like up+down ... you don't have to know what button #s they are anymore.

For axis assignment, mapping based on mouse motion is too dangerous. So you get a window with two buttons: 'X-axis' and 'Y-axis'. I can add Z-axis if anyone wants (for the scroll wheel), but it seems kind of useless. The instructions say to click the axis button you want, with the mouse you want the axis assigned to.

Now I know the instructions will probably just confuse people with only one mouse (~99% of users), so if everyone really thinks it'd be better to leave multi-mouse users in the dark about how the capture system works, I can take out the verbose notes.

Hoping your controller will work now, FitzRoy. Otherwise I have no idea what's wrong. Be sure you manually set the driver to RawInput, too. Will most likely require a config file with "version = 42", otherwise reset to defaults, for the next release.


Sun Mar 29, 2009 7:48 am
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
I can confirm that all axes, hats and buttons work with my joypad now. Thanks byuu!


Sun Mar 29, 2009 11:34 am
Profile
Lurker

Joined: Mon Mar 10, 2008 11:36 pm
Posts: 199
Post 
check this out. http://www.toymaker.info/Games/html/xinput.html

will XInput.lib from this website work? http://dev.dalmuri.net/trac/chadr/brows ... ib?rev=347

_________________
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT


Sun Mar 29, 2009 11:54 am
Profile
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Still won't recognize my d-pad as anything unless I activate analog mode. Buttons work fine.

In .041, they get recognized as this in both digital and analog mode:

"joypad00.up"
"joypad00.down"
"joypad00.left"
"joypad00.right"

In .041, dedicated axes wouldn't get recognized at all. All analog mode would do is cause the left thumbstick to mirror the above d-pad assignments.

I've got a super smartjoy around here somewhere, that's a completely digital controller. If that breaks, you're in big trouble.

EDIT: confirmed, all digital only joypads cannot map to the directional pad in Vista 64.


Sun Mar 29, 2009 3:50 pm
Profile
Post 
FitzRoy wrote:
EDIT: confirmed, all digital only joypads cannot map to the directional pad in Vista 64.


With the exception of my three, which all work perfectly.

Does it work if you set the driver to DirectInput? You'll have to send me your controllers or something, because I don't have any idea why it wouldn't work.


Sun Mar 29, 2009 5:37 pm
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
byuu wrote:
Does it work if you set the driver to DirectInput?


No, I've tried that and deleting the config numerous times.

I'm also not using manufacturer drivers for either. They are automatically recognized and work fine in the control panel.


Sun Mar 29, 2009 5:50 pm
Profile
Post 
So then it's unlikely to be bugs in the input drivers, but tripping of some issue in the UI mapping code.

I'll post a WIP with console mode enabled in the evening, see if we can determine what test is failing.

EDIT: in your control panel, are the unresponsive inputs acting as POV hats or as 'axes' that just go from extremes, eg starts centered, pressing any direction pushes them all the way to the edges?

To prevent the calibration from popping up right off the bat, I was using:

Code:
        if(state < -24576 || state > +24576) return;  //ensure axis is not at its lowest or highest value
        if(state >  -8192 && state <  +8192) return;  //ensure axis is not near its center


Which would stop digital inputs mapped over analog inputs from triggering the calibration window.

Also, seems stock Vista ships with DX10, but not the most recent DX9c files. Users will need xinput1_3.dll to run the new builds. As I said before, GetProcAddress is screwing up somehow between MinGW optimizations and my code. But since it's only ~26kb, I'll probably just host it directly, plus put a direct link to the DX9 redist package. Sucks, but pretty much any modern game would require 9.0c anyway.


Sun Mar 29, 2009 5:58 pm
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
byuu wrote:
as 'axes' that just go from extremes, eg starts centered, pressing any direction pushes them all the way to the edges?


This one. The only thing that uses the POV hat area is my dual shock 2 d-pad in analog mode. Digital d-pad always uses the x/y axis box with 8 extremities.

Btw, are you on SP1 like me?


Sun Mar 29, 2009 7:43 pm
Profile
Post 
Okay then, if everyone possible could test this quickly, I can post a new release tonight. Especially the input mapping, and especially there for gamepads / controllers.

Code:
http://byuu.org/files/bsnes_test.zip


No source, Windows only binary.

If you get an error about xinput1_3.dll, install the DirectX 9.0c redistributable.

Changes from last WIP:

- I was able to reproduce FitzRoy's issue, and fix it. Really, really crappy gamepads that send large phantom movements when the user isn't even touching the axes may trigger the calibration window early; not much I can do about that. None of my controllers do this at least.

- I updated the mouse button capture window. It now uses a framed label (kind of like a groupbox but with text in the center), and you have to release a mouse button inside the box for it to map.

- Screensaver / monitor power saving disabled on both Windows and Linux.

- More improvements to window centering.

Quote:
Btw, are you on SP1 like me?


No, I'm using Windows 7 beta 1.


Sun Mar 29, 2009 10:04 pm
Zealot

Joined: Tue Nov 27, 2007 7:03 am
Posts: 1325
Post 
Everything works properly here.


Sun Mar 29, 2009 10:40 pm
Profile
Justice is Blind

Joined: Wed Jul 28, 2004 3:33 pm
Posts: 620
Location: Test
Post 
Is W7 that much better than Vista?


Sun Mar 29, 2009 10:41 pm
Profile ICQ YIM WWW
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Quote:
I was able to reproduce FitzRoy's issue, and fix it.


Yep, you got it.

Two things:

-A reminder about the "last folder ..." "same folder ..." change to the paths section.
-Are you capable of putting in any text you want per selection in the title bar of the configuration window? You could integrate the subtitles into that, and the current section would be known from a minimized state.


Sun Mar 29, 2009 10:42 pm
Profile
Post 
Quote:
Is W7 that much better than Vista?


Yes, definitely.

Win+left/right/up/down; Win+1-8; the new taskbar dock thing; refinements to Explorer (still not as nice as good old Win XP's); eats less memory and runs faster; etc.

Still like Xfce more, myself.

Quote:
-A reminder about the "last folder ..." "same folder ..." change to the paths section.


Could you elaborate on that?

Quote:
-Are you capable of putting in any text you want per selection in the title bar of the configuration window?


Yeah, but then you can already tell what you're on from the left-hand listbox. It was really only there to give a stylish element ala SNESGT and friends. bsnes has always been really plain, so I like having some sort of aesthetic besides just plain minimalist controls.


Sun Mar 29, 2009 10:54 pm
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 180 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.