Nesalizer WIP on github

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Nesalizer WIP on github
by on (#118713)
In case anyone's interested, I've put a WIP of the emulator I'm working on on GitHub: https://github.com/ulfalizer/nesalizer.

Currently Linux-only and lacks a GUI and save states, so not really worth using yet, but I might get some testing out of it at least if I'm lucky. :)
Re: Nesalizer WIP on github
by on (#118726)
It uses blargg's blip_buf by the way, and syncs audio to video by adjusting the pitch slightly to maintain a preset audio buffer fill level. The parameters for the latter are hardcoded at the moment, and the approach probably isn't optimal. Should try James' approach.
Re: Nesalizer WIP on github
by on (#118742)
ulfalizer wrote:
lacks save states, so not really worth using yet

Boo! Save states are for cheaters! :lol:
Re: Nesalizer WIP on github
by on (#121689)
Now supports rewinding, and also does a proper reversal of the audio as a gimmick.

Thanks to Blargg for helping me find a neat way to do this with blip_buf!

A demonstration is available on Youtube. It slaughters the video quality a bit, so I also put it on Dropbox. I picked a game where I was sure to die a lot. :P
Re: Nesalizer WIP on github
by on (#121691)
Good work! Playing Mega Man 2. My main box here is Windows so I had to do a little hacking around in the code, especially the timing code since there is no clock_nanosleep or timespec in Win32... but all seems good.

Image
Re: Nesalizer WIP on github
by on (#121693)
miker00lz wrote:
Good work! Playing Mega Man 2. My main box here is Windows so I had to do a little hacking around in the code, especially the timing code since there is no clock_nanosleep or timespec in Win32... but all seems good.


Thanks, and cool that you took the time to port it :beer:! I suspected there wouldn't be much platform-specific stuff in there besides the timing code.

Sound stable? Rewind working?
Re: Nesalizer WIP on github
by on (#121694)
What environment did you use by the way? Cygwin? If you have a patch ready I could add it along with some instructions in the README for a Windows build. :)
Re: Nesalizer WIP on github
by on (#121695)
How do I use the rewind function? Sound seems very stable so far, yeah.

I used MinGW. I'll provide a patch tomorrow some time. I just used SDL timing stuff as a quick crutch to get it working, but the proper way to do it for better accuracy would be to use the Windows performance counter, so I should change that first!
Re: Nesalizer WIP on github
by on (#121696)
miker00lz wrote:
How do I use the rewind function? Sound seems very stable so far, yeah.


Hold R.

miker00lz wrote:
I used MinGW. I'll provide a patch tomorrow some time. I just used SDL timing stuff as a quick crutch to get it working, but the proper way to do it for better accuracy would be to use the Windows performance counter, so I should change that first!


Thanks!

Did you use MSYS? The Makefile isn't exactly friendly to cmd.exe. :P

Last I looked into the SDL timing functions the resolution seemed very poor, so it's interesting that you managed to get it working decently at least.
Re: Nesalizer WIP on github
by on (#121697)
Yep, MSYS. :)

SDL timing res is pretty poor you're right, there is an occasional slight pause in the gameplay because of it but for the most part it works smoothly.

Rewind works perfectly! Nice.
Re: Nesalizer WIP on github
by on (#121698)
Good to hear!
Re: Nesalizer WIP on github
by on (#122089)
Now has PAL support. High Hopes and Quantum Disco Brothers run fine.

Should get around to adding a GUI soon to make it a bit more usable... :P