bsnes v0.037a released

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
Locked
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

I have just read the bsnes license. Some doubts:
license to reproduce the software for non-commercial use only, provided the software remains unmodified,
With this, can a distro package bsnes?
And,
the licensor grants you a non-transferable ... copyright license
so I can give a copy to a friend, but my friend can't give a new copy to another friend?

I ask so because bsnes is being packaged in the openSUSE Build Service, and if it isn't "reredistributable" probably can't be there (own service rules).
wertigon wrote: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.
Easily. One thing I noted some time ago:
Do not use snd_pcm_avail_update() for synchronization purposes. It should be used exclusively to query the amount of bytes that may be written/read right now. Do not use snd_pcm_delay() to query the fill level of your playback buffer. It should be used exclusively for synchronisation purposes. Make sure you fully understand the difference, and note that the two functions return values that are not necessarily directly connected!
and
For checking buffer playback/capture fill level use snd_pcm_update_avail().
But bsnes uses

Code: Select all

      snd_pcm_avail_update(device.handle);
      snd_pcm_sframes_t delay;
      snd_pcm_delay(device.handle, &delay);
First, I'm not sure about what "synchronization purposes" exactly means, so I don't know if bsnes is supposed to use one or the another.
And second... was me who said to add snd_pcm_avail_update() before snd_pcm_delay()... because snd_pcm_delay() wasn't working on my HDA-Intel CODEC without it (worked with my SB Live!). Probably a bug in ALSA, not sure if fixed.
My distro still don't uses PulseAudio, so I have not tested bsnes with it.
wertigon wrote: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. :(
It is supposed to allow any latency you need. It uses a big sound buffer but it can rewrite any part of it -> http://0pointer.de/blog/projects/pulse-glitch-free.html
But I'm not sure if you can specify your needed latency when using the ALSA API...
byuu

Post by byuu »

With this, can a distro package bsnes?
I've no problems with this, so long as I'm consulted before any source code is changed. If you're patching something broken, I'd like to know so I can fix it, too.
so I can give a copy to a friend, but my friend can't give a new copy to another friend?
The license grant is between me and you. It allows you to distribute it under those terms, so you can send it to others, but they have to accept the license (anyone can do so) if they want to distribute the software from there.
I ask so because bsnes is being packaged in the openSUSE Build Service, and if it isn't "reredistributable" probably can't be there (own service rules).
I know, my license is a major pain for distros.
Not sure why they don't just package it like they do for Adobe Flash, w32codecs, etc etc. Probably just not popular enough for the hassle.

I keep considering making a license like LGPL sans backdoor->GPL clause, and then I come across people like Takka:
http://psp3d.com/homepage-news/15177-ex ... p-kai.html

Meh.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

So a PulseAudio backend is needed as well in order to make bsnes run properly in Ubuntu... Image
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

byuu wrote:The license grant is between me and you. It allows you to distribute it under those terms, so you can send it to others, but they have to accept the license (anyone can do so) if they want to distribute the software from there.
I suppose this is good enough. I have enough problems trying to understand plain english to try to understand lawyers. :-p
If someone sees a problem he will report it. Meanwhile I will submit the update to 0.037a.
Nekokabu
New Member
Posts: 5
Joined: Wed Jul 23, 2008 3:52 am
Location: Japan

Post by Nekokabu »

http://nekokabu.s7.xrea.com/locale.zip
Japanese Localization file is here:)
英語苦手だっつーの!
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

So, for these next few wips, can we revisit the aforementioned GUI changes before getting into the PCB format? I see that the linux font isn't that much larger than the Windows one, so it shouldn't be a problem doing that resize to around 550x340.
byuu

Post by byuu »

EDIT: okay, PulseAudio support.

http://0pointer.de/lennart/projects/pul ... 6c26206689

Looks to be similar to libao, eg no control over blocking. At least not with this "simple API" version ...

Code: Select all

#include <pulse/simple.h>

pa_simple *pa_server;

bool init() {
  pa_sample_spec spec;
  spec.format = PA_SAMPLE_S16LE;
  spec.channels = 2;
  spec.rate = 32000;
  pa_server = pa_simple_new(0, "ruby::pulseaudio", PA_STREAM_PLAYBACK, 0, "audio", &spec, 0, 0, 0);
  return pa_server;
}

void write(uint16_t *data, unsigned length_in_bytes) {
  int error;
  pa_simple_write(pa_server, (void*)data, length_in_bytes, &error);
}

