View unanswered posts | View active topics It is currently Tue Dec 10, 2019 5:36 pm



This topic is locked, you cannot edit posts or make further replies.  [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
bsnes v0.042 released 
Author Message
Trooper

Joined: Wed Mar 01, 2006 8:47 pm
Posts: 550
Post 
belegdol wrote:
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 ;)


...unless you're using a non-RPM distro (i.e. Slackware) and don't like compiling from source.
Just extract the .RPM,download some dependencies and run bsnes :)

_________________
Have a nice kick in da nutz @~@* c//


Wed Apr 01, 2009 5:29 pm
Profile
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
If you want to search for rpms themselves, you should look at http://download1.rpmfusion.org/nonfree/fedora.


Wed Apr 01, 2009 5:58 pm
Profile
Post 
belegdol wrote:
If you want to search for rpms themselves, you should look at http://download1.rpmfusion.org/nonfree/fedora.


If it's non-free, then I demand you start paying me $3 per download :P
Consider it an abuse of the English language toll charge :D </troll>


Wed Apr 01, 2009 6:52 pm
Hazed

Joined: Tue Dec 07, 2004 10:24 am
Posts: 68
Post 
If it were up to me, we'd have freeasinbeer and freeasinspeech trees :P


Wed Apr 01, 2009 7:38 pm
Profile
Official tech support dood

Joined: Wed Jan 25, 2006 7:57 am
Posts: 2092
Post 
i'd rather just have a beer tree ;)
[/off-topic]

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


Wed Apr 01, 2009 7:44 pm
Profile
Post 
Re: UPS patches saying they worked when they did not. That was easy enough.

Code:
  if(load_file(get_filename(filename, "ups", snes.config.path.patch), pdata, psize, CompressionInspect) == true) {
    apply_patch(pdata, psize, data, size);
    delete[] pdata;
    patched = true;
  } else {
    patched = false;
  }


Wasn't checking the return value of apply_patch.

Code:
  if(load_file(get_filename(filename, "ups", snes.config.path.patch), pdata, psize, CompressionInspect) == true) {
    bool result = apply_patch(pdata, psize, data, size);
    delete[] pdata;
    patched = result;


Thu Apr 02, 2009 4:34 pm
Post 
New WIP.

Updated centering code, it now just has per-platform centering code. So it should look great with no flickering / movement on Windows or Linux.

Fixed the patching status thing so it won't say it patched when it fails. But seems there's not enough safeties in nall::ups. A patch of nothing but "UPS1" has a 50% chance of crashing the emulator.

Most importantly, I finally got around to writing my pre-processor, which is intended to add macro support to both C++ and xkas. Calling it bpp, for byuu's pre-processor.

I started rewriting the S-CPU opcodes to use the new pre-processor. 40 of 256 opcodes finished. I'm also separating the 8-bit and 16-bit versions this time. Twice the code, but it's easier on the eyes.

Old:
Code:
ldy_addrx(0xbc, ldy, regs.p.x),
ora_addrx(0x1d, ora, regs.p.m),
sbc_addrx(0xfd, sbc, regs.p.m) {
1:aa.l = op_readpc();
2:aa.h = op_readpc();
3:op_io_cond4(aa.w, aa.w + regs.x.w);
4:if($2) last_cycle();
  rd.l = op_readdbr(aa.w + regs.x.w);
  if($2) { op_$1_b(); end; }
5:last_cycle();
  rd.h = op_readdbr(aa.w + regs.x.w + 1);
  op_$1_w();
}


New:
Code:
@macro op_read_addrx(name)
  void {class}::op_{name}_addrx_b() {
    aa.l = op_readpc();
    aa.h = op_readpc();
    op_io_cond4(aa.w, aa.w + regs.x.w);
    last_cycle();
    rd.l = op_readdbr(aa.w + regs.x.w);
    op_{name}_b();
  }

  void {class}::op_{name}_addrx_w() {
    aa.l = op_readpc();
    aa.h = op_readpc();
    op_io_cond4(aa.w, aa.w + regs.x.w);
    rd.l = op_readdbr(aa.w + regs.x.w + 0);
    last_cycle();
    rd.h = op_readdbr(aa.w + regs.x.w + 1);
    op_{name}_w();
  }
@endmacro


Code:
@global class sCPU
@include "opcode_read.bpp"

@op_read_addry(ldx)
@op_read_addry(ora)
@op_read_addry(sbc)


Yes, I know the above can be done with the C pre-processor. Two major reasons I avoided it:
1) I refuse to put \ after every line.
2) parameters are limited, eg MACRO(&=~, x += 2) would not work.

The important thing was making a more generic / flexible format. Will allow me to kill off src/tool, though I'll still include the new parser's source under src/lib/bpp.

May extend bpp in the future, who knows. @if/@else/@endif would be nice, as would nested macros and static programming functions.


Fri Apr 03, 2009 11:15 am
Seen it all
User avatar

Joined: Mon Jan 03, 2005 5:04 pm
Posts: 2302
Location: Germany
Post 
Great! Maybe you can make it even more readable by removing those empty ()s somehow. :wink:

