xboxscene.org forums

Pages: 1 [2] 3 4 5

Author Topic: Snes9xbox V3 Possibly Up And Coming  (Read 3929 times)

Dante_Ali

  • Archived User
  • Full Member
  • *
  • Posts: 143
Snes9xbox V3 Possibly Up And Coming
« Reply #15 on: April 24, 2011, 07:21:00 AM »

Hi there, I'm Squarepusher from the psx-scene forums - long-time fanboy of the Xbox scene though - it's what gave me the motivation to update these PS3 emulator ports regularly because I wanted to see it flourish like the Xbox 1 scene.

Great that somebody has finally ported over a recent version of SNES9x to Xbox 1 now.

I do know for a fact that zones' IRQ/SA-1 changes have had a big performance impact in 1.53 (Jikkyou Oshaberi Parodius for instance is well above 60fps in the character select screen without them - with the zones IRQ/SA-1 changes, it dips below 53fps) - that's why I'm not using them (I develop the PS3 port) and neither does the Wii devs (dborth).

It would be interesting to see how well this code runs on x86. I know a couple of games that are very demanding on PS3 that you could test:

1 - Star Fox 2 - this will drop to 55/56fps regularly - perhaps even a bit more in some of the indoor areas.

2 - Romancing Saga 3 - when you go to the 'equip'/'menu screen' (with the 6 characters/sprites on top of a hi-res 512x224 screen) - the framerate will drop to 40fps.

3 - Seiken Densetsu 3 - if you select Angela as your first character and bring up the 'equip/menu screen' when you're outside, it will drop to 40fps. The equip menu screen is another one of these instances where the SNES goes into hi-res 512x224 - but for some reason, it seems to only drop down massively with these two games in particular - Kirby's Dreamland 3 runs at well above 60fps in levels where 512x224 gets used.

Now the weird thing is - for ANY of the other characters (Duran/Hawk/Kevin/Riesz/whatever), this does not happen at all. That's what makes me think it's some kind of display bug in SNES9x.

4-  Vortex - similarly slow as Star Fox 2 - drops to about 57/55/53fps depending on the situation.

I've put most of these performance problems down to the fact that the original code is full of branches and made some amends to make the code blocks bigger so there are less branches which would flush the pipeline all the time.

One way I cut down on some of the branches is to make three codepaths - one for SuperFX games, one for SA-1 and one for regular games - no SA-1/SuperFX basically. That way, I can leave out all of the SuperFX/SA-1 branches in the regualr codepath - you can setup these codepaths easily in SNES9x because Settings.SA1 or Settings.SuperFX always gets set in memmap.cpp while the ROM is loaded by SNES9x - so we know when a game has been loaded that has a SA-1 or SuperFX co-chip. Based on that knowledge, we can point it to a modified S9xMainLoop.

Now obviously, an x86 out-of-order CPU should have far less problems with this codebase, so let's hear how this Xbox version performs with the above mentioned games. Hell, I'd gladly whip out my Xbox 1 and go test it myself - it will certainly be laughable if a Celeron 733 performs better than the Cell 3.2GHz PPU.

Another thing that made a big difference on PS3 - removing virtual function call overhead - you can take a look at how I modified the APU code in the PS3 port - perhaps it will make a difference on Xbox 1 as well.

This post has been edited by Dante_Ali: Apr 24 2011, 02:42 PM
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #16 on: April 24, 2011, 11:56:00 AM »

Hey man.. thanks for the tips.  It's nice to see advice from someone doing a port for another console system.  (IMG:style_emoticons/default/smile.gif)  Indeed trying to squeeze any kinda performance outta this thing is tough.  I'd love to be able to get it running with the NTSC filters at 60fps for most of the games.  It seems to do ok with PAL games running at 50fps.. for what it is worth.  (IMG:style_emoticons/default/laugh.gif)

Here is what I posted over at the snes9x forums.

QUOTE
ok. Well I managed to get 1.52 working with the SuperFX and C4 ASM cores. Took a little bit of finagling to get it to compile but it finally did. So SMW2 seems to run a fair bit better. Also threw in the EWJ 2 sound fixes too boot. Plus for some reason SM RPG seems to be going at a fair speed as well. In fact I noticed some mistakes I made when doing the svn (1.53 whatever) so I might go back over that one again with those changes just to see how it performs.

