bsnes v0.037a released

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

bsnes v0.037a released

Post by byuu »

byuu.org wrote:2008-10-26 - bsnes v0.037 released

This release adds support for the SNES mouse, Super Scope and Justifier peripherals. It also simplifies cartridge loading and refines the user interface. Lastly, GZ and ZIP archives can now contain non-ANSI characters (Chinese, Japanese, Russian, ...) This support existed in the last release for all uncompressed files. Together, this means only JMA support on Windows lacks support for loading non-ANSI filenames. This is due to the library itself (really, it's more Windows' fault), and licensing issues prevent me from patching libjma as I did with zlib (bsnes is not GPL compatible.) I'm planning to work with Nach to fix this in a future release.

About the cartridge loading changes ... the emulator now determines what kind of cartridge is being loaded (eg normal, BS-X BIOS, Sufami Turbo cart, etc) by looking inside the file itself. If it detects a cart type that requires more than one ROM image to load, it will present you with the appropriate specialized load menu automatically. Aside from being more intuitive, this method also allows loading of BS-X and Sufami Turbo games from the command-line or via file association.

Changelog:
* added mouse support to DirectInput and SDL input drivers
* up to 96 buttons per controller; 8 buttons per mouse (5 per mouse on Linux) can be mapped now
* added SNES mouse support (does not support speed setting yet)
* added Super Scope support
* added Justifier support (supports both Justifiers)
* input management system almost completely rewritten to support new controllers
* "Load Special" menu removed, all cart loading merged to "Load Cartridge ..." option
* replaced "Power Cycle" and "Unload Cartridge" with "Power" -> "On" / "Off"
* when video exceeds screen size and is scaled down, aspect ratio is now maintained [Ver Greeneyes]
* zlib modified to support non-ANSI characters
* cheat code count was limited to 1,024 codes before; it now supports unlimited codes per game
* added sort by description setting for cheat code list
* polished listbox control interaction (disable buttons when nothing selected, etc)
* cleaned up OBC-1 chip emulation (code is functionally identical to v036)
* added option to toggle fullscreen mode to settings menu
* added advanced mode options to toggle base unit (none, Satellaview) and system region (Auto-detect, NTSC, PAL)
Last edited by byuu on Mon Oct 27, 2008 5:32 am, edited 1 time in total.
ShadowFX
Regular
Posts: 265
Joined: Thu Jul 29, 2004 8:55 am
Location: The Netherlands

Post by ShadowFX »

A very solid release :)
Any localization file available yet?

Edit: it seems I missed it on your homepage. Got it now.
[i]"Change is inevitable; progress is optional"[/i]
ZH/Franky

Post by ZH/Franky »

Great! Now I can play Shin Megami Tensei on a new version of bsnes :)
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

GOTTA PATCH ALL OVER AGAIN, but it's so worth itttt ty byuu <3
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Franky wrote:Great! Now I can play Shin Megami Tensei on a new version of bsnes :)
XD That's the feeling I always get too. Even if nothing relevant changed, it still feels nice and shiny!

Anyway, congrats on the release byuu, glad to see my code made it in, even if it wasn't the combined version ;) Now that you got the peripherals in, that should be a big relief! (does this give us any new games to test for core emulation bugs?)
gllt wrote:GOTTA PATCH ALL OVER AGAIN, but it's so worth itttt ty byuu <3
You could also rename the dll file to d3d9.dll instead of using the patcher, but I doubt you mind that much :D
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

Verdauga Greeneyes wrote:You could also rename the dll file to d3d9.dll instead of using the patcher, but I doubt you mind that much :D
Hurr actually I try to keep everything clean in my life now so it's something I do in the dark of the night to avoid offending anyone :V
ShadowFX
Regular
Posts: 265
Joined: Thu Jul 29, 2004 8:55 am
Location: The Netherlands

Post by ShadowFX »

Dutch translation for v0.037

Verdauga, maybe you could take a look at it as well. Some stuff in there was a bit difficult to translate accurately.
[i]"Change is inevitable; progress is optional"[/i]
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

I noticed something odd while playing with a filter: in point scaling mode, I set the scale to 4x, disabling aspect ratio correction, and I noticed that it is 3 pixels too big! That is, there are 3 rows and columns with a height/width of 5 pixels, and the bottom and rightmost 3 pixels are cut off. Tested on Windows with Direct3D, I'll see if I can test more cases later but I'd like to work on my filter a bit more. Can anyone confirm?