_________________
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list


Fri Apr 03, 2009 1:39 pm
Profile WWW
Post 
() distinguishes functions from variables.

Had trouble getting a pointer into a member function pointer table last night, so I was using:

Code:
(this->op_table[table_index + opcode])();


Now:

Code:
void (sCPU::**op_table)();
void (sCPU::*op_table_EM[256])();
op_table = op_table_EM;
...
(this->*op_table[opcode])();


Seems to be a bit faster, 124fps -> 127.5fps. Still below 129fps for v042 official. Won't be able to tell if the new method is faster (should be) until I convert all opcodes. Right now it has to see if the table entry is empty, and if so go back to the older switch table.

Mednafen pointed out what I forgot, we can shadow cases in a switch table to avoid code duplication, eg:

Code:
case table_EM+0xa9: case table_MX+0xa9: case table_Mx+0xa9:
  //op_lda_const_b goes here
  break;
case table_mX+0xa9: case table_mx+0xa9:
  //op_lda_const_w goes here
  break;


But honestly ... even if it's a lot more work to use functions instead of a giant switch table (need function headers and table initialization), and it adds to compile time + code size very very slightly, I think I prefer it that way. Looks nicer in the macros (wouldn't be able to group _b + _w types in the same macro with cases; switch table would be a lot uglier than my table setup code), and it avoids the need for an opcode offset index.

Could also work largely in my favor for more natural hypothetical SA-1 support by forming a base 5a22 class that they both inherit from. That would work with switch() too, but would take away a tiny bit of flexibility in the opcode dispatch model (eg have to call the base class' function that has switch table instead of implementing it directly in the derived class.)


Fri Apr 03, 2009 5:33 pm
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3902
Location: Solar powered park bench
Post 
byuu wrote:
() distinguishes functions from variables.

Not quite.
A function is a variable.

() at the end means to call the function and return the result, while without it means to assign it the memory address of the variable.

var = blah; //Var equals the address of blah, running var() would be the same as running blah()
var = blah(); //Var equals result of running blah, blah is actually ran here

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Sat Apr 04, 2009 6:02 pm
Profile WWW
ZSNES Shake Shake Prinny
User avatar

Joined: Wed Jul 28, 2004 4:15 pm
Posts: 5615
Location: PAL50, dood !
Post 
Obviously, 'var' is a function pointer in the first, while it's the type of the returned value in the second.

_________________
皆黙って俺について来い!!
Code:
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54


Sat Apr 04, 2009 10:38 pm
Profile
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3902
Location: Solar powered park bench
Post 
grinvader wrote:
Obviously, 'var' is a function pointer in the first, while it's the type of the returned value in the second.

Indeed, And for fun, the type of the returned value can also be a function pointer.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Sat Apr 04, 2009 11:20 pm
Profile WWW
Post 
I gave a quick answer, wasn't going for a technical exact explanation :P

Anyway, up to 194 of 256 opcodes converted to the new pre-processor. Very, very tiring work.


Sun Apr 05, 2009 10:39 am
Justice is Blind

Joined: Wed Jul 28, 2004 3:33 pm
Posts: 620
Location: Test
Post 
Erm... I think creaothceann was being sarcastic.

I mean, he made VSNES. I have trouble believing he has no idea what a function is.


Sun Apr 05, 2009 3:51 pm
Profile ICQ YIM WWW
Seen it all
User avatar

Joined: Mon Jan 03, 2005 5:04 pm
Posts: 2302
Location: Germany
Post 
Just can't help commenting on C-style languages from time to time. ;) And probably getting on people's nerves by doing that...

Yeah, () indicates functions/calls... just seems like a nutty way to go about it.

_________________
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list


Sun Apr 05, 2009 4:42 pm
Profile WWW
Veteran
User avatar

Joined: Thu Feb 03, 2005 8:18 pm
Posts: 768
Post 
Couple weird bugs in v0.42. Not really huge bugs, but thought you might like to know:

1. Close and re-open bsnes. Go to input configuration. Click on an assignment that has something assigned to it (as in, not "none"). Click Unassign. The line item increases slightly in height. Closing and re-opening bsnes resets it to the default line height.

2. bsnes no longer works with GlovePIE (which I use so I can play bsnes with a Wii Classic Controller). I assign the Classic Controller's buttons to keyboard buttons, then I try to assign that to bsnes buttons. It used to work, at least in v0.40. I also tested it in a text editor and it works fine there. EDIT: found the fix. Switch input driver back to DirectInput.

Finally, is there a way so that I can close the various bsnes dialog boxes using ESC? This is the typical behavior of almost every other Windows program I have ever used (ESC closes a dialog box).

EDIT: My Xbox 360 controller appears to work as expected. Didn't specifically test the shoulder triggers.

_________________
Official ZSNES Docs | NSRT Guide | Using a Wiimote w/ emulators


Sun Apr 05, 2009 4:55 pm
Profile WWW
Post 
1. is a bug with Qt. Not much I can do about it.

2. GlovePIE apparently hooks DirectInput, but not RawInput. Something the author of the program needs to address.

3. none of my windows are true dialog windows, they're just popup windows. Alt+F4 / Ctrl+F4 should also work.


Sun Apr 05, 2009 7:51 pm
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
byuu wrote:
3. none of my windows are true dialog windows, they're just popup windows. Alt+F4 / Ctrl+F4 should also work.


Except for the load window, which indeed works with Esc.


Sun Apr 05, 2009 8:41 pm
Profile
Post 
I don't know if this is the right place but... i'm using bsnes on a HP notebook and i just can't play without opening the menus everytime i assign any joypad button to certain keys, like, spacebar, H or S. Is there some way to stop these keys from opening the menu?


Sun Apr 05, 2009 11:23 pm
Post 
nobuo, I don't follow. Spacebar, h and s don't trigger the menubar. Alt does, however. Alt+any of those keys will cause the menu to appear. And unfortunately, I don't have a way around that right now. Qt will trigger the context menu even when it is hidden. So you'll have to avoid pressing alt while playing.


Sun Apr 05, 2009 11:56 pm
Rookie
User avatar

Joined: Sat Sep 04, 2004 12:17 am
Posts: 31
Post 
Actually, the bug nobuo describes is more severe than that (I've noticed it too) ---

Once Alt has been pressed to access the menubar (even just one time), the menu accelerator keys become functional even without pressing them together with Alt.

So, for example:
1. Alt+S, Enter (Load game...)
2. S, X (emulated buttons 'X', 'A' by default)
3. Oops, bsnes quits :)


Mon Apr 06, 2009 12:37 am
Profile
♥ Love Freak FlonneZilla ♥
User avatar

Joined: Sun Apr 01, 2007 12:59 am
Posts: 111
Location: USA
Post 
nachch wrote:
So, for example:
1. Alt+S, Enter (Load game...)
2. S, X (emulated buttons 'X', 'A' by default)
3. Oops, bsnes quits :)

