User Tools

Site Tools


proton:arduboysim

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
proton:arduboysim [2016/05/28 12:01] sethproton:arduboysim [2016/06/08 01:42] seth
Line 4: Line 4:
  
 See a Vine of it in action [[https://vine.co/v/i9H5ZYWvLFV|here]]. See a Vine of it in action [[https://vine.co/v/i9H5ZYWvLFV|here]].
 +
 +Play its HTML5 export in a browser [[http://www.rtsoft.com/ArduboySim.html|here]].
  
 == What does it do? == == What does it do? ==
  
-It's a harness to run code written for the [[https://www.arduboy.com|Arduboy]] in Visual C++ 2005. It fakes the Arduboy API (Based on V1.2 of the Arduboy library) so I can test and debug my stuff in my favorite development environment.  The identical code can then be run on the real Arduboy.+It's a harness to run code written for the [[https://www.arduboy.com|Arduboy]] in Visual C++ 2005. It fakes the Arduboy API (Both V1.1 and V1.2 of the Arduboy library) so I can test and debug my stuff in my favorite development environment.  The identical code can then be run on the real Arduboy.
  
 == Features/Good stuff == == Features/Good stuff ==
Line 34: Line 36:
 == How to convert your own Arduboy code/sketch to run == == How to convert your own Arduboy code/sketch to run ==
  
-  * Add your sketch files to <proton install dir>/ArduboySim/Arduboy. (you should probably delete break_outbitmaps.* as your sketch likely doesn't use them)+  * Add your sketch files to <proton install dir>/ArduboySim/Arduboy. (you should probably delete breakout_bitmaps.* as your sketch likely doesn't use them)
   * Replace ardu_main.cpp with the contents of your .ino file. Delete your .ino file, you won't need it anymore, Arduboy.ino will be used instead   * Replace ardu_main.cpp with the contents of your .ino file. Delete your .ino file, you won't need it anymore, Arduboy.ino will be used instead
   * Rename begin() and loop() to main_being() and main_loop()   * Rename begin() and loop() to main_being() and main_loop()
-  * You can now try compiling.  Likely it will fail with a bunch of errors because Visual C++ isn't automatically creating function declarations now that it's a normal .cpp file.  Create your own (example: void myfunction();) and paste them at the top of the .cpp or in its .h file.+  * Disable precompiled headers for your added files in VC++ (Select the .cpp files you added, right click and choose properties, set configuration to All Configurations, then under C/C++->Precompiled Headers, set Create/Use Precompiled Header to "Not using Precompiled Headers"
 +  * You can now try compiling.  Likely it will fail with a bunch of errors because Visual C++ isn't automatically creating function declarations like the Arduino IDE does - it'just a normal .cpp file.  Create your own (example: void myfunction();) and paste them at the top of the .cpp or in its .h file.
   * Your thing might run now!  If not, it's probably because of something I'm not simulating yet and you'll have to add it   * Your thing might run now!  If not, it's probably because of something I'm not simulating yet and you'll have to add it
 +
  
 == How to run your converted sketch on the real Arduino == == How to run your converted sketch on the real Arduino ==
  
-Just double click <proton install dir>/ArduboySim/Arduboy/Arduboy.ino and compile and install like usual, it should work.  You can zip up just that dir if you want to give the Sketch source to somebody, it works the same as usual despite the tweaks.+Just double click <proton install dir>/ArduboySim/Arduboy/Arduboy.ino and compile and install like usual in the Arduino IDE, it should work.  You can zip up just that dir if you want to give the Sketch source to somebody, it works the same as usual despite the tweaks.
  
 == Thoughts/Notes == == Thoughts/Notes ==
Line 48: Line 52:
   * Maybe there is a better way than the dummy .ino file calling main_begin() and main_loop(), dunno, but this does work.   * Maybe there is a better way than the dummy .ino file calling main_begin() and main_loop(), dunno, but this does work.
   * Most code is copied from the Arduboy & Arduino projects and not mine. Feel free to use/steal any the stuff I wrote in the ArduboySim or /shared/Arduboy directory trees as needed.   * Most code is copied from the Arduboy & Arduino projects and not mine. Feel free to use/steal any the stuff I wrote in the ArduboySim or /shared/Arduboy directory trees as needed.
 +  * Why am I still using VC++ 2005? I dunno, I just like the IDE more than the 2015 version and use it when I can. VC++ 2015 should work too but you'd have to update the solution file, I didn't try it
 +  * I made a [[http://community.arduboy.com/t/proton-arduboy-simulator-for-windows-visual-c-2005/1476|thread on arduboy.com]] if you have a question or comment about this
 +
 +
 +-- Updates/Changes (do svn update to get the latest!)
 +
 +  * June 2nd 2016:  Now plays simple tones (to use, Switch build to "SDL Debug GL", you'll need SDL 2 libs), display more accurately simulated, supports HTML5 web version, just run /html5/build_release.bat to make it. ([[proton:html5_setup|More info on HTML5 setup]])
 +  * June 7th 2016: Can now compile both arduboylib 1.1 and 1.2 code, 1.1 is now default and ardubreakout was changed to the 1.1 version. Should define RT_ARDU_DEV_BRANCH for 1.2 code, will fix timing to match 1.2
 +  * June 8th 2016: Landscape mode support: ArduboySim's App.cpp adjusted, uncomment #define RT_ARDU_LANDSCAPE and you can play sideways
proton/arduboysim.txt · Last modified: 2018/07/28 14:22 by seth