bsnes v0.042 released

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
Locked
byuu

bsnes v0.042 released

Post by byuu »

byuu.org wrote:A new release quite a bit faster than I was expecting, but a lot has changed. Most importantly is a new Windows input driver, "RawInput". The downside is that this makes bsnes require at least Windows XP, as Windows 2000 and earlier lack RawInput support. The upside is that input from multiple keyboards and mice can be distinguished from each other — very useful for dual-Justifier support in Lethal Enforcers. Users of previous versions of bsnes will need to manually select the new driver via Settings->Configuration->Advanced->Input driver, and will need to re-map all assigned input keys, including the default user interface hotkeys. Or alternatively, delete the configuration file under %APPDATA%\.bsnes or ~/.bsnes.

Also new is an XInput driver, which avoids the DirectInput driver limitation of being unable to distinguish the two shoulder trigger buttons. This makes bsnes require DirectX 9.0c or later for the necessary drivers. Note that Windows Vista SP0 does not ship with these, so if you haven't installed it yet, you'll need to do so. This driver is part of the "RawInput" driver mentioned above.

This part is important: if you receive an error regarding xinput1_3.dll, you need to download and install the DirectX 9.0c run-time.

For those on Windows 2000, or without DirectX 9.0c, it is still possible to compile and run bsnes with the older DirectInput driver only; but I won't be providing a binary myself for this — at least not at this time.

More bad news for some: hiro, my Win32 / GTK+ API wrapper, has been discontinued and removed from the source tree for this release. Qt 4.5.0+ is now required for the user interface. Very sorry to the Linux distros that do not have packages for QT 4.5 yet. You'll need to continue with v041 for now.

Changelog:
* Fixed a bug that was preventing BS-X carts from loading and mapping properly
* Fixed a bug with mapping joypads after the first
* Improved window centering code to reduce flickering, still a bit volatile on Linux due to Qt/X11 limitations
* Minor cleanup work on S-PPU BG renderer
* Improved mouse axis / button mapping
* Added proper support for analog joypad inputs: both sticks and triggers are now fully supported
* Windows: added RawInput support, allows up to 16 keyboards + mice to be mapped independently
* Windows: added XInput support, allows Xbox 360 controller triggers to operate independently
* Windows and Linux: Screen saver and monitor power saving disable re-added

Many thanks to tukuyomi for generously offering to host this download!
tukuyomi, if bandwidth gets to be too much (I averaged 650MB/day), feel free to delete the files. No need to check with me first or anything like that.

Everyone else, please do thank him for me :)
At the current bandwidth usage rate, I wouldn't have been able to post this new release.
Fras
Hazed
Posts: 54
Joined: Tue Jan 16, 2007 5:32 pm

Post by Fras »

Is it possible to somehow, um... disable the menu in fullscreen mode? The alt button is pretty much unusable as it is now. And no, hiding the menu isn't helping.
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

bsnes works for me now. I'll test input stuff later.
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

bsnes v0.042 without upx compress released

Page is also updated.

I found no issues at my end.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
Kiddo
Rookie
Posts: 18
Joined: Thu Dec 11, 2008 7:13 am
Location: ON AIR
Contact:

Post by Kiddo »

After getting the XINPUT1_3.dll and doing some key reassinging, the Satellaview/8M Memory Pack ROM Loading seems to work like it used to again. I loaded up Same Game with the Tengai Makyo Data, as well as Konae-Chan no DokiDoki Pengin Kazoku with the BIOs to check it. :D
byuu

Post by byuu »

Oh, speaking of which. Used --best so that it starts up faster per sinamas.
Is it possible to somehow, um... disable the menu in fullscreen mode? The alt button is pretty much unusable as it is now. And no, hiding the menu isn't helping.
Well that's annoying. Wonder if it's a Qt or a Windows thing to activate hidden menus on alt press. If the former, I might be able to capture the key press / menu enter event and block it when it's hidden.
After getting the XINPUT1_3.dll and doing some key reassinging
Are you able to use the RawInput driver just by stubbing in the xinput1_3.dll file alone? If so, I'll just upload that rather than the ~80MB DX9 run-time :D
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

just upload the Direct x online updater o_o, it is only a few hundred kilobytes.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Do directx runtime updates get included with service packs? I didn't have to download anything with Vista, but on my XP SP3 work computer, I did.
Last edited by FitzRoy on Mon Mar 30, 2009 5:06 pm, edited 1 time in total.
I.S.T.
Zealot
Posts: 1325
Joined: Tue Nov 27, 2007 7:03 am

