Is the Arduboy emulator not working?

I wanted to test some code in the emulator before I bought an arduboy to see what programming one was like but it doesnt run in the emulator.

What do you mean it doesn’t run in the emulator? Does programming, or opening a .hex/.arduboy not work?

I can drag a .hex of an arduboy game and run it just fine in Project ABE. It seems though that programming does not work however.

You could code in an external IDE/code editor, build it, then just upload the .hex to Project ABE. It is pretty tedious though.

I know that on my end, (a) games are unplayable because the framerate is locked to your screen refresh rate, and (b) there’s never any sound because ā€œAudioContext not allowed to startā€ because it has to wait for a user gesture:
image

I can’t get sound to work on the standalone version of the emulator either, so perhaps there’s some timing issue? I don’t know, I just figured the emulator was ā€œout of reachā€ unless your system is set up in a certain way. I can’t even play the embedded games on this website, and none of them have sound either (same error).

Currently the compiler in the emulator is broken, the server the build tool was hosted on is no more. I need to bring it all onto arduboy.com but I’m not a very good system admin so don’t know how to deploy it. I’ll get around too it soon as I submit Arduboy Mini to production.

Can you please give us some more info:

What platform you are running, Windows, MacOS or Linux.
What you did to deploy the emulator.
Did this error come up when you started the emulator or when you dragged a .hex file onto it.

Sure. The screen issue is a known error I’ve seen reported both here and in github, so I don’t think that’ll get fixed. I have a 165hz display and I assume the emulator uses requestAnimationFrame() or something similar, so solutions are inconvenient and I understand that.

As for the sound issue, I assume that comes from timing issues of trying to set up the audio while the page is still considered a ā€œbackground tabā€, although I don’t really know. Anyway, when I say it’s ā€œunusableā€ what I mean is, because games play at 3x speed, they in no way reflect how they run on hardware (and also most of the games are ridiculously hard at 3x speed lol). The emulator ā€œworksā€ in that I can drag hex files to it and they always run, so I’m sorry if I painted a false picture. I mean that it is unusable ā€œto meā€. I don’t have a second monitor that isn’t 165hz and the monitor can’t be safely clocked at 60hz, which is a known (and dumb) issue for higher refresh rate monitors that aren’t… expensive. Plus, with no sound, I’d have to upload it to hardware to test that part anyway, so I might as well just always upload to hardware (which I don’t have yet).

The same visual and audio issues occur in both the browser and the standalone. As for the browser, the issues occur whether it is the embedded emulator here in the forum, the github pages link, which I use to load old games from the sidebar, or if I drag the hex file into it. The browser is Chrome 110.0.5481 running in Windows 11. The version of the standalone is the latest windows release from the repo. As a relatively experienced web developer, I’d like to pre-empt the ā€œI can’t recreate the issue on my side with the same setupā€ and say that I understand how difficult web development is and I don’t expect these things to be easily reproducible. Especially when it comes to generating sound, where the landscape within browsers is… egh.

The audio issue I linked above shows up on page load, not when the emulator runs with a game. Anytime it is trying to set up the audio context, it appears as though it may be doing it too early, or that the page isn’t visible and so it says ā€œyou can’t do this because we don’t want audio playing in background tabsā€, I don’t know, browsers are a pain. I can sometimes get audio to work and that error doesn’t show up if I specifically ensure the ā€œemulatorā€ part is not what loads first, and instead the browsing page which lets you pick old games. But if that error EVER shows up, the sound is broken for the entire duration. Since the error suggests the audio context must be manually resumed/created after a user gesture, I assume the fix is to test whether audio context hasn’t been set up or if it’s in an error state at the point of running the emulator (probably a good check to do every time), and reinitialize it if so.

Ah, I see I though it never worked.

Must be some monitor!

Yes, its disappointing that the sound doesn’t work in the emulator properly. When it does make noise its all wrong and, as you say, if it doesn’t start properly it is out for the rest of the session.

I find that my development is 97% game play development (coding) and 3% sounds so this is not a big issue to me. Actually, its more like … 48% code, 2% sounds and 50% debugging the mess I have made :slight_smile:

I have never bothered looking at the errors that appear in the browser console. Now I am curious and will see if that happens for me. I am using FireFox on MacOS.

Sorry I can not give you any real info but maybe Felipe (@FManga) might chime in.

When I first started reporting speed issues related to running over 60hz people thought I was wizard. There are 540hz screens now I can only imagine what the emulator would look like there.

I asked @fmanga about it but he said that he used milliseconds before but that lead to instability due to browsers intentionally reporting false results to prevent malicious behavior.

I think a possible solution is to sample the millisecond so that you can establish what fps the user monitor is at, (it may actually be reported by the user agent) and then apply a divider to the output frame per second.

Best as I understood he encouraged me to take on this fix. Once I can get around to deploying it here that’s something I’d like to try.

1 Like

I’ve got to give Firefox a try! Been looking for a new browser since Safari doesn’t copy images properly anymore; it always copies the image address. Seemingly everyone (with a few exceptions) here seems to use it.

I like FireFox because I don’t like giving Google any information if I can avoid it :slight_smile:

Spies everywhere :male_detective:

3 Likes

I posted an interesting poll a while back to find out, and Firefox did come out top for desktop browser.
It’s not really scientific, but the response was pretty decent.

1 Like

I’m using it right now, and it’s much cleaner than I thought!

My only (small) gripe is that the app logo has a purple background!

image

I don’t think a background goes very well due to the circular shape, but I think every app must have a solid background on MacOS.

I meant the programming part but I guess I will do what you said with the external ide

Not true. I am looking at my machine and only Firefox has a solid background.

Seeing you are using Firefox and learning HTML / CSS / Javscript you should look at the tools you get by pressing F12! They are great. Of course Chrome has them as well …

1 Like

Oh, yeah that’s true. For me, the Unarchiver, Logi Options, and Unity/Unity Hub are not shaped like a ā€˜normal’ app, so I guess they must have transparent backgrounds or masks or something.

hehehe

That’s how I found the Arduboy banner color :slightly_smiling_face:

You can go to Sketch > Export compiled binary then use the .hex that does not have the ā€˜bootloader’ bit in the name.

any update on this?

I tried the emulator a few days ago and it is still broken. :slightly_frowning_face:

Seems some forum code is broken.

When including the emulator in an iframe, it still works:

@Bateske can we have the new sim / debugger by @brow1067 also have working in an iframe? (The iframe below doesn’t work)


Edit: Nevermind, you guys where talking about compiling code not the emulation part :smiling_face:

The code development is broken because where the compiler is hosted ended. I have been meaning to work to rehost this to one of my domains but I’m on squarespace so I don’t actually have anywhere to deploy it directly at the moment. I’ve got to get SSL back up on the old host and give it a domain, that’s going a long with a rework of the website that will bring the emulator to the front page as well.

Is there any way to include the work by @brow1067 hosted on the web?

If there is a sysadmin who is good at this stuff can hold my hand over a web call would be grand, but I won’t be ready for at least 2 or 3 more weeks when getting caught up on other design/production work.

If anyone is really eager and thinks they can deploy it themselves and wants a job let me know too.