Simbuino4Web released (was Simbuino emulator running in...)

Libraries, utilities, bootloaders...

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Sorunome » Tue May 03, 2016 7:52 pm

Hm, rendering is blurred for me, instead of pixilated....

Using latest version of firefox

Other than that, it seems to be running at full speed which is pretty awesome, great job! :D
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Myndale » Tue May 03, 2016 10:06 pm

mougino wrote:Have you planned making the code available?


Already have, it's got its own folder in the Simbuino github repository:

https://github.com/Myndale/Simbuino/tre ... mbuino4Web

All the relevant stuff is in Views\Home and Scripts\Views.

mougino wrote:I'd love to see an Arduboy version of this web emulator!


Not really that interested in Arduboy myself (not enough time for Gamebuino as is) but if anyone else wanted to give it a crack I don't think it would be that much work. The buttons class would have to be changed to reflect the different pins, and the audio code might be on a different PWM pin; the only real change would be a rewrite of the Lcd class to support the SSD1306 OLED instead of the 5110 LCD. From the the spec sheet it looks pretty straightforward.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Drakker » Tue May 03, 2016 10:22 pm

That's why every game should default on ESDF. =)
User avatar
Drakker
 
Posts: 297
Joined: Sun Mar 30, 2014 2:54 am
Location: Québec, Canada

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Myndale » Tue May 03, 2016 11:34 pm

mougino wrote:I have a French AZERTY keyboard, with it your emulator controls are super hard!


Changed now as per Drakker's mapping suggestion, thanks for the heads-up.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Myndale » Tue May 03, 2016 11:37 pm

Sorunome wrote:Hm, rendering is blurred for me, instead of pixilated....Using latest version of firefox


Try now, I was missing a firefox css setting for canvas up-scaling.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Myndale » Tue May 03, 2016 11:38 pm

Drakker wrote:That's why every game should default on ESDF. =)


Good tip. Done!
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby blakewford » Thu May 05, 2016 12:37 pm

I had a little trouble keeping my browser focused on the screen element so that control input would be recognized. Possibly change focus to that element on load? Basically I had to click on the screen before the controls started working. Other than that, I was very impressed.

Can you elaborate a little on the tech behind your browser transition? Is all of the code now client side, or does the solution require server deployment? Did you use a cross compiler for C#?
blakewford
 
Posts: 39
Joined: Tue Oct 21, 2014 4:15 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Sorunome » Thu May 05, 2016 7:43 pm

Myndale wrote:
Sorunome wrote:Hm, rendering is blurred for me, instead of pixilated....Using latest version of firefox


Try now, I was missing a firefox css setting for canvas up-scaling.

Yup, it's working now, awesome!

Is there a way to emulate an SD card, yet?
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Myndale » Thu May 05, 2016 10:40 pm

blakewford wrote:I had a little trouble keeping my browser focused on the screen element so that control input would be recognized.


Should be fixed now, thanks!

blakewford wrote:Can you elaborate a little on the tech behind your browser transition? Is all of the code now client side, or does the solution require server deployment? Did you use a cross compiler for C#?


It's all client-side, if you do a page save you can run it locally.

I did the port by hand but it wasn't as much work as I thought it was going to be, the trick was to first get the original C# code as close to Javascript as I could in order to take advantage of the compiler's error checking instead of waiting for things to blow up at runtime in the browser. First step was to strip away everything that wasn't part of the core engine. Next step was to change any code that relied on C# language-specific features i.e. op code handler attributes (which I replaced with a lookup table along with the handlers themselves) and index operators (which I replaced with get/set/get_bit/set_bit functions); this was probably the most time consuming part of the port but it was just a matter of working through the errors that cropped up when I tried to compile. One of the last stages was replacing all scalar types with doubles, since that's all javascript uses; this created a compile time error everywhere I did an array lookup so I put a cast in all those places and did a project-wide delete of "(int)" when it came time for the actual port.

A few other things helped...I did everything in a separate local branch and made frequent commits along the way so that if I discovered something had broken I could keep rolling back until I found the commit that caused it (although in the end I only had to do this a few times). I eventually reached a point where errors were occurring a few hundred thousand cycles into execution and the lack of an integrated debugger was making it difficult to track them down, so I modified the original C# code to check every single variable in the context after each cycle (RAM, flags, PC etc) and dump the changes to a log file. This took about 40 minutes to log 1 second of execution time but it only had to be done once and after that I knew the exact cycle that every single issue occurred on. If I were to do it all over again I would do this step first because tracking down the remaining bugs was trivial after that.

So yeah, maybe somewhere around 15 hours work all up but not too bad considering, and the code's now in a state where a port to Android/Java (say) would probably only take an hour or two. It'd be interesting to do that alongside a Xamarin version using the original C# code to see how they compare performance-wise.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: Simbuino4Web released (was Simbuino emulator running in.

Postby Drakker » Fri May 06, 2016 12:03 am

Isn't there like 10 native javascript engines available for Android? I don't think you have to use Java for that. Anyway, with the way Oracle is handling Java, I'd keep away from it.

Btw, it works amazing on my side with Chromium on Linux. Now all I need is some free time and I could maybe finish a project or two. =)

Thanks for all your efforts!
User avatar
Drakker
 
Posts: 297
Joined: Sun Mar 30, 2014 2:54 am
Location: Québec, Canada

PreviousNext

Return to Software Development

Who is online

Users browsing this forum: No registered users and 18 guests

cron