Post by I.S.T. »

They don't, sadly.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

I.S.T. wrote:They don't, sadly.
What is their reason for that? If games or programs need to use them, why would they want to make people hunt down a package?
byuu

Post by byuu »

Hm, I forgot to mention the multi-assign option added in the changelog.
I didn't have to download anything with Vista, but on my XP SP3 work computer, I did.
Vista SP0 needed it here, as did XP MCE 2005 edition.

Still, I think it's worth it for proper Xbox 360 controller support. Requiring DX is no different from any modern PC game.

And if it's a problem to anyone, I can make a bsnes_v042_lite.exe that has the old DirectInput driver only and runs on Win2k. Like hell if I'm profiling it though :P

(EDIT: moving window centering down below.)
Last edited by byuu on Mon Mar 30, 2009 5:27 pm, edited 3 times in total.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Vista SP0 needed it here, as did XP MCE 2005 edition.
Okay, so they are at least included in Vista service packs. Maybe it's a space thing, or maybe XP SP3 is older than I think.
I.S.T.
Zealot
Posts: 1325
Joined: Tue Nov 27, 2007 7:03 am

Post by I.S.T. »

FitzRoy wrote:
I.S.T. wrote:They don't, sadly.
What is their reason for that? If games or programs need to use them, why would they want to make people hunt down a package?
Good ol' stupidity. Infects everything even remotely big in scope.

XP SP3 came out after Vista SP1, BTW.
byuu

Post by byuu »

And if anyone can improve this, please do :D

Code: Select all

//show specified window in the center of the screen.
//"... because QWidget::showCentered() would be too easy."
void Utility::showCentered(QWidget *window) {
  QRect deskRect = QApplication::desktop()->availableGeometry(window);

  //place window offscreen, so that it can be shown to get proper frameSize()
  //only works on Windows, but only needed there
  //moving while minimized will put window at 0,0; so avoid that
  if(window->isMinimized() == false) {
    window->move(
      std::numeric_limits<signed>::max(),
      std::numeric_limits<signed>::max()
    );
  }
  window->showNormal();  //instead of show() in case it is minimized ...

  //force-resize window to be as small as minimumSize() will allow, and then center it
  //this is because if any controls were added / removed,
  //window size will remain the same as last show call otherwise
  window->resize(0, 0);
  window->move(
    deskRect.center().x() - (window->frameSize().width()  / 2),
    deskRect.center().y() - (window->frameSize().height() / 2)
  );

  #ifndef _WIN32
  //Xlib frame size (excluding inside) is QSize(0, 0) at first, wait for it to be valid
  for(unsigned counter = 0; counter < 4096; counter++) {
    if(window->frameSize() != window->size()) {
      //fix window centering, will cause slight flicker, but no choice ...
      window->move(
        deskRect.center().x() - (window->frameSize().width()  / 2),
        deskRect.center().y() - (window->frameSize().height() / 2)
      );
      break;
    }
    application.processEvents();
  }
  #endif

  //ensure window has focus
  //without processing events, Xlib sometimes throws XBadWindow errors
  //it still does with this, but very seldom
  application.processEvents();
  window->activateWindow();
  window->raise();
}
That's with about 4+ hours put into testing. Qt just absolutely hates centering windows.

I'm convinced QWidget::updateGeometry() does absolutely nothing.

Believe it or not, the counter reaches up to ~400 or so on my Xfce install. Adding usleep(n) where n is between 200 and 20000 doesn't lower the number much, and makes it take even longer.

If you're wondering why I don't subclass QWidget, it's because I use this function on a QMainWindow as well.

---