void term() {
  if(pa_server) {
    pa_simple_free(pa_server);
    pa_server = 0;
  }
}
I can't test this (PA doesn't work for shit in Ubuntu 8.04) ... anyone with Ubuntu 8.10 want to try plugging that into the libao driver (so you don't have to add your own hooks for a new one), and see how it sounds?
wertigon wrote:So a PulseAudio backend is needed as well in order to make bsnes run properly in Ubuntu...
Yep, and Windows still only needs one.

And sure, we'll be doubling the latency, but hey ... you can stream the audio over the web! I don't know about you, but I do that all the time. And by all the time, I mean never.
I have enough problems trying to understand plain english to try to understand lawyers. :-p
If someone sees a problem he will report it. Meanwhile I will submit the update to 0.037a.
Yeah, I don't really understand it all, either. Better to err on the side of caution, and make changes from there if needed.

And the update sounds good. Thanks for updating the package!
Japanese Localization file is here:)
Awesome! Thanks a bunch :D
I see that the linux font isn't that much larger than the Windows one, so it shouldn't be a problem doing that resize to around 550x340.
My main concern is that we don't make things too small for some of the longer languages, such as German. Luckily English is already pretty bad there, so I doubt it's a huge issue.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

I tried swapping out most, but that write function has me sorta stumped; There isn't one in the libao wrapper, and it's not just easily replaceable with sample. :/
[vEX]
New Member
Posts: 6
Joined: Sun Jun 03, 2007 2:01 pm
Location: Sweden

Post by [vEX] »

byuu wrote:To see what buttons? The video / audio / input drop-downs are visible in your screenshot.
I'm just so used to seeing everyone having a "Close" button in their configuration dialogs I figured bsnes would have one. It just now that I looked around that I realised that only some of the configuration "panels" actually have buttons.

To sum it up, my mistake, sorry.
[url=http://aur.archlinux.org/packages.php?ID=11576]Arch Linux bsnes package[/url]
byuu

Post by byuu »

New WIP.

For Linux users, this adds a PulseAudio driver, using <pulse/simple.h>. Debian / Ubuntu users will need to add libpulse-dev, or remove "audio.pulseaudio" from the ruby= line in the Makefile to compile now.

I wasn't able to test the driver at all -- I get "Connection refused" when I call pa_simple_new(). It appears that despite having Xubuntu 8.04, it doesn't come with PulseAudio installed. Guess they lied about it on their website or something ...
I could install the packages, but hearing horror stories from others -- I'd rather not.

If anyone can test for me, that'd be great. Check the console for error messages.

Next, I finally got around to re-doing the S-DD1 driver to eliminate the need to hook DMA transfers inside the S-CPU core to recognize decompression events. That violated my strict feelings regarding separation of cores and avoiding enslavement, even when it adds significant overhead.

I'm now going with a radically different approach, that's hopefully much more like the real hardware. It explains the way $4800 / $4801 behave, as well as why fixed transfers are required, but it may not be faithful.

What I do is have the S-DD1 chip spy on $43x2-$43x6, and cache the values internally. Then, whenever you read from $c0-ff:0000-ffff, it will test if $4800 & $4801 != 0. If that's the case, we look at the address requested, if it matches one of the active S-DD1 channels (eg $4800 & $4801 & (1 << channel#) != 0), then we hijack the read with decompressed data.

In my implementation, I decompress the entire block on the first read, then stream from the buffer. On real hardware, it most likely starts streaming on $4801.dN enable, but that's not too feasible for a few reasons for me. Most notably the S-DD1 lib requires a size parameter. It doesn't really matter, since we know the size from $43x5,6; so it doesn't suffer the same problems the SPC7110 did.

Anyway, once all the data is transferred, it will clear the channel bit from $4801. There may be some hardware differences here -- can you perform two transfers at the same time? What happens if HDMA terminates the DMA channel? These things never happen in Star Ocean or SFA2, so they'll have to be tested manually.

If no channels are active or there are no address fetch matches, it invokes the MMC to return raw ROM data.

All of that gives a ~1.5% speedup both to regular games and S-DD1 games. The former because DMA transfers don't have to test for the S-DD1 during every transfer; the latter because I'm using a quick lookup table (slower per fetch) in place of re-mapping the whole banks on writes to the MMC (very slow per write.) The latter was much cleaner and simpler, but I need the former to hook the decompression stuff natively.

Windows binary is included, I'd appreciate if anyone could play some Star Ocean / SFA2 and look for regressions from v037a.
I'm just so used to seeing everyone having a "Close" button in their configuration dialogs I figured bsnes would have one. It just now that I looked around that I realised that only some of the configuration "panels" actually have buttons.
Ah, I see what you mean. Sorry. I can add one if you want, I suppose.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Quick curious question. How do you calculate your percent speed up and slow down for BSNES when you change things such as the quoted 1.5% speedup you mentioned above?
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

byuu wrote: My main concern is that we don't make things too small for some of the longer languages, such as German. Luckily English is already pretty bad there, so I doubt it's a huge issue.
I dunno, I can't calculate it, but it doesn't look like it's going to come close to truncating anything.
Nightcrawler wrote:Quick curious question. How do you calculate your percent speed up and slow down for BSNES when you change things such as the quoted 1.5% speedup you mentioned above?
He probably just desyncs from everything and compares the fps extremes.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

I must say, after reading up a bit on PulseAudio, it seems like it has potential for being a great backend... Eventually. However, much needs to be fixed until it gets really good. :/

But, Pulse seems to offer a light at the end of the tunnel, if ever so small. Give it five to ten years and maybe you only need the PulseAudio API. :)