My filter, which scales to 4x manually, doesn't have this problem.
tukuyomi
Rookie
Posts: 39
Joined: Mon Aug 02, 2004 5:14 am
Contact:

Post by tukuyomi »

http://www.kuro-hitsuji.net/~tukuyomi/s ... french.zip
Here is the French locale for v0.037. Congrats byuu and all involved, as always :)
While testing my locale, I noticed something strange in the Cheat Code panel: Buttons labeled "Toggle Status" and "Delete Code" are not cllickable if you click twice (disable and reenable) on "Keep cheat code list sorted by description". It happens only with one cheatcode in the list. Screenshot ahead: http://www.kuro-hitsuji.net/~tukuyomi/s ... atcode.png
byuu

Post by byuu »

While testing my locale, I noticed something strange in the Cheat Code panel: Buttons labeled "Toggle Status" and "Delete Code" are not cllickable if you click twice (disable and re-enable) on "Keep cheat code list sorted by description". It happens only with one cheatcode in the list.
Yeah, I noticed that too. It's a Linux only issue. It doesn't lose its position 0 setting when resetting the list, ala Windows. It also happens with input when you switch controller subtypes. GTK+ also doesn't support clicking in blank sections of listboxes to unselect all options. The former I should be able to fix, the latter I can't. I'll probably just have to leave it as a platform difference.

Thanks for pointing this out -- I didn't realize it could get stuck with only one code, which is why I put it off for this release :/
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

german_locale_v037.rar

I'm open for corrections. :)
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
byuu

Post by byuu »

I've posted v037a. It fixes the Linux listbox box reported by tukuyomi, and adds a few missing strings to the template locale.cfg file.

No need to re-do the locales. I should be able to update them all on my side and get them posted here shortly.

EDIT: posted all v037a locales. Thank you all so much for making these!
I noticed something odd while playing with a filter: in point scaling mode, I set the scale to 4x, disabling aspect ratio correction, and I noticed that it is 3 pixels too big! That is, there are 3 rows and columns with a height/width of 5 pixels, and the bottom and rightmost 3 pixels are cut off. Tested on Windows with Direct3D, I'll see if I can test more cases later but I'd like to work on my filter a bit more. Can anyone confirm?
Probably a driver issue. Those are ridiculously common with Direct3D.

This is what I get with 4x, no ARC, point filtering:
http://img249.imageshack.us/img249/3505/11600203gv1.png
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

byuu wrote:This is what I get with 4x, no ARC, point filtering:
http://img249.imageshack.us/img249/3505/11600203gv1.png
This is real.
I can tell by the pixels.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

byuu wrote:This is what I get with 4x, no ARC, point filtering:
http://img249.imageshack.us/img249/3505/11600203gv1.png
Strange shifting issue in the upper right and lower left corners there. Okay, I thought it might be a driver issue; I'll see if I can use OpenGL instead for the sake of my sanity.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

I get quite a few warnings while compiling on Ubuntu 8.10, you might want to check it out. (g++ version 4.3.2)

[edit]And, strange, now bsnes won't work at all, locking up big time directly after loading a ROM...[/edit]
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Post by dfreer »

wertigon wrote:I get quite a few warnings while compiling on Ubuntu 8.10, you might want to check it out. (g++ version 4.3.2)

[edit]And, strange, now bsnes won't work at all, locking up big time directly after loading a ROM...[/edit]
Personally I think g++ 4.3.2 is fucked up on ubuntu intrepid, seeing as it won't compile ZSNES right. I was able to compile bsnes 0.037 and zsnes 1.51b using 4.3.2 on debian lenny with no problems, although I haven't compiled 0.037a yet.
Last edited by dfreer on Mon Oct 27, 2008 7:04 pm, edited 1 time in total.
[vEX]
New Member
Posts: 6
Joined: Sun Jun 03, 2007 2:01 pm
Location: Sweden

Post by [vEX] »

I noticed something funny now since I've changed hardware and still don't have any graphics acceleration (using X.org VESA driver). My config file tells bsnes to use "OpenGL", which makes bsnes crash because I don't have any GLX extention atm (running a half broken setup atm):

Code: Select all

$ bsnes
Xlib:  extension "GLX" missing on display ":0.0".
Segmentation fault
So I just edited ~/.bsnes/bsnes.cfg and set system.video = "" and started bsnes again. This is the screen I was greeted with:
Image