Holy crap this actually happens. :shock:


Mon Apr 06, 2009 3:01 am
Profile WWW
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Stop pressing alt.


Mon Apr 06, 2009 4:02 am
Profile
Post 
New WIP. The entire S-CPU opcode core has been re-written to use my new pre-processor.

The downside is that it's actually slightly slower, by less than 1%. Guessing that having almost twice the opcode implementations ends up eating more valuable L1 cache, making it more painful than the two conditionals per function I had before. But damn if it isn't more readable now.

Before:
Code:
ror_addrx(0x7e, ror) {
1:aa.l = op_readpc();
2:aa.h = op_readpc();
3:op_io();
4:rd.l = op_readdbr(aa.w + regs.x.w);
5:if(!regs.p.m) rd.h = op_readdbr(aa.w + regs.x.w + 1);
6:op_io();
  if(regs.p.m) { op_$1_b(); }
  else { op_$1_w();
7:op_writedbr(aa.w + regs.x.w + 1, rd.h); }
8:last_cycle();
  op_writedbr(aa.w + regs.x.w,     rd.l);
}


After:
Code:
@macro op_adjust_addrx(name)
  void {class}::op_{name}_addrx_b() {
    aa.l = op_readpc();
    aa.h = op_readpc();
    op_io();
    rd.l = op_readdbr(aa.w + regs.x.w);
    op_io();
    op_{name}_b();
{lc}op_writedbr(aa.w + regs.x.w, rd.l);
  }

  void {class}::op_{name}_addrx_w() {
    aa.l = op_readpc();
    aa.h = op_readpc();
    op_io();
    rd.l = op_readdbr(aa.w + regs.x.w + 0);
    rd.h = op_readdbr(aa.w + regs.x.w + 1);
    op_io();
    op_{name}_w();
    op_writedbr(aa.w + regs.x.w + 1, rd.h);
{lc}op_writedbr(aa.w + regs.x.w + 0, rd.l);
  }
@endmacro

( note: {lc} is short-hand to 'hide' last_cycle(); )

Really worn out now, so don't expect a new WIP for quite a long time I'm afraid. I'll worry about the S-SMP's core much later. Would appreciate thorough testing. Given I rewrote all 256 opcodes by hand, it's possible I made a mistake somewhere.

nachch wrote:
Once Alt has been pressed to access the menubar (even just one time), the menu accelerator keys become functional even without pressing them together with Alt.


Wow ... that is quite alarming. Not sure why Qt is doing that. But since I don't have a way of fixing it yet ... for now:

FitzRoy wrote:
Stop pressing alt.


:/


Mon Apr 06, 2009 4:13 am
Veteran

Joined: Wed Aug 04, 2004 5:43 pm
Posts: 861
Location: Sloop
Post 
Ironically, nachch's problem wouldn't even be possible if the useless "exit" hadn't been covertly reinserted. The CIA calls this blowback.


Mon Apr 06, 2009 4:24 am
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 125 posts ]  Go to page Previous  1, 2, 3, 4, 5  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.