Perhaps the smallest full-working video game console for Arduino based on the NES Emulator and the project
jamulator
. It is also a proof of concept for the Brainduino interpreter, an interpreter of the Brain Language targetting Arduino.
-
Human Jump // Avoiding obstacles by controlling a character through Bluetooth on an iPhone
-
Game:
- Code:
setup
>>>>>>>?:++; make the count of two sprites at cell 7
build values for distant cells so we can jump later
>?<<<<<:++++++++>+*>+*>+++++++*<--*<---*<<<<<<;
?->>>>>>^>>>+<<<<^:<<; if btn DOWN is pressed increment Y position of human object
?->>>>>>>>^>>>-<<<<^; if btn UP is pressed decrement Y position of human object
player
>>>>>>>>^?:++; write the number two if cell 41 is empty
<<?:++++++;>> go to cell 38 and make it 6 if it is empty
>+% increment cell 42 and take it mod 2 because so we can change the sprite
<<?:+;^ go back to cell 1
monster 1
>>>>>>>>>^?:++; go to cell 48 and make number two if cell 48 is empty
>+%++ increment cell 49 and take it mod 2 and add 2 so we can change its sprite
>?--:++>_%<++++++++++++; if cell 16 is equal to 0 then we reset it to the number 15
?: check if cell 50 is equal to zero
> go to cell 51 in case it is
? check if 51 is different from zero
<<<<<<<< go to cell 43 in case it is
?<<<<<^?:+;; if cell 43 different from zero then the game is over
: if cell 51 equal to zero
<<<<<<<< go to cell 43
?:<<<<<^?:+;; if cell equal to zero then the game is over
;
;
Brainduino is currently in development mode, please check the dev branch
To Do | In Progress | Done |
---|---|---|
You may install BrainStation
by following the instructions given here: https://github.com/brain-labs/brainduino
BrainStation is based on old video game consoles such as NES and SNES and has its own PPU (Picture Processing Unit). That being said, its code will be executed by following a sequence of steps:
-
- Check for external user input and set the
cells 0 trough 5
, if they are active (see Control Cells).
- Check for external user input and set the
-
- Run the Brainduino as the CPU cycle (setting the values of the fields and running the
Brain
script code).
- Run the Brainduino as the CPU cycle (setting the values of the fields and running the
-
- Run the BrainStation as the PPU cycle (drawing the elements on the LCD).
The BrainStation uses the Brainduino cells (100 cells because of the Arduino limitation) as its Turing Tape and has this format:
LEFT BTN | UP BTN | RIGHT BTN | DOWN BTN | A BTN | B BTN | IsGameOver | N Sprites |
---|---|---|---|---|---|---|---|
Cell 0 | Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 | Cell 7 |
Cell 0
: Left ButtonCell 1
: Up ButtonCell 2
: Right ButtonCell 3
: Down ButtonCell 4
: A ButtonCell 5
: B ButtonCell 6
: IsGameOver? (0: false, 1: true)Cell 7
: NSprites (Number of objects shown at same time on LCD)
Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom | Custom |
---|---|---|---|---|---|---|---|---|---|
Cell 8 | Cell 9 | Cell 10 | ... | ... | ... | ... | Cell 33 | Cell 34 | Cell 35 |
Cells 8 through 35
: Custom Cells (You can use them for any kind of operations)
Custom Obj1 | Custom Obj1 | Custom Obj1 | Custom Obj1 | Custom Obj1 | Obj1 #Sprite | Obj1 #X Pos | Obj1 #Y Pos |
---|---|---|---|---|---|---|---|
Cell 36 | Cell 37 | Cell 38 | Cell 39 | Cell 40 | Cell 41 | Cell 42 | Cell 43 |
Cells 36 through 40
: Custom Operations for the first objectCell 41
: The sprite number of the object 1 at a given point (values are 0 through 7 because of the LCD limitation)Cell 42
: X Position of object 1Cell 43
: Y Position of object 1
Custom Obj2 | Custom Obj2 | Custom Obj2 | Custom Obj2 | Custom Obj2 | Obj2 #Sprite | Obj2 #X Pos | Obj2 #Y Pos |
---|---|---|---|---|---|---|---|
Cell 44 | Cell 45 | Cell 46 | Cell 47 | Cell 48 | Cell 49 | Cell 50 | Cell 51 |
Cells 44 through 48
: Custom Operations for the second objectCell 49
: The sprite number of the object 2 at a given point (values are 0 through 7 because of the LCD limitation)Cell 50
: X Position of object 2Cell 51
: Y Position of object 2
Obs.: From the Cell 36 on, every 8 cells represent a new object. Obs.2: The BrainStation has a maximum of 7 objects because of the Arduino and LCD limitations.
Feel free to send your pull requests. :)
This project extends GNU GPL v. 3, thus be aware of that, regarding copying, modifying and (re)destributing.