bsnes v0.038 released

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
Locked
AamirM
Regen Developer
Regen Developer
Posts: 533
Joined: Sun Feb 17, 2008 8:01 am
Contact:

Post by AamirM »

Hi,
Intel C++ calls it PGO
They call it IPO (Interprocedural Optimization) actually. PGO is Profile Guided Optimization. In my experiences, both IPO and LTCG can break code though. You haven't tried Intel compiler yet?

stay safe,

AamirM
byuu

Post by byuu »

They call it IPO (Interprocedural Optimization) actually. PGO is Profile Guided Optimization. In my experiences, both IPO and LTCG can break code though. You haven't tried Intel compiler yet?
Oops, that was a typo, sorry. Yes, the MSDN article was making jokes about Intel's choice of acronym.

I haven't used the Intel compiler, because I don't pay for compilers. I have used Microsoft's /GL switch, and it seemed to work fine.
Try compiling it in LLVM instead of gcc.
It's a real chore to set up these compilers and build bsnes with them. Especially when there's a good chance it'll be slower / not work / etc.

I don't suppose someone here could try, and let me know how it goes?
henke37
Lurker
Posts: 152
Joined: Tue Apr 10, 2007 4:30 pm
Location: Sweden
Contact:

Post by henke37 »

I have always thought that gcc is nuts for warping the linker. Of course, it kinda is needed for the linker to talk to the compiler to inline stuff across compilation sessions.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

wertigon wrote:sleep depraved
Nice one
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
DataPath
Lurker
Posts: 128
Joined: Wed Jul 28, 2004 1:35 am
Contact:

Post by DataPath »

byuu wrote:
Try compiling it in LLVM instead of gcc.
It's a real chore to set up these compilers and build bsnes with them. Especially when there's a good chance it'll be slower / not work / etc.

I don't suppose someone here could try, and let me know how it goes?
I'll give it a shot.

apt-getting it right now.

edit: 8-12% performance SLOWDOWN with llvm. But at least it's very easy to try out.

For anyone else who wants to try it out, on ubuntu you just need to apt-get install llvm, and then compile bsnes with "compiler=llvm-gcc" instead of "compiler=gcc"
byuu

Post by byuu »

Well, the slowdown certainly sucks ...
Neat that it works though, thank you very much for testing :D
I'll see what happens with LTO.

Also, I have all the new locales up, sorry for the delay and thanks again to everyone for contributing!

New site theme system, too. The shaoran one requires a "bsnes capable" system to render quickly :P
Panzer88
Inmate
Posts: 1485
Joined: Thu Jan 11, 2007 4:28 am
Location: Salem, Oregon
Contact:

Post by Panzer88 »

O_0 interesting new theme.... :) a bit abbrasive to try to read with it on but that's a neat graphic.
[quote="byuu"]Seriously, what kind of asshole makes an old-school 2D emulator that requires a Core 2 to get full speed? [i]>:([/i] [/quote]
byuu

Post by byuu »

It has text-shadow on FF3.1 and Opera 10, which helps a lot.

Still, I suppose I can raise the opacity a bit more ...

These are all old graphics from 2004, I have about eight of them. I took really crappy cell scans and JPEGs, then "traced" and re-painted them in Photoshop to get all the artifacts out.

I wanted to use a nice textured pattern, but those are damn near impossible to find. 99.9% crap to quality content out there for textures.

EDIT: ... and the default theme works beautifully even in IE6, too!
I feel silly now, wasting so much time trying to get DIVs working in IE6, just to avoid the people who bitch about tables for god knows what reason.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

I'm waiting for hardware-accelerated browsing. One day...
byuu wrote:It has text-shadow on FF3.1 and Opera 10, which helps a lot.
I don't use Opera often; anybody know how fast they turn alpha releases into full releases?
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Rhapsody
Rookie
Posts: 23
Joined: Wed Jul 02, 2008 3:35 pm

Post by Rhapsody »

byuu wrote:I feel silly now, wasting so much time trying to get DIVs working in IE6, just to avoid the people who bitch about tables for god knows what reason.
I'm a stickler for code cleanliness in HTML, but even I'm not going to object here. I've had some experience trying to make a complicated page design work with fully valid, clean coding. It's enough to drive just about anyone insane.

The CSS validator can still find stuff to complain about though. The errors are mostly about the vendor-specific elements you need to be using, though one is it not recognizing nth-of-type as a valid element (???), and another is about it not recognizing a value attached to box-shadow. Not sure what to make of the last two.

There's also a load of warnings, one about not setting a generic font family as a last fallback (you might have meant "sans" as generic, but it's actually "sans-serif") and the rest are all about not specifying color when specifying background-color, or vice-versa. Ideally, the two should always be specified together. If you don't want to change the color or background-color (whichever you're not specifying), use the 'inherit' value. IE6 doesn't understand the value, but you said it works now anyway, so it'll just ignore them. Incidentally, one stylesheet I can think of that triggers neither of these warnings is my own. :)
byuu

