• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Cycle accurate emulators

Sophia

Member
I do wish people were more open to at least trying new things first.

....

Do you play your audio CDs inside ZIP archives, and think it's crazy that people might want to put each separate song into a folder? Do you store an entire photo album into a single file with no directory structure? Do you build computer programs from ZIP files full of source code, or do you extract the source first? So why is it okay for video game images to do this? Because you're used to it. Nothing more, nothing less.

Would you at least do everyone a favor and add an option to pick the location of where ROMs are stored? I don't know about you, but I personally don't know many people who store their music in "C:/Users/Sophia/AppData/Roaming/". Likewise, I've never seen a music management program so pretentious that it can't even offer a quick GUI solution to where songs are stored.

I don't disagree with the concept byuu. I just disagree with the silly way you go about applying said concept.
 

Aeana

Member
Yeah I forgot to mention BlueMSX earlier, because I forgot it's a cycle-accurate emulator. I've probably used it more than any other emulator, too. It's super impressive.
 

Shaneus

Member
Hey maniac-kun.

Consider adding these to your OP.

for NES - Nintendulator: http://en.wikipedia.org/wiki/Nintendulator

for Genesis - RetroCopy

for Sega CD, 32X, and Genesis - Kega Fusion

for TurboGrafix 16 (PC Engine): Ootake

and seriously, add this one:
for MSX computers - BlueMSX
From what I understand, RetroCopy isn't cycle-accurate. If it was, it wouldn't say "Nearly 100% of the games released for the Sega Mega Drive work exactly like they should when using RetroCopy" (I guess), and I don't think Kega Fusion is either. Pretty sure the closest is Exodus.
 

byuu

Member
> If I could get mine running that well I'd be ecstatic. Any tips on getting it to run that well?
> Also, it seems that synchronizing video doesn't seem to work on a 120Hz monitor

