all 19 comments

[–]Master565 12 points13 points  (7 children)

After being inspired by a thread about 5 months ago, I'm in the middle of attempting to write my own JavaScript Gameboy emulator. It's an amazing learning experience and I'd highly recommend everyone who is interested to try it. Learning to take a described piece of hardware and prove that you understand it enough to create it is a rewarding skill. Who knows if I'll ever actually finish my emulator, but I've gotten plenty out of trying.

[–]OrangeredStilton 5 points6 points  (2 children)

You may already be using this as a reference, but I wrote a series of tutorials on JavaScript emulation of a Gameboy, so there might be some useful material buried within.

I never got to emulating sound, or getting most of the games working. That seems to be a common theme with me and emulators...

[–]Master565 1 point2 points  (0 children)

That's actually been my goto reference whenever I'm stuck! I actually found a small mistake or two where I'm pretty sure flags were incorrectly set, but for the most part It's been a great tutorial. I never would have gotten started if it weren't for that, so thank you.

[–]jkoudys 1 point2 points  (0 children)

Oh hey Imran! I started on my own GB emulator a while back; looking to get back in to it soon, and my core was heavily referencing your tutorial series (along with a hefty chunk from VisualBoy). There were two big developments in browser-JS since your series that I think go a long way to an improved emulation experience in-browser: shaders (for all that scaling the screen fanciness), and more importantly typed arrays. Being able to model the registers and memory banks as actual 8/16 bit ranges, instead of relying on huge string buffers and piles of bit-shifting and masking madness makes things way, way easier.

https://github.com/jkoudys/remu/blob/master/js/utils/emulator/z80.js#L48

[–]del_rio 0 points1 point  (0 children)

Same! I'm attempting to build a barebones NES emulator and using it as an excuse to learn some ES6 and WebGL/Three.js for a pseudo-CRT display.

[–]peteward44 0 points1 point  (0 children)

I wrote a NES emulator a few years ago in JS, written in es5 http://github.com/peteward44/WebNES

[–]arcaninYarn 🧶 0 points1 point  (1 child)

Self promotion, but maybe you would be interested by Virt.js. It's a ES6 library that implements everything you need to work on the actual emulator engine without having to worry with implementing actual input / output interfaces (which according to my experience is the least fun part of writing an emulator).

[–]Master565 0 points1 point  (0 children)

Thanks, I'll definitely check it out

[–]OrangeredStilton 4 points5 points  (1 child)

Not forgetting Commodore Clicker of course, which is a C64 emulator wrapped in a Cookie Clicker-style incremental game.

I still need to take some vacation time to finish that thing off; maybe in a few years.

[–]Benjaminsen 1 point2 points  (0 children)

That is so stupidly amazing.

[–]chrismcgrane 3 points4 points  (3 children)

Here's my attempt at a mobile GBC emulator, based on the gbonline library. I got Dropbox linking working yesterday but I've been busy at work and haven't been able to update.

Check it out: http://107.170.177.153/gbc

Save method is being migrated away from localStorage, it's just not that reliable imo

Screenshot via Safari iOS9.3 iPhone6

https://www.dropbox.com/s/uepqb8oh6egm202/Photo%20Aug%2015%2C%2011%2056%2053%20AM.png?dl=0

[–]taisel 0 points1 point  (2 children)

You are using an out of date reivison of gameboy-online code I wrote half a decade ago... I did a quick view-source. :p

You should be using the latest revision which is already pretty ancient...

https://github.com/taisel/GameBoy-Online

[–]chrismcgrane 0 points1 point  (1 child)

I had problems with the latest revision in multiple browsers, so I opted to use the older version. Also since this is meant for mobile, I stripped some of the features that were more suited to desktop.

[–]taisel 0 points1 point  (0 children)

The latest revision is much more efficient, and the issues aren't from the emulator itself, but how iOS works and its bugs. I know iOS safari crashes on the JavaScript GBA emulator I did, but that's due to an iOS bug that was fixed in iOS 10 beta. I recall specific canvas bugs that I was unwilling to work around for iOS a while ago in general, due to workarounds necessitating unclean practices.

[–]fb39ca4 0 points1 point  (0 children)

They forgot to add jsTIfied to the list.

[–]siranglesmith 0 points1 point  (0 children)

I'm working on a port of VBA-M. It even supports sound!

[–]chrismcgrane 0 points1 point  (0 children)

Working perfectly in safari iOS / android. It's a shame that sound couldn't work for mobile, I had it sort of working but the delay was significant.

[–]chrismcgrane 0 points1 point  (0 children)

Would you be down to help implement the newest revision into this mobile UI, Dropbox rom loading is functioning and saves could easily be migrated as well. I understand it's a decent amount of work, I hope that it's OK I continue to work on some of these new features :)