Skip to content

Commit

Permalink
docs: add topic languages
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoDornelles committed Nov 5, 2024
1 parent 9c9fb18 commit 39cf3b4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
59 changes: 59 additions & 0 deletions docs/lang_esc_g.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@defgroup Languages
@{

@defgroup lang_esc_g ESC G
@{

@par Backus–Naur Form
@startebnf
protocol_esc_g = esc, "G", command (* 7 bits *), size (* MSB command\ndefines x1024 *), [ buffer ], checksum (* DJB2 *);
esc = "\x1b";
command = byte;
size = byte;
buffer = 4 * byte | 1024 * byte;
checksum = 4 * byte;
@endebnf

@par Commands

| | command name | parameters | sizes in bytes|
| :-: | :------------- | :-------------- | :------------ |
| 0 | hello | | 0 |
| 1 | hdmi cec | command | 4..20 |
| 2 | press menu key | | 0 |
| 3 | gamepad update | z,x,c,v,w,a,s,d | 8 |
| 44 | set img index | index,type,w,h | 4 or 8 |
| 45 | update image | image | 0..254000 |
| 46 | set text index | index | 4 |
| 47 | update text | text | 0..254000 |
| 48 | draw mode | m1, m2, s1, s2 | 4 |
| 49 | draw color | r, g, b, a | 4 |
| 50 | draw rect | x, y, w, h | 4, 8 or 16 |
| 51 | draw line | x1, y1, x2, y2 | 4, 8 or 16 |
| 52 | draw text | x, y, id, size | 4 |
| 52 | draw image | x, y, id | 4 |
| 64..127 | custom | | 0..254000 |

@par Modes

@li @b 0 tint fill
@li @b 1 tint frame
@li @b 2 tint open
@li @b 4 tint save
@li @b 5 erase fill
@li @b 6 erase frame
@li @b 7 erase open

@par Image Types

@li @b 0 RGB 15bits
@li @b 1 RGBA 32bits
@li @b 2 BMP
@li @b 3 PNG

@par Examples

@li @c std.draw.clear(0xAABBCCDD) @n ESC G 0x48 0x00000003 0x00000000 @n ESC G 0x49 0x01 0xAABBCCDD 0x00000000 @n ESC G 0x50 0x01 0x0000FFFFF 0x00000000

@}
@}
17 changes: 15 additions & 2 deletions src/engine/core/repl/main.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
--! @short Read Eval Print Loop
--! @brief an interpreter to debuging the game via stdio.
--! @defgroup Languages
--! @{
--!
--! @defgroup REPL
--! @{
--!
--! @par Extended Backus-Naur Form
--! @startebnf
--! line = exit | frame_skip | [frame_skip], variable, ["=", value (* assignment *)];
--! frame_skip = [digit], "!" ;
--! digit = { ? 0 - 9 ? }- ;
--! exit = "?" ;
--! @endebnf
--!
--! @par Usage
--! @code{.sql}
--! lua cli.lua run game.lua --core repl
--! @endcode
--!
--! @}
--! @}

local zeebo_module = require('src/lib/common/module')
--
local engine_encoder = require('src/lib/engine/api/encoder')
Expand Down

0 comments on commit 39cf3b4

Please sign in to comment.