It works best on Windows XP. If on Vista or 7, turn off DWM / Aero Glass (I realize that's extreme, but Microsoft's implementation of compositing interacts poorly with windowed mode Vsync; I'd have to make the emulator Vista+ only to interact with DWM.) If on Windows 8, try upgrading to an earlier version.

And sorry, I have no support at all for 100hz / 120hz monitors. I'd love to have one, but all of mine only do 60hz, so I have nothing to test with. If I ever get one, I'll support it by doubling each frame output.

> I wonder how well higan would run on a 1.7 Ghz Haswell Core i3?

The 64-bit performance binary should work okay, but I wouldn't really recommend it. Might be cutting it close, especially with the sinc audio filter, pixel shaders, SuperFX games, etc.

> Would love to see a scan line filter that properly replicates how scan lines work, mind.

We need 200dpi+ monitors. The closest thing now is two solid to one black line, but that requires scaling video by exactly 3x. This gets us to a 66% kell factor, whereas CRTs have a ~70% kell factor. The usual "insert one black line" doesn't work, because it doesn't account for bleed. The other usual "darken the second line" has similar flaws.

There's no great way to simulate the phosphor bleed and aperture masks of CRTs at 100dpi.

> Nemesis is REALLY switched on, too

Yeah, I miss those days. I've pretty much done everything that will ever be noticeable with the SNES (no known bugs and all), so it's been a long while since I've gotten to do one of those types of threads.

These days all my efforts are in buying up Japanese games to dump and scan. Not nearly as interesting.

No real interest in repeating an eight-year journey on another system. Getting too old for that.

> Would you at least do everyone a favor and add an option to pick the location of where ROMs are stored?

I did. v092 came out a bit quickly, and I didn't have time to add it.

If you try v092.10 that I just posted on my webpage, you can choose where to store the game folders under Settings->Configuration->Advanced->Library.

> program so pretentious that it can't even offer a quick GUI solution

Apathy, not pretentiousness. Never attribute to malice :p

Also, I'm primarily a Linux user. For me, the games go to /home/byuu/Emulation. Not my fault Microsoft makes the roaming folder location so braindead retarded.

> I don't disagree with the concept byuu

Ah, okay. I am trying to get legitimate constructive feedback. There may be things I can improve about the idea.

> From what I understand, RetroCopy isn't cycle-accurate.

Can you even trust a closed source emulator that says it is?
Not aware of many extreme emulator stress test images for the Genesis.

> If it was, it wouldn't say "Nearly 100% of the games released for the Sega Mega Drive work exactly like they should when using RetroCopy"

Well, cycle-accurate means that we synchronize processors between cycles rather than between opcodes.

My NES emulator is cycle accurate, and has lower compatibility than RockNES and FCE Ultra, because it supports less mappers and has more bugs / missing quirks.

It's quite possible, though unusual, for an emulator to be simultaneously much more accurate, and much less compatible.
 
It works best on Windows XP. If on Vista or 7, turn off DWM / Aero Glass (I realize that's extreme, but Microsoft's implementation of compositing interacts poorly with windowed mode Vsync; I'd have to make the emulator Vista+ only to interact with DWM.) If on Windows 8, try upgrading to an earlier version.

Well....to say something slightly heretical, any plans to drop XP support? 7 & 8 are pretty good now, at least for what I use them for( and as long as I use classic shell on 8), and XP is getting to 11-12 years old now. I actually surprised myself to even think this, just four years ago I was only running XP based machines.

Also, I appreciate you taking the time to answer our questions here.
 

Sophia

Member
I did. v092 came out a bit quickly, and I didn't have time to add it.

If you try v092.10 that I just posted on my webpage, you can choose where to store the game folders under Settings->Configuration->Advanced->Library.

Well... that's not what I expected, and hallelujah your emulator is actually usable now! Thank you, and good job! <3

Also, I'm primarily a Linux user. For me, the games go to /home/byuu/Emulation. Not my fault Microsoft makes the roaming folder location so braindead retarded.

Yeah that's a really inane place to put anything. Kinda makes me cringe whenever apps store stuff there that I'd like to be easily accessible.
 
I would just like to thank you for all of your hard work, byuu, as well as for taking the time to write these informative posts on NeoGAF. bSnes is the only SNES emulator I'll use on hardware that can run it properly.

I also just found out about RetroArch for PC being completely amazing via this thread, even though I'd been using it on my Android for quite a while. Can't seem to get Mednafen-PSX games to boot though, even though I'm pretty sure I've got the bios setup properly. Everything else I've tried (PCE, SNES) works great. What gives?
 

Awakened

Member
I also just found out about RetroArch for PC being completely amazing via this thread, even though I'd been using it on my Android for quite a while. Can't seem to get Mednafen-PSX games to boot though, even though I'm pretty sure I've got the bios setup properly. Everything else I've tried (PCE, SNES) works great. What gives?
The command window should tell you if you are missing a BIOS file. You can generally use any US BIOS and just rename it, then make a copy and name it what it asks for the Japanese BIOS and they will work for US and J games. BIN/CUE is the preferred ISO format and you can make .m3u text files with each discs .cue filename in it to load multi disc games for easy disc switching on the fly. Doing that also makes it so multi disc games use the same memory card files so you don't have to rename them when you get to the next disc.
 

byuu

Member
Appreciate all the kind words, thanks.

> Well....to say something slightly heretical, any plans to drop XP support?

I still use it myself. But I'd certainly like to drop XP, as well as 32-bit binaries. It's a lot of extra work each release, and prevents me from profile-optimizing the binaries to make them ~10% faster.

Right now about 33% of downloaders use 32-bit systems. Don't have exact metrics on OS versions, but about 30% of site visitors use XP.

> Yeah that's a really inane place to put anything. Kinda makes me cringe whenever apps store stuff there that I'd like to be easily accessible.

I agree but, there's really no other place that's guaranteed to exist and be read-writeable by the current user.
Low privileges will disallow writing to the Program Files folder, C:\ may simply not exist at all, etc.
I think I did update it to drop files into C:\Users\username\Emulation, even though that's technically in violation of the rules, and a user may already have such a folder.

If you want some real fun, try adding Chinese, Japanese or Korean characters to your Windows username. Like someone from those areas might. About 80% of programs that write there only work with 8-bit ANSI/locale strings, and so they get back ??? instead of the actual path. Last time I tested ... this causes Winamp to infinitely loop on the initial setup screen, Firefox to crash horribly, etc. Your entire app has to use the 16-bit wide-char Unicode APIs pervasively to avoid this, and very few apps do. And this is all because Microsoft is too stubborn to admit that UTF-8 beat their UCS-2 format.
 

Shaneus

Member
> From what I understand, RetroCopy isn't cycle-accurate.

Can you even trust a closed source emulator that says it is?
Not aware of many extreme emulator stress test images for the Genesis.

> If it was, it wouldn't say "Nearly 100% of the games released for the Sega Mega Drive work exactly like they should when using RetroCopy"

Well, cycle-accurate means that we synchronize processors between cycles rather than between opcodes.

My NES emulator is cycle accurate, and has lower compatibility than RockNES and FCE Ultra, because it supports less mappers and has more bugs / missing quirks.

It's quite possible, though unusual, for an emulator to be simultaneously much more accurate, and much less compatible.
No worries, thanks for clearing both of those points up! Told you I was pretty green on this sort of thing ;)
 

Ms. Tea

Member
I meant to ask, byuu - can the current higan/bsnes be built for OS X? I tried building the current release for X/GTK using GCC 4.8, but it seemed to assume if I was building for X then ALSA would be available and the build died. The higan site mentions it works on OS X 10.7+.
 

byuu

Member
> I meant to ask, byuu - can the current higan/bsnes be built for OS X? I tried building the current release for X/GTK using GCC 4.8, but it seemed to assume if I was building for X then ALSA would be available and the build died. The higan site mentions it works on OS X 10.7+.

Yes, sir. But you have to use Clang from Xcode 4.6.1+, since GCC 4.8 doesn't support Objective-C 2.0 and Apple's Cocoa headers very well.

Here's a screenshot of what you can expect: http://i.imgur.com/PWWsStP.jpg

Pretty clear it's made with a portable toolkit, but it's fully functional and everything.

A bit more integrated than your average Qt app at least (fully native global menubar, program stays in the background and is stopped via the dock, etc.)
 
Just curious, how exactly does your frequency synch work?

I just built a new pc (win8x64/A10-6800k), and let it run video synch for a few hours, and it went from 59.91200 or somesuch and slowly moved upwards towards 60. I was of a mind that it would alternate between a low and a high and slowly come to a figure in between with a large fractional number(like alternate between 56.67 and 59.9 and end up at something like 58.122844734), but it hardly ever got lower again, just kept increasing - I think when I stopped it it had climbed to 59.99800. Is this one of the side effects of WDM, or is it doing what it should be?
 

Ms. Tea

Member
> I meant to ask, byuu - can the current higan/bsnes be built for OS X? I tried building the current release for X/GTK using GCC 4.8, but it seemed to assume if I was building for X then ALSA would be available and the build died. The higan site mentions it works on OS X 10.7+.

Yes, sir.

Not a sir. ;)

