Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
I have started work on a derivative of NESHawk ported to C++. Current repo is here: https://github.com/alyosha-tas/NESHawkplusplus The motivation here is that NESHawk is super painfully slow. It's way too slow to do serious bot work with. QuickNES is 20-30x faster. But, NESHawk is very highly accurate, unlike QuickNES. Also, NESHawk can be run at the precision of one PPU tick. This provides easy access to subframe resets and inputs. So I thought I would try to port the NESHawk core to C++, cut out the fluff, maybe do some optimizations, and see how fast it could run. So far porting the core is been relatively pain free. I'm about 30% done. I'm hoping to have the porting done in a week and see if I didn't break anything. The goal here is to have a framework for a build-it-yourself emulator that won't limit the user in any particular way. Anything you can do with C++ you can wrap around NESHawk++. You will have full access to the core state, and can increment it with a single function call. And since it will be the exact same core as running on BizHawk, you can create BK2 files of your work that will still sync on actual BizHawk. Also, this won't be an actual emulator in the usual sense. There won't be any controller support, mapper support (maybe some common mapper examples), gui, user settings, or similar extras. It will basically be a virtual NES (cpu, ppu, apu) that users will have to develop their own tools for. That's basically it. If anyone is interested in helping with this or has a project in mind they think this would be helpful for, feel free to contribute or let me know.
Dimon12321
He/Him
Editor, Reviewer, Experienced player (597)
Joined: 4/5/2014
Posts: 1227
Location: Romania
Hah... I thought the weakest link was the emulator itself, not operated cores because every core I use has almost the same internal limitations (turbo mode makes a game run just barely above 60 fps while Gens and FCEUX are lightings comparing to Biz). Good luck, man. Nothing encouraging else to say. Oh-- Let the knowledge be with you! That's it.
TASing is like making a film: only the best takes are shown in the final movie.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Haha, yeah baby! It should have happened sooner or later. 10 years ago writing a core in C# maybe looked like a grownup approach, but over the years it's been getting more and more accurate, slower and slower, and at this point it's obvious that if we can't emulate 6502 or Z80 based systems at full speed, we're doing something wrong. It also means there's no way younger consoles will ever run at usable speeds if the same approach is taken. Though I don't think anyone will be using it for further development, as opposed to just running movies on it. There are tons of NES emulators now, and it's kinda getting old. Even bizarre accuracy isn't that novel anymore. So I don't know if this is eventually adopted by hawk again, but this undertaking is obviously something worthy.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3575)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
I'll be interested to see what kind of speed differences you end up with.
It's hard to look this good. My TAS projects
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
feos wrote:
Haha, yeah baby! It should have happened sooner or later. 10 years ago writing a core in C# maybe looked like a grownup approach, but over the years it's been getting more and more accurate, slower and slower, and at this point it's obvious that if we can't emulate 6502 or Z80 based systems at full speed, we're doing something wrong. It also means there's no way younger consoles will ever run at usable speeds if the same approach is taken. Though I don't think anyone will be using it for further development, as opposed to just running movies on it. There are tons of NES emulators now, and it's kinda getting old. Even bizarre accuracy isn't that novel anymore. So I don't know if this is eventually adopted by hawk again, but this undertaking is obviously something worthy.
Indeed, C# just isn't suited for this type of thing. It's kind of a shame too, since we're at a cross roads where making new in house cores in C# is not even practical except for the few remaining 8 bit systems and old computers. But on the other hand our ability to interact with ported cores is usually difficult and limited. It's also unfortunate that so many NES emulators have code bases that are quite difficult to work with. Wouldn't it be great to be able to drop the NESHawk core into the FCEUX frontend and suddenly have a fast, complete, and accurate NES TASing emulator? I think so, but I don't dare to even try.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
I don't think there's such a thing as "fceux frontend" at all, it's just a HUGE pile of all sorts of spaghettis of infinite length that were being intermixed by a ton of people for a ton of years. It's what bizhawk would look like if it was 60 years old.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3575)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
Let's not rule out C# until we see how these cores run in .net core
It's hard to look this good. My TAS projects
MESHUGGAH
Other
Skilled player (1919)
Joined: 11/14/2009
Posts: 1353
Location: 𝔐𝔞𝔤𝑦𝔞𝔯
Any notes on how to get running? Want to check how much FPS I have with this on different computers. Only tried to download the NesHawkPlusPlus.exe and the 3 dlls he wants to load, which results in a simple window named "Game Loop".
PhD in TASing 🎓 speedrun enthusiast ❤🚷🔥 white hat hacker ▓ black box tester ░ censorships and rules...
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
It’s currently non-functional. So far I have the ppu cou and apu converted to C++ and have removed the reflection that proved pretty annoying. But I haven’t stitched them together yet.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11495
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
How is it going so far?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3827)
Joined: 11/30/2014
Posts: 2834
Location: US
It's dead. I lost interest and motivation. I don't have the patience to do all the interface stuff.