sim-arduboy (the repository formerly known as simavr-arduboy) is an Arduboy simulator based on simavr. See the project’s README for OSX build instructions (instructions for more OSes will be added). Please use GitHub’s issue tracking system to report issues.
Awesome work! A couple things though: found that it doesn’t handle delay() correctly. Instead, it speeds through it as seen in the level start transition animation:
Also, the emulator will now hang if a game tries to use while(true){delay(1000);} to crash itself.
Really liking it though! This has been helping a lot, thank you!
Don’t sweat it, those are pretty minor issues for the way I’m using this, at least. It’s been immensely helpful as I’ve been using it as a near-live preview for implementing game UI, and instantly testing the behavior of other game data. In the future, I’d like to be able to use this as part of automated testing.
I will document the steps for Windows 10, but basically is getting the Bash Terminal from the Windows Store https://www.microsoft.com/store/apps/9NBLGGH4MSV6 and an xwindow server (and checking google for solving the compilation errors… like a normal linux user)
I wasn’t aware that worked on an Arduino. I figured it would be better to put it in a known state, since there’s no OS to fall back to! But thanks, I’m still working on improving my debugging tools. Although, after looking it up, it seems like exit(0) just puts it in an infinite loop anyway.
It also stops interrupts, and I’m not sure if it’s the same for all devices.
I had a feeling on certain devices it had a means of handling things diffferently, I can’t find exit in the source code though.
It might be possible to tweak the simulator to recognise RJMP -2 and halt accordingly.
Make the terminal use the X-server you installed with sudo nano $HOME/.bashrc and add export DISPLAY=:0 at the end. Exit and save with Ctrl+X, Y. Exit and reopen the terminal.
The Ubuntu terminal works in a similar fashion to the old cmd or powershell, so it is possible to send commands as the argument, for example bash -c "some linux command" so the integration could be seamless:
This is really good. I would love to see this actively developed.
Thanks! But it IS being actively developed
Is there any way to display the serial output?
Not yet but it is on the todo list. I haven’t tried yet but I believe simavr should have most (if not all) of the bis and pieces to emulate the serial port.
I’d love to see that too. People are welcome to open pull requests on GitHub to contribute code. For those who want to contribute, please discuss what they intend to do first mostly to avoid duplication of effort.
I’d love to help get it to the point where it could run on windows natively without having to do all the ‘install ubuntu and x-window server’ shenanigans.
It’s using SDL at its core, so I don’t see how it came from using a cross-platform library to not being able to run on Windows.
(I know that’s not your fault, it’s the actions of the person (or people) who wrote the original that you forked.)
Sadly doing so isn’t high on my list of priorities at the minute, I’ve got several other projects to tie-up first before I could actively contribute.
@filmote For what it’s worth, I understood what you meant by ‘actively developed’.
I pushed a new update. Some fixes to simavr and some improvements to the arduboy board. I looked into serial I/O and I saw there is a set of patches to support usbip being evaluated right now. The issue with usbip is that it’s most likely going to work on linux only.
Are you referring to simavr? Not sure if it used SDL in the past but it doesn’t now. It’s strange though for the core of a simulator to rely on SDL. What I noticed is that the code assumes GNU compiler extensions so there is very little hope to make it compile with Visual Studio.
Speaking of SDL, I want to swap the current GLUT based implementation of window handling with SDL.
Me too, it looks like simavr itself doesn’t depend on many libraries. Using cygwin, SDL libraries and an Arduino IDE installation as shortcut for installing avr-libc and avr-gcc should be enough to compile on a windows system.
Next I’ll look into enabling support for gdb debugging of the .hex image being run.
Do we use the same git command to retrieve this one?
From the root of the git repo run: git fetch origin and then git reset --hard origin/arduboy
This will force your lock repository checkout directory to match the remote branch arduboy.