Code: Select all

    if(config.video.isFullscreen == false) {
      //get effective desktop work area region (ignore Windows taskbar, OS X doc, etc.)
      QRect deskRect = QApplication::desktop()->availableGeometry(winMain->window);

      if(winMain->window->isVisible() == false) {
        winMain->window->move(std::numeric_limits<signed>::max(), std::numeric_limits<signed>::max());
        winMain->window->showNormal();
        application.processEvents();
      }
That gets rid of the infinitesimal resize flash on Windows the first time you start the binary.
Killa B
♥ Love Freak FlonneZilla ♥
Posts: 111
Joined: Sun Apr 01, 2007 12:59 am
Location: USA
Contact:

Post by Killa B »

byuu wrote:And if anyone can improve this, please do :D
Most of that is over my head (I'm terrible with graphical stuff), but I think you can change

Code: Select all

      window->move( 
        deskRect.center().x() - (window->frameSize().width()  / 2), 
        deskRect.center().y() - (window->frameSize().height() / 2) 
      ); 
to

Code: Select all

window->move(deskRect.center() - window->rect().center());
This information comes from here.

I'm afraid I don't know how to test it, though. :oops:
byuu

Post by byuu »

QWidget::rect() does not take frame geometry into account, so it would throw off vertical centering where the top and bottom frame borders are different heights. frameGeometry() itself includes x/y displacement information, so you'd have to use:
deskRect.center().x() - (window->frameGeometry().right() - window->frameGeometry().left() + 1), which really isn't any more terse.

I would be okay with completely ignoring frame geometry and being off-center by just a tad, but scale max in windowed mode (uses all available screen space so it has to touch the top and bottom work areas) has to be perfect or it looks terrible.
Killa B
♥ Love Freak FlonneZilla ♥
Posts: 111
Joined: Sun Apr 01, 2007 12:59 am
Location: USA
Contact:

Post by Killa B »

byuu wrote:deskRect.center().x() - (window->frameGeometry().right() - window->frameGeometry().left() + 1)
Dear God that is terrible. I guess you should just leave those lines alone, then. :shock:
tetsuo55
Regular
Posts: 307
Joined: Sat Mar 04, 2006 3:17 pm

Post by tetsuo55 »

FitzRoy wrote:
I.S.T. wrote:They don't, sadly.
What is their reason for that? If games or programs need to use them, why would they want to make people hunt down a package?
The extra/new dll's included with each update of directx are considered "runtime dll's"
These files are not added to the windows base and are distributed as needed only by the software maker that decides to use them.

Windows by default, also does not include the visual C redist dll's

Personally i agree with you that MS should include these updates on windows update and in servicepacks
byuu

Post by byuu »

Right now, if you plug in a HID device like the Xbox 360 controller, Win 7 automatically connects to Windows Update and downloads the necessary drivers. Instant support with no hassle.

If Microsoft wanted to truly innovate, they should detect linker errors, search Windows Update for the required DLLs, install them and then restart the application transparently. This would eliminate all xaudio_*, xinput_* and d3dx_* problems both developers and end-users contend with.
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

I'm unable to hide the menu in fullscreen, nor is f11 working for switching back and forth between modes. It seems like a bunch of stuff we all got used to using is now not working. What happened?

Edit: It seems to come from the cfg file as the new version retroactively affects previous versions of bsnes. I found escape and f11 were both deactivated for version 41 after using version 42. I had to delete the cfg to re-enable functions to version 41.

Edit 2: On a hunch, I deleted the cfg again and re-ran version 42. It now works. Byuu, I think you should turn bsnes into an installing exe that erases the previous cfg from older versions. This is what is causing problems.
NES NTSC palette file:

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

Post by byuu »

I mentioned this in the first paragraph of my release notes :P
Users of previous versions of bsnes will need to manually select the new driver via Settings->Configuration->Advanced->Input driver, and will need to re-map all assigned input keys, including the default user interface hotkeys. Or alternatively, delete the configuration file under %APPDATA%\.bsnes or ~/.bsnes.
It was needed to support multiple keyboards and mice. Didn't feel like adding a version check thing to the config file just yet, so I default the old key mapping names to "none". Maybe next time.
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

Ha, you know hardly anyone actually reads notes :P

Well at least I wasn't the only one that had problems. :oops:
NES NTSC palette file:

http://www.firebrandx.com/downloads/fbx2pal.zip
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Post by belegdol »

byuu, could you consider linking to RPM Fusion as a place where folks can get pre-compiled packages for Fedora?
byuu

Post by byuu »

Per: http://board.zsnes.com/phpBB2/viewtopic ... 403#191403
Seems we overlooked a minor path problem. Only affects UPS patches on the first load with no manual UPS path defined. So we shouldn't need a v042a release for this.
byuu, could you consider linking to RPM Fusion as a place where folks can get pre-compiled packages for Fedora?
Certainly, but how would they go about finding it from the homepage? :P
http://rpmfusion.org/RPM%20Fusion?actio ... rch=Titles
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Post by belegdol »

You are not supposed to look for specific package, you are supposed to add the repository to your configs and install the package with your package manager of choice ;)
Locked