Had a bit of a scare there when I noticed the messed up background tiles in Donkey Kong Country.. but I found the fix in the fix4 fix.. fix.. fix..

NTSC filters still pretty much suck but they do run pretty fair on PAL roms.. (talk about ironic).


Once I clean up the 1.53 stuff.. I'll look into what you mentioned for the APU code.  I suspected the APU code may be contributing a little to slow down.
Logged

Dante_Ali

  • Archived User
  • Full Member
  • *
  • Posts: 143
Snes9xbox V3 Possibly Up And Coming
« Reply #17 on: April 24, 2011, 12:45:00 PM »

Yeah, as soon as I saw that they removed the ASM cores I realized future Xbox porters were not going to be pleased (IMG:style_emoticons/default/smile.gif). Those ASM cores are very old though and might contain many inaccuracies.

Just for your information - here is the last commit before Zones added the SA-1/IRQ improvements that costs you about 10-15fps - this is the one commit I skip - as does the Wii port.

https://github.com/snes9xgit/snes9x/commit/...d844291e234ad9a

It is possible to not apply this single patch ( https://github.com/snes9xgit/snes9x/commit/...8fbc3ddc25cc173 ) and still backport the patches after that - it requires a little manual labor but I think the extra speed is absolutely worth it.

BTW - with regards to NTSC filters and graphics filters - this is the one saving grace the PS3 has - we can rely on the GPU (RSX is like a SLI Geforce 7800) and run Cg shaders - we have ported over most of the popular filters to Cg (well, they were already ported to GLSL by guest earlier - we just took them and converted most of them to Cg shaders, along with some of our own additions) - so we can avoid the performance impact that running these filters imposes on the CPU..

The only 'filter' we have not yet ported to Cg in fact is Blargg's NTSC filter - this is BTW to my knowledge the most CPU-intensive filter there is, so yeah, there might be no hope getting that to run at 60fps with most games on Xbox 1.

Hmmm, Xbox 1 supports Pixel Shader 1.0x, right? Perhaps you can rely on that instead.

This post has been edited by Dante_Ali: Apr 24 2011, 07:48 PM
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #18 on: April 24, 2011, 01:38:00 PM »

Whoops.. sorry.. forgot to mention I took those SA1/IRQ changes out from the start.

Yeah sadly taking out the ASM cores does not help us xbox users.. (IMG:style_emoticons/default/sad.gif)   In addition typically making an emulator "more accurate" usually kills us as well.  (IMG:style_emoticons/default/laugh.gif)   (IMG:style_emoticons/default/jester.gif)

As for shaders.. yes the xbox does have them.. but I do not have a clue how to do them.  Anyway I could be pointed in the right direction?

This post has been edited by madmab: Apr 24 2011, 09:03 PM
Logged

Dante_Ali

  • Archived User
  • Full Member
  • *
  • Posts: 143
Snes9xbox V3 Possibly Up And Coming
« Reply #19 on: April 24, 2011, 06:43:00 PM »

Unfortunately, I was mostly an end-user during the Xbox scene days - I did get the XDK and I did dabble somewhat with it, but it wasn't really much to be honest.

Would probably be fun coding for it now - now that there's a tight knit community around it and that it's basically an x86.

I don't know how limited the shader capabilities are since we are talking about a very old Shader Model that the Xbox 1 supports - but you should be able to do some stuff with it at least. I don't really have any experience beyond NVidia Cg at the moment, sorry.

This post has been edited by Dante_Ali: Apr 25 2011, 01:43 AM
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #20 on: April 26, 2011, 01:42:00 AM »

ok just a small little update.  I spent most of the weekend working on 1.52 and getting the FX/C4 ASM cores going.  Took a little bit of work since they stop using them at one point so I had to modify the code a bit to get them to compile.  While doing this I realized I missed something in 1.53 so once I got 1.52 done and running fairly decent I went back over 1.53 and now they both seem to be running at comparable speeds.  So I'm not sure whether the ASM core is helping much.

I then spent time tweaking around with the sound to get it running more smoothly since there were the occasional glitches and hiccups.  So I got that taken care of.  Unless the framerate starts getting low, at which point the sound gets rather choppy.  I did break fast forward so I'm working on fixing that.  NTSC filters are still a wash.. (IMG:style_emoticons/default/sad.gif)  With a drop of up to 10fps that is gonna be a hard one to overcome.

Logged

XTecuterX73

  • Archived User
  • Sr. Member
  • *
  • Posts: 297
Snes9xbox V3 Possibly Up And Coming
« Reply #21 on: April 26, 2011, 10:32:00 AM »

QUOTE(madmab @ Apr 26 2011, 03:42 AM) *

ok just a small little update.  I spent most of the weekend working on 1.52 and getting the FX/C4 ASM cores going.  Took a little bit of work since they stop using them at one point so I had to modify the code a bit to get them to compile.  While doing this I realized I missed something in 1.53 so once I got 1.52 done and running fairly decent I went back over 1.53 and now they both seem to be running at comparable speeds.  So I'm not sure whether the ASM core is helping much.

I then spent time tweaking around with the sound to get it running more smoothly since there were the occasional glitches and hiccups.  So I got that taken care of.  Unless the framerate starts getting low, at which point the sound gets rather choppy.  I did break fast forward so I'm working on fixing that.  NTSC filters are still a wash.. (IMG:style_emoticons/default/sad.gif)  With a drop of up to 10fps that is gonna be a hard one to overcome.


very great news indeed madmab! so in other words everything is pretty good looking unless you use the ntsc filters correct? and rewind being broken? even with that, this all sounds great. the new sound core is spot on and pretty accurate and the fixes make alot of games now playable. seems like snes9x has become more accurate then even zsnesxbox it seems.

 (IMG:style_emoticons/default/pop.gif)
Logged

Consoleman!

  • Archived User
  • Full Member
  • *
  • Posts: 102
Snes9xbox V3 Possibly Up And Coming
« Reply #22 on: April 27, 2011, 04:32:00 AM »

QUOTE(madmab @ Apr 26 2011, 02:42 AM) *

ok just a small little update.  I spent most of the weekend working on 1.52 and getting the FX/C4 ASM cores going.  Took a little bit of work since they stop using them at one point so I had to modify the code a bit to get them to compile.  While doing this I realized I missed something in 1.53 so once I got 1.52 done and running fairly decent I went back over 1.53 and now they both seem to be running at comparable speeds.  So I'm not sure whether the ASM core is helping much.

I then spent time tweaking around with the sound to get it running more smoothly since there were the occasional glitches and hiccups.  So I got that taken care of.  Unless the framerate starts getting low, at which point the sound gets rather choppy.  I did break fast forward so I'm working on fixing that.  NTSC filters are still a wash.. (IMG:style_emoticons/default/sad.gif)  With a drop of up to 10fps that is gonna be a hard one to overcome.

Too bad about the ASM cores.  With exception to the NTSC filter, how's the speed with the other software filters on vs. leaving them off?
Logged

cheema201

  • Archived User
  • Jr. Member
  • *
  • Posts: 58
Snes9xbox V3 Possibly Up And Coming
« Reply #23 on: April 27, 2011, 12:43:00 PM »

Brilliant to hear about your work mad dog! And it's great that Squarepusher has given the xbox scene some lovin.

A600 is back, madmab is in full flight. Squarpusher is gonna join the party (maybe haha). Next Xport is gonna stop by to give you a hand madmab haha.

I have no requests, you seem to have it under control. Someone has already mentioned light gun support - which would certainly be welcome.

Keep up the good work mate. You're an inspiration.
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #24 on: February 02, 2020, 11:09:00 PM »

Well I've gotten reports from someone with a souped up xbox that the NTSC filters run great on his xbox with the higher clock speed.

Anyways I noticed that 1.51 runs quite a bit faster than 1.52-1.53.. so chances are the new and improved sound engine is where the slowdown is.  I'm gonna tinker with getting the old sound code working in 1.53 just for curiosity sakes.  If the speed improves maybe I can find some way to modify the code so the sound engine can be selectable.  For those who dont mind the poorer sound quality for speed improvements.
Logged

Dante_Ali

  • Archived User
  • Full Member
  • *
  • Posts: 143
Snes9xbox V3 Possibly Up And Coming
« Reply #25 on: February 03, 2020, 10:49:00 AM »

Could you put the source up here on this page so I could test this core on it that I have been running on PS3?

I think it could work out well - there are no real platform-specific things in there - it's just a big cleanup of the core code overall - some big branches that got taken out in the process that might help speed.

BTW - I tested SNES9Xbox v2 yesterday - there seems to be something wrong with the sound - it doesn't sound like blargg's APU core to me - which should be nearly flawless sound on any game. You can hear this clearly even in Super Mario World - the Mario jumping sound doesn't sound right. Again, I don't know what's up in this regard since there is no source for me to look at. I do know that SNES9x PS3 and SNES9x Wii, being pretty much based on 1.52, sound flawless compared to this. (even though the Wii version has some sound pops)

On another note - I think it's relatively safe at this point to start putting up Google Code projects with just the source on there for Xbox 1 - I've done the same for PS3 (knowing full well you need the official SDK to compile it) and nothing happened whatsoever - and this is with the whole shit storm with Sony at the moment where every dev is looking over his shoulder quivering in fear of big bad Sony. So, given that Xbox 1 is obsolete, I think there's no harm in doing this - might even lead to some collaborative effort going.

BTW - just booting Xbox 1 again yesterday reminded me of just how good this console was for homebrew/emulators. Holy shit - even Streets of Rage v5 is playable on this - this is definitely still the best console out there for homebrew stuff - forget PS3/360/Wii at the moment, looking at it from a raw speed perspective - there's really nothing to be jealous of other than nearly zero-cost shaders (which means you can run something like HQ2x or even better with no speed loss). No homebrew coder ever coded for the SPUs, so it's all just running on the PPU - which is notoriously weak - probably a bit better than the Xbox 1 CPU if you rewrite the code well enough, but that's it.

It just sucks that you have to go out of your way to install an ancient version of Visual Studio - and especially the source code conventions are really 'ugh' after being accustomed to proper ANSI C/C++98 for so long on PS3 - Visual C++ is like a big 'WTF is this' in that regard.

This post has been edited by Dante_Ali: Yesterday, 07:01 PM
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #26 on: February 03, 2020, 02:15:00 PM »

Xport made the source available some time ago...

Where's the source?

Snes9xbox v1 and v2 were based on Snes9x 1.42.. which goes a way back hence the reason for sound differences.  In fact the new APU was not implemented until 1.52.  1.51 runs on a comparable speed to 1.42 however it sounds the same.  Hence the conclusion concerning the sound.  Whether it's enough to gain a full 10fps needed to get some games running good is another story.
Logged

Dante_Ali

  • Archived User
  • Full Member
  • *
  • Posts: 143
Snes9xbox V3 Possibly Up And Coming
« Reply #27 on: February 03, 2020, 02:41:00 PM »

Oh, so SNES9xbox v2 doesn't even use 1.52, but rather uses 1.42?

That would explain a lot.

Alright. Guess I know where to go from here then. I'll try the modified core and see what I get.
Logged

madmab

  • Archived User
  • Hero Member
  • *
  • Posts: 1049
Snes9xbox V3 Possibly Up And Coming
« Reply #28 on: February 03, 2020, 05:49:00 PM »

Let me know how it works.. you can do a quick diff of x-ports vs the 1.42 code to get an idea of what he changed.  It was not much.. mostly commenting stuff out and then of course there was a bit of restructuring.. but it did not take long to navigate that (mostly moving around of screen/sound and SSettings).

X-port does all his rendering in CXboxsample::Render_To_Texture..  Sound code is in sndxbox.cxx and is called from snes9xbox.cpp.  I had to remove that call and replace it with the call back.. pointed the callback to the sound code ->process in sndxboxx.cxx.

That's just a quick summary..  Plenty of time.. I still have somethings I wanna do and I still have to take a looksey at mouse and lightgun stuff..  (IMG:style_emoticons/default/biggrin.gif)

For the misinformed..

It's the NTSC filters and NOT the scanline filters that eat up CPU time.. In fact Blarggh himself says they are rather intensive and the SNES9X guys as well..

QUOTE
"Running the filter at 60 frames per second uses 8% CPU on a 2.0 GHz Athlon PC and 40% CPU on a 400 MHz PowerMac G3, making it suitable for use on almost any system"

QUOTE
2.)
The NTSC filter is very cpu intensive, I don't think you can do very much about that (other than hoping that someone creates a shader that does the same).



This post has been edited by madmab: Today, 02:36 AM
Logged

XTecuterX73

  • Archived User
  • Sr. Member
  • *
  • Posts: 297
Snes9xbox V3 Possibly Up And Coming
« Reply #29 on: February 03, 2020, 08:20:00 PM »

so i guess for the time being a trusty xbox will play this with ntsc filters pretty full speed eh?
Logged
Pages: 1 [2] 3 4 5