Post by byuu »

I don't even bother with the W3C's CSS validator.

It gives errors for all of the CSS3 features I use, as well as for vendor-specific names for CSS3 features. Nothing I can do about that. I want the features now, so I'm going to use them now.

The color thing is due to many browsers not supporting RGBA. It'll end up transparent unless you use the default, RGB-only stylesheet. RGBA beats the hell out of opacity, which makes the text and all child elements translucent as well. Still not as good as it could be -- the background element should blur to enhance text readability, ala Compiz+Blur.
Rhapsody
Rookie
Posts: 23
Joined: Wed Jul 02, 2008 3:35 pm

Post by Rhapsody »

byuu wrote:I don't even bother with the W3C's CSS validator.
Have you seen what it says for my site? Even if I fix that error (which apparently has something to do with me specifying language within the HTTP header) it then says "No style sheet". Apparently, the (100% valid) xml-stylesheet method I use is completely alien to the validator. I do find it somewhat amusing that whoever programmed the CSS validator apparently doesn't know anything about XHTML or HTTP headers. Also, neither the CSS nor the mark-up validator send an http-accept header, screwing up content negotiation code (I've had to place a hack in mine to make the mark-up validator work).

I am giving serious consideration to dumping the whole XHTML thing and migrating the whole site to HTML 5, though that would mean giving up my place on The X-Philes. I'm keeping it up mostly as a protest against the state of XHTML support (i.e. completely non-existent) in Internet Explorer. As far as I know, not even IE8 has any support.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

byuu... instead of ranting and forsaking divs, just use them appropriately for the application. ;)

For your page, you want to use floating divs. Here is step by step instructions for exactly what you're trying to achieve.

http://www.maxdesign.com.au/presentatio ... /index.htm
http://wiki.dreamhost.com/Two-Column_Layout

If you have problems with that, let me know. That should work without much trickery even in IE.

