Web Based Gameboy Emulator

Discussion in 'Other Handhelds' started by nano351, Jun 23, 2013.

  1. nano351
    OP

    nano351 GBAtemp Regular

    Member
    259
    2
    Jun 6, 2009
    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/
     
    macmanhigh likes this.
  2. macmanhigh

    macmanhigh THC = Truly High Caliber

    Banned
    699
    112
    Mar 29, 2012
    United States
    BuddsVille,CA
    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.....
     
  3. Isaac

    Isaac American

    Member
    319
    104
    Dec 8, 2012
    United States
    Here? Right here? What about, say... over there?
    Awesome, I'll try this out later when i get on my laptop. May I ask how you got it to access google drive?
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,508
    9,321
    Nov 21, 2005
    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.
     
    macmanhigh likes this.
  5. nano351
    OP

    nano351 GBAtemp Regular

    Member
    259
    2
    Jun 6, 2009
    United States
    Yikes let me know how it goes! The 3DS's javascript engine is pitiful and can't handle it at all

    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
     
  6. 2ndApex

    2ndApex GBAtemp Advanced Fan

    Member
    677
    288
    Jul 12, 2012
    United States
  7. macmanhigh

    macmanhigh THC = Truly High Caliber

    Banned
    699
    112
    Mar 29, 2012
    United States
    BuddsVille,CA
    MMmmmmm Tested on Vita Loads the Page Fine but doesn't load upper right Login icon "Loading Google Credentials" loops Forever.......
     
  8. nano351
    OP

    nano351 GBAtemp Regular

    Member
    259
    2
    Jun 6, 2009
    United States
    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!

    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
     
  9. macmanhigh

    macmanhigh THC = Truly High Caliber

    Banned
    699
    112
    Mar 29, 2012
    United States
    BuddsVille,CA


    Yeah that was the second thought that Crept in my Mind...How to play it on Vita!!!!

    Anyways Superb Program U got and GDrive makes it A Must :mthr:
     
    nano351 likes this.
  10. grantgalitz

    grantgalitz Member

    Newcomer
    12
    1
    Aug 7, 2012
    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.
     
  11. nano351
    OP

    nano351 GBAtemp Regular

    Member
    259
    2
    Jun 6, 2009
    United States
    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.
     
  12. grantgalitz

    grantgalitz Member

    Newcomer
    12
    1
    Aug 7, 2012
    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
     
  13. nano351
    OP

    nano351 GBAtemp Regular

    Member
    259
    2
    Jun 6, 2009
    United States
    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
     
  14. DSTWO Guy

    DSTWO Guy Member

    Newcomer
    26
    0
    Apr 19, 2012
    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.