But you have to use Clang from Xcode 4.6.1+, since GCC 4.8 doesn't support Objective-C 2.0 and Apple's Cocoa headers very well.

Thanks! What's the makefile target to use? I'd taken a glance at it and only seen the x and Windows targets, neither of which are appropriate here.

Does it depend on Cocoa stuff from 10.7+, or would it be buildable on older OS Xs with a backported clang?
 

byuu

Member
> Just curious, how exactly does your frequency synch work?

It takes the current system time when you first start the test. Then it keeps blitting frames with Vsync on, keeping a total count of how many frames have been rendered. Every time the system time changes (it's rounded to the nearest second), it updates the frequency value to # of frames drawn / # of seconds passed. So at first, the value is way off. The longer it runs, the less rounding errors you see. For every order of magnitude longer you run it, you get an extra digit of precision. (Note that it's a cross-platform app, so I can't use something like QueryPerformanceCounter to start with more precise values right away.)

Same deal for audio. There's unfortunately no other way to do it. Cards don't report exact timing information.

Once you have both values, it can determine the resample ratio. It very very slightly adjusts the audio ratio/pitch by ~1% or so, to try and make it to where the SNES video frames to audio samples ratio is as close to equivalent as possible to your PC video refresh to audio rate.

> Is this one of the side effects of WDM, or is it doing what it should be?

Hard to say why you're seeing what you do, I can only describe what I'm doing on my end. Mine bobs up and down as it runs.

> Not a sir. ;)