Just selecting something and closing the window will still save the values to the configuration file so it works. But it sure would be nice to see the buttons.

The funny thing is that I can reproduce it 100%.
1) Edit config and set system.video = "OpenGL".
2) Start bsnes and let it segfault.
3) Edit config and set system.video = "".
4) Start bsnes.
5) Repeat from step 1.

Steps 3&4 can be combined by setting video to OpenGL in the config screen that pops up.

byuu, if you want me to run any debugs or so, please send me a PM so I get a mail notice or it's likely that I'll forget about it (work keeps me busy).
[url=http://aur.archlinux.org/packages.php?ID=11576]Arch Linux bsnes package[/url]
byuu

Post by byuu »

I get quite a few warnings while compiling on Ubuntu 8.10, you might want to check it out. (g++ version 4.3.2)

[edit]And, strange, now bsnes won't work at all, locking up big time directly after loading a ROM...[/edit]
I'll take a look at them, sure. If it's more int<>double crap, I probably won't rush to "fix" them (as they're not bugs in the first place. I'm well aware that the decimal place information is lost.)

I don't know why the emulator locks up on you. Try a backtrace or something, perhaps?
So I just edited ~/.bsnes/bsnes.cfg and set system.video = "" and started bsnes again. This is the screen I was greeted with:
Yes, that's the crash handler. If the emulator crashes during startup, then it will revert your drivers to "None" the next time you start the emulator. The point is to allow recovery without having to find and edit the config file by hand. If you really want to edit the config by hand, you can change the "crash event handler" or whatever setting back to false and you won't get the handler on startup.

Ideally, we catch the crash before-hand; but some of these APIs say the last operation was a success, and the next one throws a BadMatch error and takes down your whole app, instead of returning a fail code.
But it sure would be nice to see the buttons.
To see what buttons? The video / audio / input drop-downs are visible in your screenshot.
Steps 3&4 can be combined by setting video to OpenGL in the config screen that pops up.
... that's what it's supposed to do :/
What were you wanting to have happen?
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

So mouse still not working? I can't get it to do anything. Mouse is set up.

EDIT: Never mind. I put it on super scope and now working. :roll:
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

Did some more checking - it appears it is the ALSA driver that is the culprit. Switching to OpenAL works, but produces a ~200ms lag. >_<
Last edited by wertigon on Mon Oct 27, 2008 8:07 pm, edited 1 time in total.
byuu

Post by byuu »

Mouse needs to be on port 1 for Mario Paint. You also have to click inside the window. There's no visible cursor drawn by the emulator -- the games are supposed to draw the mouse cursor themselves.
Did some more checking - it appears it is the ALSA driver that is the culprit. Switching to OpenAL works.
Weird ... if it happens to more people, I'll have to default to OpenAL again.
ZH/Franky

Post by ZH/Franky »

wertigon wrote:Did some more checking - it appears it is the ALSA driver that is the culprit. Switching to OpenAL works, but produces a ~200ms lag. >_<
If you want the best audio on the linux version of bsnes, then use OSS4 instead of ALSA, and set bsnes's audio driver to OSS.
Last edited by ZH/Franky on Tue Oct 28, 2008 11:15 am, edited 1 time in total.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

I would use OSS4 if it wasn't for the fact that many projects doesn't even consider OSS4 support, instead preferring to go with things like PulseAudio... Like swfdec. And most GBA emulators I've found. -_-
byuu

Post by byuu »

Hmm, rewriting the CPU / SMP register classes again.

Old:

Code: Select all

template<int mask>
struct CPUFlag {
  uint8 &data;

  inline operator bool() const { return data & mask; }
  inline CPUFlag& operator=(bool i) { data = (data & ~mask) | (-i & mask); return *this; }

  CPUFlag(uint8 &data_) : data(data_) {}
};

class CPURegFlags {

public:
  uint8 data;
  CPUFlag<0x80> n;
  CPUFlag<0x40> v;
  CPUFlag<0x20> m;
  CPUFlag<0x10> x;
  CPUFlag<0x08> d;
  CPUFlag<0x04> i;
  CPUFlag<0x02> z;
  CPUFlag<0x01> c;

  inline operator unsigned() const { return data; }
  inline unsigned operator  = (unsigned i) { data  = i; return data; }
  inline unsigned operator |= (unsigned i) { data |= i; return data; }
  inline unsigned operator ^= (unsigned i) { data ^= i; return data; }
  inline unsigned operator &= (unsigned i) { data &= i; return data; }

  CPURegFlags() : data(0), n(data), v(data), m(data), x(data), d(data), i(data), z(data), c(data) {}
};
New:

Code: Select all

class CPURegFlags {
public:
  bool n, v, m, x, d, i, z, c;

  inline operator unsigned() const {
    return (n << 7) + (v << 6) + (m << 5) + (x << 4)
         + (d << 3) + (i << 2) + (z << 1) + (c << 0);
  }

  inline unsigned operator=(unsigned data) {
    n = data & 0x80; v = data & 0x40; m = data & 0x20; x = data & 0x10;
    d = data & 0x08; i = data & 0x04; z = data & 0x02; c = data & 0x01;
    return data;
  }

  inline unsigned operator|=(unsigned data) { return operator=(operator unsigned() | data); }
  inline unsigned operator^=(unsigned data) { return operator=(operator unsigned() ^ data); }
  inline unsigned operator&=(unsigned data) { return operator=(operator unsigned() & data); }

  CPURegFlags() : n(0), v(0), m(0), x(0), d(0), i(0), z(0), c(0) {}
};
Faster access to individual flags, slower access to P as a whole. Seems to balance evenly, no speed gain or loss. But the code is simpler, and you can take individual flags as boolean, rather than CPUFlag<int>. And it avoids endianness entirely.

Now to merge this into the main CPU class, and drop all the CPURegBlaBla global stuff.
I would use OSS4 if it wasn't for the fact that many projects doesn't even consider OSS4 support, instead preferring to go with things like PulseAudio... Like swfdec. And most GBA emulators I've found. -_-
You up for writing bsnes Linux audio driver # 5? ;)
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

byuu wrote:
I would use OSS4 if it wasn't for the fact that many projects doesn't even consider OSS4 support, instead preferring to go with things like PulseAudio... Like swfdec. And most GBA emulators I've found. -_-
You up for writing bsnes Linux audio driver # 5? ;)
It would give me an excuse to learn PulseAudio, but... Not right now. Too busy with other things. :)

