Blue Okiris

Click here to edit subtitle

Gameduino and Ternex OS 1.0

Here is how you write the little endian (0x1234 is written as 34 12) shorts for the Gameduino games: 


Hex code or char - Description - Arguments


There are 100 vars(0-99) for the Gameduino

Stored as an array accessed by their index


'C' - Clears the screen - no arguments

'S' - Sets a var - 'S', var, value

'Z' - Sets a var to random - 'S', var, min(included), max(not included)

'W' - Changes color - 'W',color

    0-white

    1-black

    2-red

    3-green

    4-blue

    5-cyan

    6-yellow

    7-gray

'?' - Sqrt - '?', var, var to find root

'_' - Power - '_', var, var as exponent

'~' - add value of var to var - '~', var to add to, var to add from

'`' - same as top except subtract

'$'- same as top except multiply

'@'- same as top except divide

'+' - add value to var - '+', var, value

`-'- same as top except subtract

'*'- same as top except multiply

'/'- same as top except divide

'D' - display pixel - 'D', var(x), var(y)

'4' - draw circle - '4', var(x), var(y), var(r)

'3' - same as above only filled

'2' - draw rectangle - '2', var(x), var(y), var(w), var(h)

'1' - same as above only filled

'N' - draw number - 'N', var(x), var(y), var(size), var to display

'0' - same as above only char not number

'P' - delay - 'P', time(millis)

0x0003 - if equals jump - 0x0003, var1, var2, index to jump to

0x0004 - same as above only less than

0x0005 - same as above only greater than

'V' - same as equals only value - 'V', var, value, index to jump

'J' - jump - 'J', index

'H' - open new file - 'H', char filename

'L' - same as 'V' only less than

'G' - same as above only greater than

'I' - if input - 'I', key('z', 'w', 'a', 's', 'd', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

';' - if touched - ';',rect start(x), rect start(y), rect end(x), rect end(y), index to jump

'K' - skip until 'Q' - no arguments

'Q' - end skip - no arguments

'E' - end programmed (not usually used jump to 0x0006) - no arguments


That is all the commands.


The easiest way to make the program I have found is in c++.

Code for pong in c++(outputs pong.gd):


#include <iostream>

#include <fstream>


using namespace std;


int main() {

unsigned short oldProg[] = { 'B', 'O', 'S',

'W', 4,

'S', 0, 0,

'S', 1, 240,

'1', 0, 0, 1, 1,

'W', 0,

'S', 4, 4,

'S', 3, 100,

'S', 2, 25,

'0', 2, 3, 4, 'P',

'+', 2, 50,

'0', 2, 3, 4, 'O',

'+', 2, 50,

'0', 2, 3, 4, 'N',

'+', 2, 50,

'0', 2, 3, 4, 'G',

'I', 'z', 0x0078,

'K',

'S', 98, 0,//5 - Enemy Score

'S', 99, 0,//6 - Player Score

'J', 0x008E,

'Q',

'J', 0x0070,


'C',

'S', 0, 95,

'S', 1, 50,

'0', 0, 1, 4, '3',

'P', 1000,

'+', 1, 50,

'0', 0, 1, 4, '2',

'P', 1000,

'+', 1, 50,

'0', 0, 1, 4, '1',

'P', 1000,


'C',

'S', 9, 120,

'S', 10, 120,

'S', 11, 2,

'S', 12, 2,

'S', 13, -3,

'S', 14, 0,

'S', 15, 50,

'S', 16, 150,

'S', 17, 50,

'S', 18, 4,

'S', 6, 0,

'S', 7, 209,

'S', 8, 0,

'S', 0, 0,

'S', 1, 90,

'S', 2, 4,

'S', 3, 30,

'S', 4, 235,

'S', 5, 0,

'W', 1,

'1', 9, 10, 11, 12,

'1', 0, 1, 2, 3,

'N', 15, 17, 18, 99,

'N', 16, 17, 18, 98,

'1', 4, 5, 2, 3,

5, 9, 4, 0x0202,

4, 9, 6, 0x0268,

5, 10, 4, 0x02CE,

4, 10, 6, 0x02E2,

3, 8, 6, 0x02FA,

5, 8, 6, 0x031C,

'I', 's', 0x033E,

'I', 'w', 0x035A,

'~', 9, 13,

'~', 10, 14,

'W', 0,

'1', 0, 1, 2, 3,

'1', 4, 5, 2, 3,

'N', 15, 17, 18, 99,

'N', 16, 17, 18, 98,

'W', 3,

'1', 9, 10, 11, 12,

'J', 0x0146,


5, 10, 5, 0x0222,

'+', 99, 1,

'S', 97, 6,

5, 99, 97, 0x0376,

'J', 0x00D2,

'+', 5, 30,

4, 10, 5, 0x024E,

'-', 5, 30,

'+', 99, 1,

'S', 97, 6,

5, 99, 97, 0x0376,

'J', 0x00D2,

'Z', 13, -6, -1,

'Z', 14, -6, 6,

'-', 5, 30,

'J', 0x019C,


5, 10, 1, 0x0288,

'+', 98, 1,

'S', 97, 6,

5, 98, 97, 0x03DA,

'J', 0x00D2,

'+', 1, 30,

4, 10, 1, 0x02B4,

'-', 1, 30,

'+', 98, 1,

'S', 97, 6,

5, 98, 97, 0x03DA,

'J', 0x00D2,

'Z', 13, 6, 1,

'Z', 14, -6, 6,

'-', 1, 30,

'J', 0x019C,


'Z', 13, -6, -6,

'Z', 14, -6, -1,

'J', 0x019C,


'Z', 13, -6, -6,

'Z', 14, 6, 1,

'J', 0x019C,


'C', 'E',


'+', 5, 16,

5, 5, 7, 0x030C,

'J', 0x01AC,

'S', 8, 1,

'S', 5, 209,

'J', 0x01AC,


'-', 5, 16,

4, 5, 6, 0x032E,

'J', 0x01AC,

'S', 8, 0,

'S', 5, 0,

'J', 0x01AC,


'+', 1, 16,

5, 1, 7, 0x0350,

'J', 0x01B8,

'S', 1, 209,

'J', 0x01B8,


'-', 1, 16,

4, 1, 6, 0x036C,

'J', 0x01B8,

'S', 1, 0,

'J', 0x01B8,


'C',

'W', 0,

'S', 2, 50,

'S', 3, 100,

'0', 2, 3, 18, 'W',

'+', 2, 25,

'0', 2, 3, 18, 'I',

'+', 2, 25,

'0', 2, 3, 18, 'N',

'+', 2, 25,

'0', 2, 3, 18, '!',

'+', 2, 25,

'0', 2, 3, 18, '!',

'P', 1000,

'J', 0x0006,


'C',

'W', 0,

'S', 2, 50,

'S', 3, 100,

'0', 2, 3, 18, 'L',

'+', 2, 25,

'0', 2, 3, 18, 'O',

'+', 2, 25,

'0', 2, 3, 18, 'S',

'+', 2, 25,

'0', 2, 3, 18, 'E',

'+', 2, 25,

'0', 2, 3, 18, '!',

'P', 1000,

'J', 0x0006,

};


ofstream out;

out.open("pong.gd", ios::binary | ios::out);

out.write((char*)&oldProg, sizeof(oldProg));

out.close();

}


Put that in main.cpp and compile it to create the pong.gd file.


That's all!! Thanks for reading!!