1 2
10 11 12 13
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Any ideas or suggestions are certainly welcome. It's also worth noting that at some point I need to basically turn the entire frame advance loop inside out so it can run at single ppu ticks and be debugger friendly. Maybe I should do that first before delving too deep into optimizing the current set up as it will likely change considerably.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
I just finished making NEShawk run in single PPU ticks. This should allow for future improvements such as debugger support. That won't be happening any time soon, but it needed to be done at some point so I wanted to get it done before going more in depth into optimization. The change only had a small negative impact on general game play performance, which I found surprising. What wasn't surprising though is the negative impact on TAStudio performance, since I had to increase the state size considerably. But I guess if you're running TAStudio you don't need to be running that fast anyway. I'll be stress testing the changes over the next couple days to make sure everything still funcitons correctly and see if any new optimizations are possible. All test ROMs still pass and my standard Battletoads run still syncs, so in terms of accuracy at least everything seems fine. Over time I want to make every in house core work this way, and this case was relatively painless so I might work on that sooner rather then later.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Alyosha, I downloaded the latest BizHawk developer build to test the new Z80 stuff, then went ahead and also tested NEShawk's new performance. I chose 3 basic games for it, then compared with BizHawk 2.2's performance. This is what I got: SMB: 63 fps (Dev Build) | 105 fps (2.2) Rockman 2: 60 fps | 97 fps Kirby's Adventure: 58 fps | 93 fps (CPU: Intel Core i5 3330 @ 3.00 GHz) Is this huge performance hit because now NEShawk runs in single PPU ticks?
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
That shouldn’t be the case, last time I checked the performance hit was minimal, I’ll look into it.
Editor
Joined: 3/31/2010
Posts: 1466
Location: Not playing Puyo Tetris
Sonia wrote:
Alyosha, I downloaded the latest BizHawk developer build to test the new Z80 stuff, then went ahead and also tested NEShawk's new performance. I chose 3 basic games for it, then compared with BizHawk 2.2's performance. This is what I got: SMB: 63 fps (Dev Build) | 105 fps (2.2) Rockman 2: 60 fps | 97 fps Kirby's Adventure: 58 fps | 93 fps (CPU: Intel Core i5 3330 @ 3.00 GHz) Is this huge performance hit because now NEShawk runs in single PPU ticks?
If you run BizHawk as a Developer build, then the internal cores will be slower/laggy.
When TAS does Quake 1, SDA will declare war. The Prince doth arrive he doth please.
Joined: 6/29/2016
Posts: 53
Completely unrelated, but just in case you didn't see this thread already: http://forums.nesdev.com/viewtopic.php?f=3&t=16507 It's a FDS test rom that validates the IRQ's behavior - Bizhawk currently fails a number of the tests (which causes Kaettekita Mario Bros to crash). Should be pretty simple to fix though.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
@Sonia: I tested build 0.0.0.1830 and the performance matches my local build , which is about 5% slower then 2.2. For comparison SMB runs at ~135 FPS on 2.2 and ~130 on dev build. So, I'm not entirely sure why your performance has suffered that much. Does it affect any other cores or only NESHawk? Did you compile it on your own or did you use the appveyor download? @Sour: Ah, thanks for reminding me about that, I was following along when you all were first writing the tests, but then I got distracted by Z80 stuff and totally forgot. I'll try to work through that eventually.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Alyosha wrote:
@Sonia: I tested build 0.0.0.1830 and the performance matches my local build , which is about 5% slower then 2.2. For comparison SMB runs at ~135 FPS on 2.2 and ~130 on dev build. So, I'm not entirely sure why your performance has suffered that much. Does it affect any other cores or only NESHawk? Did you compile it on your own or did you use the appveyor download?
Sorry for not replying to this sooner, but no, I didn't compile it myself. All I did was grabbing the emulator from [URL=https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/artifacts]this link[/URL], then extracted to a folder and ran it as it is. I tested the following cores: NES (both QuickNES and NESHawk), SMS, PCE, MD, SNES (Snes9x and BSNES), GB and GBA (mGBA and VBA-Next). Only NESHawk is slow.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
I can't reproduce this so I'm not really sure. If you can zip up the folder you are using exactly as it is and get me a link to it, then maybe I will be able to see what the problem is if it also occurs on my end.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Alyosha wrote:
I can't reproduce this so I'm not really sure. If you can zip up the folder you are using exactly as it is and get me a link to it, then maybe I will be able to see what the problem is if it also occurs on my end.
Sure, here it is: https://www.dropbox.com/s/f239n2x2p0oj0xg/BizHawk_Developer-2017-10-21.rar?dl=0 While we're at it, I'd like to mention a related, somewhat bothersome issue. Basically, the FCEUX.pal is off. Here is how it looks like: As you can see, palette #23 is incorrect. That's because BizHawk uses the FCEUX.pal from version 2.1.0. As of version 2.2.0, they fixed it, which looks like this: Could you please update it to the correct one? Because every time a new BizHawk version comes out, I have to do it myself. I stuffed the correct file in the linked .rar, which I named "FCEUX (2.2.0).pal". It's in the same folder as the other NES palettes.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Sonia wrote:
Could you please update it to the correct one?
Done. I tested your build, and did not notice any slow down. Try disabling rewind and see if that helps. Also check CPU and memory usage and make sure they aren't off the charts, although I did that on my end and nothing seems amiss. Also what OS are you using? I'm not sure what other variables might be at play here. Can you try a Dev Build from right before I made all the changes and see if it works fine there?
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Sour wrote:
Completely unrelated, but just in case you didn't see this thread already: http://forums.nesdev.com/viewtopic.php?f=3&t=16507 It's a FDS test rom that validates the IRQ's behavior - Bizhawk currently fails a number of the tests (which causes Kaettekita Mario Bros to crash). Should be pretty simple to fix though.
Fixed. Although Kattekita Mario Bros wasn't crashing for me previously, where was it crashing for you? Maybe I have a different version? Also thanks for the valuable R&D on this Sour!
Joined: 6/29/2016
Posts: 53
Alyosha wrote:
Although Kattekita Mario Bros wasn't crashing for me previously, where was it crashing for you? Maybe I have a different version? Also thanks for the valuable R&D on this Sour!
After the 1/2 player select screen, a scene plays out before the game asks you to switch to side B. There are 3 different scenes, the game selects one of these randomly. As far as I can tell, Bizhawk used to play 1 of the 3 scenes correctly (which seems to be the scene that occurs the most frequently from the times I've tested this), the other 2 cause a black screen. (at least, this is the case on Bizhawk 1.13) In other emulators, the other 2 scenes worked, but the "switch to side B" screen was corrupted. No problem! Someone reported an issue with Putt Putt Golf to me, which I ended up tracking down to being caused by the hack I was using for Kaettekita, so I figured I'd stop trying to fix with guesses and test the hardware's actual behavior instead :p
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Ah ok, yeah I just happened to be hitting the one screen that wasn't crashing. I do see now that in previous builds the other ones were crashing while in the current build they work fine. Nice.
Joined: 5/4/2016
Posts: 67
Alyosha wrote:
I tested your build, and did not notice any slow down. Try disabling rewind and see if that helps. Also check CPU and memory usage and make sure they aren't off the charts, although I did that on my end and nothing seems amiss. Also what OS are you using? I'm not sure what other variables might be at play here. Can you try a Dev Build from right before I made all the changes and see if it works fine there?
This may or may not be related, hard to know for sure, but a few months back one user of the Real Time Corrupter mod was having trouble with FDS running about 40% slower than normal in a single build of the mod. We hadn't touched emulation code, they had no issues in the previous build, and no issues in the next build. It was just that one build that had massive performance issues with NESHawk in FDS mode for them and only them. The only code changed between builds was some stuff in the forms for the mod. No actual changes to the stock code were made. I also had them run the mod with all RTC related code disabled (there's a launch switch which stops the loading of any RTC code) and it still occurred. I can't verify if it happened in NES mode as I never asked him to check, but it could be a similar issue? The mod was based on 1.11.9 at the time. He was running the Windows 10 Anniversary Update at the time with an Intel Core i5-6400T Here are some screenshots he provided of CPU usage when the issue was occurring. The previous build The problematic build I also had him check with process explorer and it was the main thread eating up all the CPU. Previous Build: Problematic Build If you want, I can check with him to see if that old build still causes issues on his machine and if does, I can have him run the build that's causing Sonia trouble to see if it occurs. Might help track the issue down?
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
smellyfeetyouhave wrote:
If you want, I can check with him to see if that old build still causes issues on his machine and if does, I can have him run the build that's causing Sonia trouble to see if it occurs. Might help track the issue down?
Yes please do, that would be helpful. Hopefully it can provide some lead.
Joined: 5/4/2016
Posts: 67
He tested that build posted here and had no issues. I also had him go back and test that old build of the mod that caused problems and he said it also no longer has issues. He said he hasn't touched his hardware configuration at all so that's not a super helpful situation. I can dig up a download for that old build if you want for Sonia to test and see if the issue occurs.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Hmm, strange stuff. Maybe it's something like anti-virus or drivers, but I can't think of a reason why only NESHawk would be affected. Thanks for trying though.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Alyosha wrote:
Done.
Thank you.
Alyosha wrote:
I tested your build, and did not notice any slow down. Try disabling rewind and see if that helps. Also check CPU and memory usage and make sure they aren't off the charts, although I did that on my end and nothing seems amiss.
Disabled rewind, slowdown still persists. CPU Usage says 25% while the core is running.
Alyosha wrote:
Also what OS are you using?
Windows 7 Ultimate 64-bit SP1.
Alyosha wrote:
I'm not sure what other variables might be at play here. Can you try a Dev Build from right before I made all the changes and see if it works fine there?
Can you give me a link? I only see the latest build in that appveyor page.
Joined: 5/4/2016
Posts: 67
Sonia wrote:
Can you give me a link? I only see the latest build in that appveyor page.
Here's a link to the build right before that change: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/0.0.0.1790/artifacts Here's a link to the build where the PPU change was implemented: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/0.0.0.1791/artifacts I would also double check the latest dev build and see if it occurs on that. If it's anything like the problem the user I dealt with had, the issue was build-specific.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Thanks, I just tested things. Game of choice was SMB. Here are the results: Before single PPU tick: 110fps After single PPU tick: 68fps Latest build: 63fps Seems like I'm unlucky and things are getting slower on my end instead of faster. Maybe my drivers just don't like the new code... Here is my computer's general info:
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
So it seems certain that the PPU changes are the culprit here, but I looked over the code again and there just really isn't anything that would slow it down so much. (It's just a mess of 'if' 'switch' and 'for' loops really.) From a compiler / different OS perspective (I do all my testing on Windows 10) the biggest change I made was taking FrameAdvance out of 'unsafe' mode since it was no longer relevent. I suppose there is a chance this could have a real impact on performance for your machine, but I wouldn't know anything about why. In looking over things again I also had a spurious 'unsafe' array I just removed, but I doubt that has any impact. So far the only thing I can see that sticks out is that you are using windows 7. If anyone else with Windows 7 is reading this, can you please try NESHawk and see if you are having any similar slowdowns?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
My results: https://imgur.com/a/7vpxE 64-bit Windows 7 Ultimate, Service Pack 1
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
creaothceann wrote:
My results: https://imgur.com/a/7vpxE 64-bit Windows 7 Ultimate, Service Pack 1
Thanks for the testing, that is consistent with what I would expect. Sorry Sonia but it looks like you just got unlucky :( I'll try to find some general optimizations that will at least get you back up to 1x speed in games like Kirby. A NES emulator not being able to hit 1x, even under abnormal conditions, just seems silly, there must be something I can do to get some better performance.
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
Alyosha wrote:
Sorry Sonia but it looks like you just got unlucky :( I'll try to find some general optimizations that will at least get you back up to 1x speed in games like Kirby. A NES emulator not being able to hit 1x, even under abnormal conditions, just seems silly, there must be something I can do to get some better performance.
No need to worry, I might change computers soon enough. My plan is to buy a laptop with a i7-7700HQ 2.8GHz processor (3.8GHz with turbo boost), which should run NEShawk at the correct speed.
1 2
10 11 12 13