Unfortunately, this will be atleast as painful a transition as the entire UTF-8/ISO-8859-x stuff, not in the least because it WILL break older apps. But, eh.
null
New Member
Posts: 7
Joined: Sat Mar 29, 2008 8:09 am

Post by null »

Class release. I saw a problem with mouse on the game king arthur's world, but it's buggy in zsnes too (in fact, I remember it crashing).

About pulseaudio, I suggest that everyone disable it unless you actually use networked audio and use the standard alsa, or oss4 if it works better on your card.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

By the way, what is vex talking about?
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

configuring options in BSNES. normally there is a button/s with the word Close or Cancel somewhere and a Apply or OK button.
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 »

Uh, I recommended an "Apply & Restart" button ages ago, but byuu was paranoid that people were going to accidentally hit it in the middle of an unsaved game or something. I really doubt it, but I would've settled for a verification popup.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

just have a "save" button and a separate checkbox that when ticked, restarts the emulation when saving changes.
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 »

Not only can you not save changes without restarting, as soon as the user ticks it, you're back to the same scenario. There's no difference between a button without verification and a button without verification with a ticked checkbox below it.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

it is the users fault for enabling the scenario then though... so either make it never restart emulation (but mention it is needed or something in the status bar) or give the end user the choice in making configuration more annoying or not :P
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

I've not updated bsnes since 35, so I thought I might try the latest public version of 37a. I have a couple of comments:

1. The controller input no longer worked. When I went to the input screen and reassigned the buttons, I noticed it simply removed the underscores on all the designations. My guess is my system did not recognize the underscores as a valid part of the button assignment description.

2. What happened to the Exit button? I like to use fullscreen mode, but now I find I have to jump back to windowed mode just so I can close the program. I don't like this.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

franpa wrote:it is the users fault for enabling the scenario then though...
And clicking yes on a verification window isn't? You're suggesting the exact same thing as I am, except yours confusingly makes a button do nothing.
FirebrandX wrote:2. What happened to the Exit button? I like to use fullscreen mode, but now I find I have to jump back to windowed mode just so I can close the program. I don't like this.
You don't have to do that, you can assign any key or button to exit emulator in the GUI config. PS, the speed of esc/mouse-to-exit is actually slower than f11>mouse-to-X, because the exit in the former is in a menu.
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

FitzRoy wrote:PS, the speed of esc/mouse-to-exit is actually slower than f11>mouse-to-X, because the exit in the former is in a menu.
PS, its a matter of preference and what I am used to, but thanks for the smart remark. Thanks as well for the other more useful information.
byuu

Post by byuu »

How do you calculate your percent speed up and slow down
For <5%, I get max framerates of 2-3 games, and divide one by the other.
For >=5%, I try 4-10 games.
I dunno, I can't calculate it, but it doesn't look like it's going to come close to truncating anything.
The driver panel looks to be the worst. Maybe a listbox will help there.
Class release. I saw a problem with mouse on the game king arthur's world, but it's buggy in zsnes too (in fact, I remember it crashing).
Do you own the game? Could be a problem with the game itself ...
The controller input no longer worked.
I renamed the keysyms for them when I added mouse support. Sorry for the confusion.
What happened to the Exit button? I like to use fullscreen mode, but now I find I have to jump back to windowed mode just so I can close the program. I don't like this.
I was afraid of removing it for that reason. Nobody was for keeping the exit option in the menu when we talked about it*. Mainly because it's not related to the SNES "System" that the menu group was for. For now, maybe Alt+F4 or an exit key assignment to something will work?
(* I liked the idea of keeping it myself ...)

This is why I hate GUI design, I can never please everyone. Maybe it's time to just make a new panel to allow toggling all these things on or off.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

byuu wrote: The driver panel looks to be the worst. Maybe a listbox will help there.
Hmm, not seeing what you mean. Here's a mockup, point out the problem to me.

Image
This is why I hate GUI design, I can never please everyone. Maybe it's time to just make a new panel to allow toggling all these things on or off.
Please don't. The problem was unfamiliarity, it had nothing to do with the advantages of the change once adapted to.
Last edited by FitzRoy on Sat Nov 01, 2008 9:06 pm, edited 2 times in total.
Locked