Anyhow, did an LTrace, and it's definitely ALSA. Here's the relevant info:

Code: Select all

strlen("Loaded TALES_OF_PHANTASIA.")                                                                            = 26
strcpy(0x1c04ff0, "Loaded TALES_OF_PHANTASIA.")                                                                 = 0x1c04ff0
time(NULL)                                                                                                      = 1225190533
strcmp("Loaded TALES_OF_PHANTASIA.", "Loaded TALES_OF_PHANTASIA.")                                              = 0
free(0x1c04ff0)                                                                                                 = <void>
XQueryKeymap(0x16a7890, 0x7fff91dd6030, 0x13d7e90, 0, 0x1c04ff0)                                                = 1
XQueryPointer(0x16a7890, 0x4400004, 0x7fff91dd6010, 0x7fff91dd6008, 0x7fff91dd602c)                             = 1
SDL_JoystickUpdate(1, 0, 0, 1033, 0x16a82e8)                                                                    = 0x16a01d0
gtk_window_get_type(0x856020, 0, 2, 1033, 0x16a82e8)                                                            = 0x13e5ec0
g_type_check_instance_cast(0x145bc50, 0x13e5ec0, 2, 1033, 0x16a82e8)                                            = 0x145bc50
gtk_window_is_active(0x145bc50, 0x13e5ec0, 0x13e5ec0, 918022, 0x16a82e8)                                        = 0
gtk_window_get_type(0x852c40, 0x13e5ec0, 0x13def90, 918022, 0x16a82e8)                                          = 0x13e5ec0
g_type_check_instance_cast(0x13ed020, 0x13e5ec0, 0x13def90, 918022, 0x16a82e8)                                  = 0x13ed020
gtk_window_is_active(0x13ed020, 0x13e5ec0, 0x13e5ec0, 918022, 0x16a82e8)                                        = 1
snd_pcm_writei(0x16a4a20, 0x16a76a0, 120, 0, 0
Why that is so, I do not know, but I suspect the ALSA driver not being compliant with PulseAudio, leading to the lockups. Digging around a bit, it seems like there's a "safe subset" of ALSA one *could* use, but digging around doesn't reveal anything of use.

PulseAudio in 8.10 isn't half bad btw, finally starting to understand why people find it to be a good thing - though it introduces massive lag in games. :(

[edit]Found it: http://0pointer.de/blog scroll down a bit[/edit]
Locked