Your Shaoran theme is nice. How about a blueish/grayish ( I can't recall exactly) colored version similar to how your page used to be when you last used that image for background? I always liked that one. Colors were very pleasing.
[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.
wertigon
Rookie
Posts: 46
Joined: Sat Aug 07, 2004 7:20 pm

Post by wertigon »

Personally I still feel XHTML matters, but I also feel that the web, as it stands today, is an absolute development hell, especially on the front end. For one thing there's no easy way to separate back-end to front-end, Even if you can do it in your code both the database devs and the HTML devs must know quite a bit of the application framework regardless. Ideally they'd just have to take the input variables, put them in the proper locations without a care of whether or not it's PHP, ASP, XHTML, XSLT etc.

Being a front-end developer myself, one thing I *really* miss is an easy way to do form validation client-side without JavaScript, the way we do it now in a community I code on, every form has atleast around 100-300 lines of JavaScript code - And then we've still been using generic templates for most, had we inlined all those functions we're talking about thousands of lines of code.

Another is an easy way for a backend coder to say "Oh hey! I've got these fields I want in my database!" pass them over to the front-end, front-end does all validation, and then pass back to back-end. XForms does precisely this but has a really steep threshhold, so it isn't exactly easy... :/

Thanks to the fact that we're using XHTML, we could start using XForms today if we wanted to. Except no browsers support it today. So we'd have to hack up an XForms->JavaScript/PHP->XHTML solution, not pretty. But, XForms and XHTML 2.0 are really powerful technologies and if browsers would just start supporting them...

*sighs*

Sorry about the rant, I'm one of those few who actually do know enough CSS and have more or less achieved "Zen" status in it, but I *really* hope my life will get easier soon... Atleast I don't have to code for IE6 anymore (Don't care if it looks ugly in IE6, as long as it works). :)

Oh, and a sleep-deprived mind do make you write funny stuff. Like "sleep depraved". ;)
byuu

Post by byuu »

Nightcrawler wrote:For your page, you want to use floating divs. Here is step by step instructions for exactly what you're trying to achieve.
No, I want to use tables. They share TD height with each other, DIVs do not, period. Sorry, I guess I wasn't clear enough on my site. I don't intend to have this conversation again. We've had it ten times now. I don't care about your damn sccreen readers or utopian ideals.

Clone my default theme pixel-for-pixel using-em-units in DIVs and get it to work in every single browser, including IE6 and using no hacks, both with a taller navbar and taller body height, allow unique colors for header+nav+body+footer (the default theme has the same color for header+nav -- but I can make each unique, that was a design goal), make sure scaling to all sizes works the same, and then we'll talk. Bonus points if you avoid the "semantic wrapper" "container" DIV -- pure CSS isn't supposed to need that, either.

Hint: both of your examples rely upon the "faux column" trick that I'm well aware of (imagine that, I know all about DIV tricks after using them for several years myself). Try putting a one-pixel border between them. Both of your examples will fail, depending on which DIV is taller. Putting the border inside the background image is cheating. CSS is supposed to be able to control everything, plus it will break once the DIV width exceeds the image width. With tables, I don't need to use a solid-color background image hack -- I can specify the color in my CSS file.
How about a blueish/grayish ( I can't recall exactly) colored version similar to how your page used to be when you last used that image for background? I always liked that one. Colors were very pleasing.
Forgot the color values, but I have it archived. Sure, I'll use those.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

byuu wrote: Clone my default theme pixel-for-pixel using-em-units in DIVs and get it to work in every single browser, including IE6 and using no hacks, both with a taller navbar and taller body height, allow unique colors for header+nav+body+footer (the default theme has the same color for header+nav -- but I can make each unique, that was a design goal), make sure scaling to all sizes works the same, and then we'll talk.
If you weren't such an asshat about it and would appreciate it, I would.

If that's how you treat offers for help, than I politely withdraw the offer.

Next time, don't post a rant if you don't intend it to be discussed. It's certainly misleading.
[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.
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

TD don't share height with each other, they inherit the height of their parent TR.

that being said...
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
byuu

Post by byuu »

Nightcrawler wrote:If you weren't such an asshat about it and would appreciate it, I would.
You in particular have bugged me about every page layout change I've ever made. My sincere apologies if I came off too rudely, that wasn't my intention at all. I know you're trying to help, but I'm just tired of hearing about it. I thought I made that clear on my page (see below.) But I am still kind of pissed upon the epiphany of how many dozens of hours I've wasted on DIV layouts to make a small handful of people happy.

Thus, just venting frustration. It wasn't directed at you.
Nightcrawler wrote:If that's how you treat offers for help, than I politely withdraw the offer.
That's unfortunate. I was hoping you'd see my point about DIVs and height inheritance firsthand. At that point, we could have a real discussion about it. As of now, you're telling me things I already know (eg faux columns -- moving stylesheet info from HTML to PNG.)
Nightcrawler wrote:Next time, don't post a rant if you don't intend it to be discussed. It's certainly misleading.
From my rant:

"I'm a pragmatist ... I do what works best for me. And tables work. Ergo, from now on, I'm using them ... don't bug me about it. I don't care anymore. And neither should anyone else."

I don't see how that was misleading.
funkyass wrote:TD don't share height with each other, they inherit the height of their parent TR.
Oh, good to know. I said that because the smallest TD becomes the same height as the largest TD. It would seem more as if the TR is inheriting the largest TD's height. Either way, the effect works as expected.
Thristian
Hazed
Posts: 76
Joined: Tue Feb 07, 2006 11:02 am

Post by Thristian »

byuu wrote:Still not as good as it could be -- the background element should blur to enhance text readability, ala Compiz+Blur.
Firefox 3.1 looks like it might begin supporting something like that with SVG filters, although it's not immediately obvious how you could do the translucent-and-blurry effect. Still, with that effect made popular by Vista (in the Aero theme) and OS X (in the menu-bar), I'm sure it's something they're thinking about.
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

So bsnes built and runs great this afternoon in Sid.
The JMA thing always makes it too slow to build for my impatience and since I don't use it (which I probably should if I cared about drive space and stuff) I just compile without it. I should care more, really I should.

My Celeron is so slow for bsnes but I get 60/70 to 90 percent speeds depending on the game, and I've always been cool with frameskip.

Then again I emulate mostly on the Wii nowadays. It's convenient..

bsnes wii port lol sounds scary
byuu

Post by byuu »

Trying to be a bit nicer ... I've posted an article about the problem I have with DIVs: http://byuu.cinnamonpirate.com/articles/cultofdiv

I still don't wish to debate on-and-on over it, but if someone can create a div layout that acts exactly like the table layout, without using images, with no browser-specific CSS-hiding hacks, with only two divs, that resizes cleanly, and gets it rendering on all browsers incl. IE6, I'll concede defeat on the argument.

That said, if my use of tables wasn't controversial enough, this certainly will be.

To aid in semantic markup, I've added new attributes to the HTML 4.01 DTD. Example:

Code: Select all

<h3 date="2008-12-20">Title</h3>
<blockquote author="byuu"><p>"Divs really suck"</p></blockquote>
I display the data like so:

Code: Select all

h3[date]:after {
  content: attr(date);
  float: right;
}
Opinions seem largely divided on how legal this is, but it works everywhere, and even the W3C validator likes it, so it stays. Makes the text files more readable than using class= to store data.
Thristian
Hazed
Posts: 76
Joined: Tue Feb 07, 2006 11:02 am

Post by Thristian »

byuu wrote:Opinions seem largely divided on how legal this is, but it works everywhere, and even the W3C validator likes it, so it stays. Makes the text files more readable than using class= to store data.
I probably would have stuck it in a carefully-styled <SPAN> rather than an attribute, but I notice your approach is sanctioned by HTML5 (or at least it would be if you called it "data-date" instead of "date").
byuu

Post by byuu »

New WIP. Audio panel was revised, it's now the same both in regular and advanced mode.

Volume, Frequency and Latency all appear on one row and are all combo boxes with sane defaults. Advanced mode gives them additional options.

Frequency adjust remains a slider. Given that 1 tick can mean the difference between frame stuttering once a minute and once an hour, I think it's worth keeping the precision.

Code-wise, I merged the ppucounter object into the PPU class (through inheritance). This results in the following code simplification:

Before:

Code: Select all

ppucounter.vcounter()     //S-CPU time
ppucounter.ppuvcounter()  //S-PPU time
After:

Code: Select all

ppu.vcounter()  //S-CPU time
ivcounter()     //S-PPU time (called inside its own class, no need for ppu. prefix)
i just stands for "internal". It was that or slow things down with a co_active() check inside the counter read calls.

Man, it feels weird editing C++ code after all of that CSS magic. I find myself wanting to write a pattern-matching rule ...

Code: Select all

uint16 PPUcounter::vcounter() {
  return cpu_vcounter();
}

uint16 PPUcounter::vcounter() [class="PPU"] {
  return ppu_vcounter();
}
I probably would have stuck it in a carefully-styled <SPAN> rather than an attribute, but I notice your approach is sanctioned by HTML5 (or at least it would be if you called it "data-date" instead of "date").

Code: Select all

<h3><span>2008-12-20</span>Title</h3>
<blockquote><p>All that is necessary for the triumph of evil is that good men do nothing<span>Edmund Burke</span></p></blockquote>
Could work ... looks weird, though. Adding a class type to the spans to state what they are makes it even more bloated, but perhaps worth it ... hmm.

HTML5 approach looks cool, too. data- prefix isn't too bad. A good indicator that it's not a real tag.

EDIT: oops, looks like I forgot that IE6 can't handle the text-align attribute properly, either. Eh, I'll fix it tomorrow. Tired now.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

I've been looking at the default color settings and to my eyes, a contrast setting of 100 alongside the gamma curve looks the punchiest. How come your default is 80?

Something else maybe you can explain for me: I'm noticing a lot of black backgrounds that are just above the R0G0B0. We'll use Battle Blaze's title screen as an example. Go into fullscreen mode, and you can more easily see this with the non-display-area darkness being pure black R0G0B0, but the display area black being R1G1B1. I could see the difference with my eyes, but got the numbers eyedropping a printscreen in PS. Is this a slight bug in your color rounding? It's nothing to do with the gamma curve being enabled/disabled.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Fitzroy is correct, there's a problem with gamma_adjust. If 0 is passed in and gamma is 100, it will do "((0 + 1)/256)^1 * 256", which is of course 1. I'm not sure how it's supposed to work, maybe you're forgetting to subtract 1 at the end?

Edit: I think what you want is the following. You want to change the range from 0-255 to 0-1, which means you have to do "new_minimum + new_range * input / old_range" or "0 + (1 - 0) * input / (255 - 0)" which simplifies to "input / 255".

Code: Select all

(int32_t)(pow((double)input / 255.0, (double)gamma / 100.0) * 255.0 + 0.5)
Also no need for clamping at the end.

Edit2: In adjust_contrast, you want ...

Code: Select all

(int32_t)(lmin + (lmax - lmin) * (double)input / 255.0 + 0.5)
... because the you want the range again. It's the simple ones that get you in the end..

Edit6: using only integers it becomes

Code: Select all

  int32_t result = input - contrast + (2 * contrast * input + 127) / 255;
Edit3: oops, one too many opening parentheses in the first code. Fixed.

Edit4: while we're on the subject, wouldn't it be better to rewrite the colour-conversion-and-gamma-ramp code like this?

Code: Select all

    if(gamma_ramp == true) {
      r = gamma_ramp_table[i       & 0x1f];
      g = gamma_ramp_table[i >>  5 & 0x1f];
      b = gamma_ramp_table[i >> 10 & 0x1f];
    }
    else {
      r = (i       & 0x1f) << 3 | (i >>  2 & 0x7);
      g = (i >>  5 & 0x1f) << 3 | (i >>  7 & 0x7);
      b = (i >> 10 & 0x1f) << 3 | (i >> 12 & 0x7);
    }
I don't think this avoids any rounding errors but it looks a lot cleaner in my opinion. It also allows you to omit the 'col' variable entirely.

Alternatively:

Code: Select all

    else {
      r = (255 * (i       & 0x1f) + 15) / 31;
      g = (255 * (i >>  5 & 0x1f) + 15) / 31;
      b = (255 * (i >> 10 & 0x1f) + 15) / 31;
    }
Edit5: some clarification on the 'range' aspect.

Edit6: On top of everything you may want to switch to floating point inside the colortable update() function to avoid rounding errors altogether. You've already said that as the colortable is only generated when bsnes is loaded or the settings are changed, doing this won't cause a performance regression - and it makes the code even cleaner. Besides, using floating point is already unavoidable inside the gamma_adjust function. I've made this conversion in my copy of the 0.038 wip; if you would like, I can PM you the code. (I could put it here but it would be rather long)
Last edited by Verdauga Greeneyes on Sun Dec 21, 2008 1:53 am, edited 1 time in total.
Locked