Skip to content

Commit

Permalink
test in minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismael-VC committed Dec 10, 2024
1 parent bd6c616 commit c03a5f3
Show file tree
Hide file tree
Showing 45 changed files with 5,594 additions and 175 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ rom/*

# Debugging
config/options.tal
src/repl/routines.tal
src/debugger/routines/after-eval.tal
src/debugger/routines/before-eval.tal
src/repl/data.tal
src/talos/main.tal
src/talos/macros.tal
23 changes: 14 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ if [ -z "$DEBUG" ]; then
DEBUG="NO_DBG"
fi

# Sorry
cpp -P -w -D $DEBUG config/options.talp -o config/options.tal
cpp -P -w -D $DEBUG src/debugger/routines/after-eval.talp \
-o src/debugger/routines/after-eval.tal
cpp -P -w -D $DEBUG src/debugger/routines/before-eval.talp \
-o src/debugger/routines/before-eval.tal
cpp -P -w -D $DEBUG src/repl/data.talp -o src/repl/data.tal
cpp -P -w -D $DEBUG src/talos/main.talp -o src/talos/main.tal
cpp -P -w -D $DEBUG src/talos/macros.talp -o src/talos/macros.tal
jinja2 --format yaml config/options.tal.tpl \
-o config/options.tal config.yaml
jinja2 --format yaml src/repl/routines.tal.tpl \
-o src/repl/routines.tal config.yaml
jinja2 --format yaml src/debugger/routines/after-eval.tal.tpl \
-o src/debugger/routines/after-eval.tal config.yaml
jinja2 --format yaml src/debugger/routines/before-eval.tal.tpl \
-o src/debugger/routines/before-eval.tal config.yaml
jinja2 --format yaml src/repl/data.tal.tpl \
-o src/repl/data.tal config.yaml
jinja2 --format yaml src/talos/main.tal.tpl \
-o src/talos/main.tal config.yaml
jinja2 --format yaml src/talos/macros.tal.tpl \
-o src/talos/macros.tal config.yaml

# Build
mkdir -p rom
Expand Down
64 changes: 64 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
print_banner: true # Print TalOS banner on startup.
ansi_escapes: false # Support for ANSI escape sequences.
redstone_device: true # Define MineCraft's Redstone device.

logger:
level: debug # From least to most verbose: `off` `info` `warn` or `debug`.

info:
stacks: true # Print stacks after each evaluation.
prompt: true # Print the heap's `head` pointer inside the prompt.
summary: true # Print the assembled definition summary.

warn:
abort: true # Warn each time an evaluation is aborted.
redef: true # Warn on each redefinition.

debug:
input: false # Print the input buffer.
length: false # Print the assembled bytecode `length`.
head: false # Print the head bytecode.
head_ptr: false # Print the head pointer.
tail: false # Print the tail symbols.
tail_ptr: false # Print the tail pointer.

theme:
# RGB in decimal.
tui:
red:
# 16-bit 32-bit Decimal
# Default: 3ce9 33ccee99 (51, 204, 238, 153)
background: 51
foreground: 204
emphasis: 238
error: 153

green:
# 16-bit 32-bit Decimal
# Default: 0b75 00bb7755 (0, 187, 119, 34)
background: 0
foreground: 187
emphasis: 119
error: 85

blue:
# 16-bit 32-bit Decimal
# Default: 2b59 22bb5599 (34, 187, 55, 68)
background: 34
foreground: 187
emphasis: 55
error: 153

# RGB in hexadecimal.
gui:
# Default
# 16-bit 24-bit Decimal
# background #302 #330022 (51, 0, 34)
# |foreground #cbb #ccbbbb (204, 187, 187)
# ||emphasis #e75 #ee7755 (238, 119, 55)
# |||error #959 #995599 (153, 0, 68)
# ||||
# vvvv )
red: 3ce9
green: 0b75
blue: 2b59
33 changes: 33 additions & 0 deletions config/options.tal.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% if print_banner %}ENABLE{% else %}DISABLE{% endif %} @PRINT-BANNER

( GUI )
%\RED { #{{ theme.gui.red }} }
%\GREEN { #{{ theme.gui.green }} }
%\BLUE { #{{ theme.gui.blue }} }

( TUI )
%\BACKGROUND { "{{ theme.tui.red.background }}; "{{ theme.tui.green.background }}; "{{ theme.tui.blue.background }} }
%\FOREGROUND { "{{ theme.tui.red.foreground }}; "{{ theme.tui.green.foreground }}; "{{ theme.tui.blue.foreground }} }
%\EMPHASIS { "{{ theme.tui.red.emphasis }}; "{{ theme.tui.green.emphasis }}; "{{ theme.tui.blue.emphasis }} }
%\ERROR { "{{ theme.tui.red.error }}; "{{ theme.tui.green.error }}; "{{ theme.tui.blue.error }} }

( LOGGER )
{{ logger.level | upper }} @LOG-LEVEL

( INFO )
{% if logger.info.stacks %}ENABLE{% else %}DISABLE{% endif %} @INFO-STACKS
{% if logger.info.prompt %}ENABLE{% else %}DISABLE{% endif %} @INFO-PROMPT
{% if logger.info.summary %}ENABLE{% else %}DISABLE{% endif %} @INFO-SUMMARY

( WARN )
{% if logger.warn.abort %}ENABLE{% else %}DISABLE{% endif %} @WARN-ABORT
{% if logger.warn.redef %}ENABLE{% else %}DISABLE{% endif %} @WARN-REDEF
{% if logger.level == "debug" %}
( DEBUG )
{% if logger.debug.length %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-LENGTH
{% if logger.debug.head_ptr %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-HEAD-PTR
{% if logger.debug.tail_ptr %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-TAIL-PTR
{% if logger.debug.input %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-INPUT
{% if logger.debug.heap %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-HEAD
{% if logger.debug.symbols %}ENABLE{% else %}DISABLE{% endif %} @DEBUG-TAIL
{% endif %}
69 changes: 0 additions & 69 deletions config/options.talp

This file was deleted.

27 changes: 27 additions & 0 deletions etc/assets/dis.tal
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@Main
|0100 ( a0 1214 ... ) ;meta
|0103 ( 80 06 .. ) #06
|0105 ( 37 7 ) DEO2

|0106 ( a0 1ac0 ... ) ;tail/end
|0109 ( a0 1313 ... LIT2 1313 #1313 ) ;tail
|010c ( 39 9 ) SUB2
|010d ( af . ) STH2k
|010e ( a0 00 00 ... ) LIT2 0000
|0111 ( a0 1313 ... ) LIT2 1313
|0114 ( a0 0000 ... ) LIT2 0000

|0117 ( a0 fb40 ..@ ) LIT2 fb40
|011a ( ef . ) STH2kr
|011b ( 39 9 ) SUB2
|011c ( af . ) STH2k
|011d ( 60 ` ) 60
|011e ( 0b . ) LTH
|011f ( 34 4 ) LDA2
|0120 ( 64 d ) SWP2r
|0121 ( 6f o ) STH2r
|0122 ( a0 00 00 ... ) LIT2 0000
|0125 ( a0 13 13 ... ) LIT2 1313
|0128 ( 60 ` ) 60
|0129 ( 0b . ) LTH
|012a ( 11 . ) STZ
18 changes: 9 additions & 9 deletions lib/string/macros.tal
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
%\italic { \CSI "3m }
%\underline { \CSI "4m }

%\bg-0 { \CSI "48;2; \color-0 "m }
%\bg-1 { \CSI "48;2; \color-1 "m }
%\bg-2 { \CSI "48;2; \color-2 "m }
%\bg-3 { \CSI "48;2; \color-3 "m }

%\fg-0 { \CSI "38;2; \color-0 "m }
%\fg-1 { \CSI "38;2; \color-1 "m }
%\fg-2 { \CSI "38;2; \color-2 "m }
%\fg-3 { \CSI "38;2; \color-3 "m }
%\bg-0 { \CSI "48;2; \BACKGROUND "m }
%\bg-1 { \CSI "48;2; \FOREGROUND "m }
%\bg-2 { \CSI "48;2; \EMPHASIS "m }
%\bg-3 { \CSI "48;2; \ERROR "m }

%\fg-0 { \CSI "38;2; \BACKGROUND "m }
%\fg-1 { \CSI "38;2; \FOREGROUND "m }
%\fg-2 { \CSI "38;2; \EMPHASIS "m }
%\fg-3 { \CSI "38;2; \ERROR "m }

%\reset-console-style { \CSI "m }
%\reset-console-cursor { \CSI "H }
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions node_modules/json5/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c03a5f3

Please sign in to comment.