New emulator: Simbuino (Windows)

Libraries, utilities, bootloaders...

Re: New emulator: Simbuino (Windows)

Postby Myndale » Sat Aug 16, 2014 8:27 am

microgamer wrote:so does that mean I need to compile code elsewhere to produce a HEX file? Should I use Codebender first?


Yes. Gamebuino games are compiled into HEX files for storage on the SD card, it's these that my emulator loads. If you open the Arduino IDE and select File -> Preferences you'll find a checkboxe for "Show verbose output" for "compilation"; turn this on. From that point compiling your Arduino program will then show you where the HEX file is being generated on your local machine, e.g. C:\Users\YOURUSERNAME\AppData\Local\Temp\build1234567tmp\YourGameName.cpp.hex
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: New emulator: Simbuino (Windows)

Postby microgamer » Sat Aug 16, 2014 9:14 am

Re Codebender - sorry if this is a basic question ..

In Codebender, there is not "Gamebuino" in the drop down menu'to compile for - like there is for Microview. Let's hope they will add that.
In the meantime how to set it up so the script can find the Gamebuino Header file?
Is there a way to upload the Header files to a central place so the compiler can find them, has that already been done?
microgamer
 
Posts: 8
Joined: Tue Aug 12, 2014 9:13 am

Re: New emulator: Simbuino (Windows)

Postby rodot » Sat Aug 16, 2014 9:41 am

Hey Myndale,
Impressive :shock: (as usual :roll:)
It runs at full speed with sound and persistence enable using 32% of my i5-3337U @1.8Ghz. As it's an ultrabook CPU it's not very demanding! Although I have some stuttering too, but it's still playable. They main difficulty to play though is the key binding with all the keys for the left hand :P
As soon as I start the program, even before I start a game, there is a continuous high pitch tone, I don't know if you noticed it?
The sound rendering is very faithful, do you directly update the sound output at 16Mhz?
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: New emulator: Simbuino (Windows)

Postby Myndale » Sat Aug 16, 2014 11:46 am

rodot wrote:They main difficulty to play though is the key binding with all the keys for the left hand


Easy enough to change, I'll add a user configuration dialog box for it.

rodot wrote:As soon as I start the program, even before I start a game, there is a continuous high pitch tone


Given the feedback I've been getting here I think it's becoming fairly evident that I'll need to use a different sound playback method. Currently I'm using native winmm functions but there's always the balancing problem of getting the size of the playback buffers just right. Too large and your sound starts to noticeably lag the rest of the game, too small and you get artifacts like stuttering. I think I might have to blow the dust off some of my old DirectSound code.

rodot wrote:The sound rendering is very faithful, do you directly update the sound output at 16Mhz?


No! I got about halfway through implementing the code to do it properly before realizing it was completely unnecessary. The eureka moment for me was when I saw this line of code in your library and realized it was ultimately responsible for every sample being sent to the speaker:

Code: Select all
OCR2B = output; //60x faster than analogOutput() !


My architecture is designed such that if Timer2 is set for PWM mode then I can easily calculate when it will toggle the speaker port, and my plan was to actually do the full emulation of this and integrate the result. But when I saw that line I instantly realized that if I do it with 100% accuracy the value I get will be exactly the same as the byte stored in OCR2B. Dennith was absolutely correct when he suggested this as a possibility for adding sound support to his emulator in the other thread. You don't even need to modify it in any way, you just create an 8-bit unsigned mono sound channel and you fill it with whatever is in OCR2B and what comes out your speaker will be an exact match.

Well, sort of. The next logical step would be to play a range of frequencies into the speaker, capture them with a very high quality microphone and generate a response curve which could then be fed into a digital equalizer to mimic what it will actually sound like coming from a real Gamebuino speaker.....but that's a project for a rainy day when I'm bored. :lol:
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: New emulator: Simbuino (Windows)

Postby Skyrunner65 » Sat Aug 16, 2014 5:54 pm

Well, it sounds great, but for now I'm stuck with Deneth's Emulator (no offense, but you haven't made sound work yet).
I'll start looking for something that can run .net applications in linux... (Wine isn't out for fedora 20 yet)

Myndale wrote:Yes. Gamebuino games are compiled into HEX files for storage on the SD card, it's these that my emulator loads. If you open the Arduino IDE and select File -> Preferences you'll find a checkboxe for "Show verbose output" for "compilation"; turn this on. From that point compiling your Arduino program will then show you where the HEX file is being generated on your local machine, e.g. C:\Users\YOURUSERNAME\AppData\Local\Temp\build1234567tmp\YourGameName.cpp.hex


Also, I put a fix to that on the "Getting Started" page.
User avatar
Skyrunner65
 
Posts: 371
Joined: Thu Mar 20, 2014 5:37 pm
Location: NC,USA

Re: New emulator: Simbuino (Windows)

Postby rodot » Sat Aug 16, 2014 6:54 pm

Skyrunner65 wrote:Also, I put a fix to that on the "Getting Started" page.

It's already on the getting started page...
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: New emulator: Simbuino (Windows)

Postby Vraister » Sat Aug 16, 2014 9:31 pm

Hi,
I just had a brief run with the emulator and finally signed up for the forum.

The emulator runs well on my Lenovo T410 laptop. I have only tested it with a few of the examples but everything seems to work. It uses about a third of the CPU and sound works. Great work, thanks!

Best,
Vraister
Vraister
 
Posts: 5
Joined: Sat Aug 16, 2014 9:25 pm
Location: Scotland

Re: New emulator: Simbuino (Windows)

Postby DFX2KX » Sun Aug 17, 2014 9:39 pm

Just finally sat down and tried it. It works fine! Nice to be able to see memory usage. though it doesn't like my dark windows theme much XD.

Uses a good chunk of my CPU, but still have some to burn. Same with Ram. Wasn't expecting the sound to work, that was suprising! :D staring at the memory output has already given me some sense of the space I've got to work with on these games, and that's pretty helpful (also points out how inefficient my code is)
DFX2KX
 
Posts: 250
Joined: Mon Apr 14, 2014 3:48 am

Re: New emulator: Simbuino (Windows)

Postby Myndale » Tue Aug 19, 2014 1:14 am

DFX2KX wrote:staring at the memory output has already given me some sense of the space I've got to work with on these games, and that's pretty helpful


Cheers DFX2KX, just remember that on the real hardware the space available for games only goes up to 7780 which is where the settings page sits, the bootloader takes up everything after that. Maybe I should have the emulator pop up a warning if people load a game that's too big and tries to corrupt this area?
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: New emulator: Simbuino (Windows)

Postby Myndale » Tue Aug 19, 2014 1:25 am

Thanks for the feedback everyone. I've made a number of changes including sound optimizations, fixing that buzzing that people were hearing, a greatly optimized graphics pipeline, fixing a number of bugs and proper support for timer 1 (so my original 3d demo and greyscale demos now work...don't forget to turn on screen persistence). I also added a Reload-And-Rerun option which makes development turnaround much faster...you just compile your app in the IDE with Control-R, tab back to the emulator (assuming you've already loaded your game in it) and hit Contrtol-F8. There's still work to be done in some of the interface panes but hopefully with all theses changes it's now a tool that's actually useful for proper development. I've uploaded the latest version of the emulator, it's at the same link as before i.e. http://www.ppl-pilot.com/files/Simbuino.zip.

I'm going to keep putting occasional work in this project but for the time being I'll be turning my attention back exclusively to graphics optimization...
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

PreviousNext

Return to Software Development

Who is online

Users browsing this forum: Google [Bot] and 23 guests

cron