Blast, should have looked at the username =)

> Thanks! What's the makefile target to use?

First, you need to get the version on my homepage. It's not in v092 official.

byuu.org/files/higan_v092r10.7z

Install Xcode 4.6.1+, and also install the command-line tools package.

Now run any of these three commands:

make clean && make -j 4 profile=accuracy
make clean && make -j 4 profile=balanced
make clean && make -j 4 profile=performance

I'd probably go with the balanced profile, unless you're a developer.

> Does it depend on Cocoa stuff from 10.7+, or would it be buildable on older OS Xs with a backported clang?

Mostly, Xcode 4.6 requires 10.7.4+ to install.

But I also use the OS X Lion API for fullscreen mode, so you'd have to make changes to run it on Snow Leopard.
 

butanebob

Neo Member
Any Xebra experts around?

Having an issue on my laptop where if i select View>Fullscreen> the only resolutions listed are 4:3. Whereas the same build of Xebra running on my PC shows both 4:3 and 16:9 resolutions. :\

*Edit* Worked it out - it's something to do with the hdmi cable or TV. When i unplug the cable and use xebra on the laptop monitor it runs fine. Go figure.
 
Some significant progress updates on the N64 Emulation front:

https://www.youtube.com/watch?v=-IWrbxAPu0A

https://www.youtube.com/watch?v=9BR9JLGEzDI

In the not so distant future we will have a near perfect N64 emulator on PC :D No fumbling around with plugins and stuff. It just works.

http://www.cen64.com/

Compiled version of the Emulator:
http://www.emucr.com/search/label/Cen64?&max-results=12

UI:
https://github.com/dh4/cen64-qt/releases

Needs the MAME N64 bios package to function.


Is this still in development?

PS: Sorry for the necro bump.
 

lazygecko

Member
I've always felt that Game Boy and Game Boy Advance emulation is exponentially more stuttery than emulators for other systems. It's especially noticeable in the audio and has always left a bad taste in my mouth.

Is this the reason why, and why is this problem so much more prominent on those systems?
 
I believe they mis-credited Gambatte.

Gambatte uses bgb's core - bgb should be the emulator listed, as it is also more accurate.

@Lazygecko - audio chip emulation is hard. BGB handles it the best, but as far as GBA goes there's nothing really out there that handles it nicely.
 

GamerJM

Banned
I've always felt that Game Boy and Game Boy Advance emulation is exponentially more stuttery than emulators for other systems. It's especially noticeable in the audio and has always left a bad taste in my mouth.

Is this the reason why, and why is this problem so much more prominent on those systems?

Are you using Higan?
 

GamerJM

Banned
I haven't used any GB or GBA emulator in forever. But when I watch emulated footage on Youtube and whatnot I still notice those stutters.

Most YouTubers probably aren't using cycle accurate emulators due to the prevalence of older less accurate GBA emulators like No$GBA and VisualBoyAdvance because they've been around for so long.
 

itxaka

Defeatist
I'm wondering if the NT mini hardware approach to emulating the hardware could be useful for software emulators.

I mean, someone programmed a FPGA to behave exactly like the new, so it should be possible to transform that into pure software no?
 

Borman

Member
Most YouTubers probably aren't using cycle accurate emulators due to the prevalence of older less accurate GBA emulators like No$GBA and VisualBoyAdvance because they've been around for so long.

The different Gameboys also have odd refresh rates, and with the GBA, the sound just isn't all that great anyway.
 

Theonik

Member
I'm wondering if the NT mini hardware approach to emulating the hardware could be useful for software emulators.

I mean, someone programmed a FPGA to behave exactly like the new, so it should be possible to transform that into pure software no?
The issue is it would be too slow. Actually that's the whole benefit of FPGAs. What's hard to do in software is that to emulate a single cycle of say a SNES you need multiple cycles on the emulator. Moreover, the second concern is that while in real hardware things happen somewhat asynchronously the emulator can only do one thing at once. You would be decoding an instruction at the same time as executing the one that came before it for example. And so, a software emulator must strike the balance of accuracy vs performance.
 
Top Bottom