Gamebuino
1. エミュレート!
最初に前回の記事で作った「HEX」ファイルをデスクトップに置いておきます。
図1:HEXファイルをデスクトップに保存
1.1 エミュレーター
Gamebuino用の図1「HEX」ゲームファイルをエミュレート出来るソフトが表1の通り4つ公開されています。
私は最近インストール不要でインターネットブラウザ(HTML)上で動くお手軽なソフトがお気に入りなので「Simbuino4Web」を使いました!
エミュレータソフト名 | 動作OS |
gbsim | Debian/Ubuntu, Windows |
Simbuino | Windows (.NET) |
Simbuino4Web | HTML5 |
RetroMicro | Android |
1.2 エミュレーㇳ!
「Load a.HEX game file:」項目の「ファイルを選択」ボタンをクリックしデスクトップに保存した「a_Hello.ino.hex」ファイルを開きます。
これでGamebuinoのSDカードに「HEX」ファイルを書き込まなくてもゲームプログラム(図3)の動作チェックが出来ます!
図2:simbuino4web
//importstheSPIlibrary(neededtocommunicatewithGamebuino'sscreen) #include<SPI.h> //importstheGamebuinolibrary #include<Gamebuino.h> //createsaGamebuinoobjectnamedgb Gamebuinogb; //thesetuproutinerunsoncewhenGamebuinostartsup voidsetup() { //initializetheGamebuinoobject gb.begin(); //displaythemainmenu: gb.titleScreen(F("Myfirstgame")); gb.popup(F("Let'sgo!"), 100); } //thelooproutinerunsoverandoveragainforever voidloop() { //updatesthegamebuino(thedisplay,thesound,theautobacklight...everything) //returnstruewhenit'stimetorenderanewframe(20times/second) if (gb.update()) { //printsHelloWorld!onthescreen gb.display.println(F("HelloWorld!")); //declareavariablenamedcountoftypeinteger: intcount; //getthenumberofframesrenderedandassignittothe"count"variable count = gb.frameCount; //printsthevariable"count" gb.display.println(count); } }
図1:プログラム例
※Gamebuinoの各種ボタン(一番上の図参照)とPCのキーボードのキーの割り当ては表2の様になっています。
Gamebuinoのボタン | 内容 |
↑ | E |
← | S |
↓ | D |
→ | F |
A | K |
B | L |
C | R |
2. まとめ
エミュレート可能と言うことは、Gamebuinoが無くてもWEBブラウザでGamebuinoの各種ゲームはプレイ可能と言う事ですね・・・
本体を売るよりもみんなに遊んで欲しいと言う意気込みを感じます。
励みになりますのでよければクリック下さい(^o^)/