Web Based Gameboy Emulator

nano351

Well-Known Member
OP
Member
Joined
Jun 6, 2009
Messages
259
Trophies
1
XP
248
Country
United States
Hello everyone!

I've been working on a web based gameboy emulator it runs using javascript/html5 and it uses google drive to store roms and saves. The idea is to create an emulator that works on web technologies and uses a cloud based storage sot hat it can be used from any computer with synchronized saves.

It supports gameboy, super gameboy, and gameboy color games along with fullscreen mode, gamepads, and preliminary sound support. It isn't fully optimized but enough to run at fullspeed on my acer C7 chromebook with sound off which uses a 1.1GHz intel cpu.

It also has emulation of the gameboy camera using your webcam! Contrast isn't working on that but it's basic functionality is there!

It has pretty high game compatibility, but is still very much in development and I'd love to get some feedback on it! Right now the next thing I plan on adding to it is offline support via web APIs. Right now the app can be loaded offline but it won't work because it still needs an internet connection to function correctly.

Link to the app: http://www.googulator.com/
 
  • Like
Reactions: macmanhigh

nano351

Well-Known Member
OP
Member
Joined
Jun 6, 2009
Messages
259
Trophies
1
XP
248
Country
United States
Pretty Sweet Budd just tested it out with 2 games Loads n Runs Beatiful :gba: Gonna jump on my Vita see if it works as smooth.....

Yikes let me know how it goes! The 3DS's javascript engine is pitiful and can't handle it at all

Interesting, I reported on http://gbatemp.net/threads/js-vba-m.335675/ last year but always nice to see new goes at things like this.

When you say SGB any chance of the multiplayer stuff working? A web based multiplayer bomberman would be fatal to any chance I had to get stuff done at various points but that matters little.
Yes it has multiplayer support! It's all local though so your friends have to come over and huddle arround your computer lol. You configure it on the settings tab
 

nano351

Well-Known Member
OP
Member
Joined
Jun 6, 2009
Messages
259
Trophies
1
XP
248
Country
United States
Kind of reminds me of this: http://www.virtualgbx.com/
But the cloud storing part of this makes it better already.

There's also the issue that virtual GBX is illegal since they distribute copyright protected materials. They claim some legal jargon but it's false. There's no DRM to prevent me from easily just downloading the original ROM file!

MMmmmmm Tested on Vita Loads the Page Fine but doesn't load upper right Login icon "Loading Google Credentials" loops Forever.......

Strange. I don't have a vita so I can't do any testing and I doubt the vita has any debugging support! Also, I doubt the vita supports the gamepad api. It's a really new api that only really has support by chrome and firefox at the moment
 

grantgalitz

Member
Newcomer
Joined
Aug 7, 2012
Messages
12
Trophies
0
XP
12
Country
United States
Looks like a nice ui and a great start.
Some nitpicks about the code though: I looked through the code, don't know why the hell you de-inlined a jump table into a switch and de-inlined register handling into outer functions. That's gonna eat up 3x more cpu than it should, I know because I spent a month reversing switches and if/else decoding back into a jump table in https://github.com/grantgalitz/gameboy-online

Also don't use JSBoy's APU emulation, it's shitty. Use VBA's or something similar to what I did, as there are tons of edge cases and audio comes out incorrectly if not sampled at sys clock.
 

nano351

Well-Known Member
OP
Member
Joined
Jun 6, 2009
Messages
259
Trophies
1
XP
248
Country
United States
Looks like a nice ui and a great start.
Some nitpicks about the code though: I looked through the code, don't know why the hell you de-inlined a jump table into a switch and de-inlined register handling into outer functions. That's gonna eat up 3x more cpu than it should, I know because I spent a month reversing switches and if/else decoding back into a jump table in https://github.com/grantgalitz/gameboy-online

Also don't use JSBoy's APU emulation, it's shitty. Use VBA's or something similar to what I did, as there are tons of edge cases and audio comes out incorrectly if not sampled at sys clock.

Never thought I'd meet you! I didn't de-inline anything. I've written all the code slowly from scratch (except the APU code). I was actually planning on borrowing the APU emulation from your gameboy emulator lol. It's just I need to understand better how your code is working first. The main reason I threw JSBoy's APU emulation in there was because I was trying to do it using web audio oscillators (and getting very frustrated out how terrible the approach was turning out), so JSBoy's was the easiest to cut and paste for the time being.

Thanks for the info about the switch tables and register lookups. I originally wrote my code in Java a long time ago and ported it to javascript and fixed up a lot of things. I noticed that the switch tables weren't working as fast as they would in other languages (because the VM goes through it and checks all the cases until it finds a match). Although I guess I neglected to look into how bad it is for performance and kind of forgot about it.
 

grantgalitz

Member
Newcomer
Joined
Aug 7, 2012
Messages
12
Trophies
0
XP
12
Country
United States
The areas of my code that use an array of functions are dispatch tables so we don't spend most of the time going through branching to the right handler. Using "parentObj" to refer back to context is weird but it works. You have to emulate the APU directly, you can't use an api to do it for you. You need to construct your own pcm audio stream, even if there are apis available to "simulate" it.

Nice work though, just realize the optimizations go a long way even if it forces weird coding conventions. I know I can run gameboy-online on a 10 year old P3 computer fullspeed, so it *can* be done. Heck, I'm working on IodineGBA to hit the perf wall issues for creative coding again: http://i.imgur.com/6VArsmY.png
 

nano351

Well-Known Member
OP
Member
Joined
Jun 6, 2009
Messages
259
Trophies
1
XP
248
Country
United States
The areas of my code that use an array of functions are dispatch tables so we don't spend most of the time going through branching to the right handler. Using "parentObj" to refer back to context is weird but it works. You have to emulate the APU directly, you can't use an api to do it for you. You need to construct your own pcm audio stream, even if there are apis available to "simulate" it.

Nice work though, just realize the optimizations go a long way even if it forces weird coding conventions. I know I can run gameboy-online on a 10 year old P3 computer fullspeed, so it *can* be done. Heck, I'm working on IodineGBA to hit the perf wall issues for creative coding again: http://i.imgur.com/6VArsmY.png

Yeah that's the conclusion I reached about the audio emulation, I was trying to take an easy way out because I've never really done anything with audio except deal with high level APIs. And wow that's really impressive how optimized you've gotten gameboy-online to be and IodineGBA is looking really really good too!

I'm planning on making this project opensource. There's just stuff sitting around that I need to clean up and consolidate before I do so. I also plan on adding emulators for more systems to the project and despite how much fun it is to work from scratch, it's proven to be quite time consuming and tedious at times so I might look into either porting opensource emulators as a starting point for other emulators or looking into working in other opensource javascript emulators as a starting point
 

The_Cooker

Active Member
Newcomer
Joined
Apr 19, 2012
Messages
28
Trophies
1
XP
162
Country
Canada
nice work, but you should make it so that you can run roms from your local harddive. also you should make it play gba and ds roms.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: damn wifi