From 10864afa96f502da9cd89c2e62505a69061b4e0e Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 1 Dec 2019 20:11:13 -0500 Subject: [PATCH] recipes/ti84: use the BASIC shell --- apps/shell/README.md | 4 ++++ doc/README.md | 1 + recipes/rc2014/basic/glue.asm | 1 + recipes/ti84/README.md | 14 +++++++++++-- recipes/ti84/glue.asm | 39 ++++++++++++++++++++++++----------- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/apps/shell/README.md b/apps/shell/README.md index 990a032..3cf6b07 100644 --- a/apps/shell/README.md +++ b/apps/shell/README.md @@ -1,5 +1,9 @@ # shell +**This shell is currently being replaced with the +[BASIC shell](../basic/README.md). While it's still used in many places, it's +being phased out.** + The shell is a text interface giving you access to commands to control your machine. It is not built to be user friendly, but to minimize binary space and maximize code simplicity. diff --git a/doc/README.md b/doc/README.md index 9bbd03f..01aa08d 100644 --- a/doc/README.md +++ b/doc/README.md @@ -8,6 +8,7 @@ ## User guide * [The shell](../apps/shell/README.md) +* [The BASIC shell](../apps/basic/README.md) * [Load code in RAM and run it](load-run-code.md) * [Using block devices](blockdev.md) * [Using the filesystem](fs.md) diff --git a/recipes/rc2014/basic/glue.asm b/recipes/rc2014/basic/glue.asm index 0c10a01..edf417b 100644 --- a/recipes/rc2014/basic/glue.asm +++ b/recipes/rc2014/basic/glue.asm @@ -51,6 +51,7 @@ init: call aciaInit ei + call basInit jp basStart diff --git a/recipes/ti84/README.md b/recipes/ti84/README.md index b533744..3f58001 100644 --- a/recipes/ti84/README.md +++ b/recipes/ti84/README.md @@ -10,7 +10,7 @@ There is, however, a built-in USB controller that might prove very handy. ## Recipe -This recipe gets the Collapse OS shell to run on the TI-84+, using its LCD +This recipe gets the Collapse OS BASIC shell to run on the TI-84+, using its LCD screen as output and its builtin keyboard as input. ## Gathering parts @@ -66,9 +66,19 @@ Press "1" to continue. When this is done, you can press the ON button to see Collapse OS' prompt! +## Validation errors + +Sometimes, when uploading an upgrade file to your calculator, you'll get a +validation error. You can always try again, but in my own experience, some +specific binaries will simply always be refused by the calculator. Adding +random `nop` or reordering lines (when it makes sense, of course) should fix +the problem. + +I'm not sure whether it's a bug with the calculator or with `mktiupgrade`. + ## Usage -The shell works like a normal shell, but with very tight screen space. +The shell works like a normal BASIC shell, but with very tight screen space. When pressing a "normal" key, it spits the symbol associated to it depending on the current mode. In normal mode, it spits the digit/symbol. In Alpha mode, diff --git a/recipes/ti84/glue.asm b/recipes/ti84/glue.asm index 2f91c1d..e636473 100644 --- a/recipes/ti84/glue.asm +++ b/recipes/ti84/glue.asm @@ -37,19 +37,31 @@ .equ STDIO_PUTC lcdPutC .inc "stdio.asm" -; *** Shell *** -.inc "lib/util.asm" -.inc "lib/parse.asm" -.inc "lib/args.asm" -.inc "lib/stdio.asm" -.equ SHELL_RAMSTART STDIO_RAMEND -.equ SHELL_EXTRA_CMD_COUNT 0 -.inc "shell/main.asm" +; *** BASIC *** +; RAM space used in different routines for short term processing. +.equ SCRATCHPAD_SIZE 0x20 +.equ SCRATCHPAD STDIO_RAMEND +.inc "lib/util.asm" +.inc "lib/ari.asm" +.inc "lib/parse.asm" +.inc "lib/fmt.asm" +.equ EXPR_PARSE parseLiteralOrVar +.inc "lib/expr.asm" +.inc "basic/util.asm" +.inc "basic/parse.asm" +.inc "basic/tok.asm" +.equ VAR_RAMSTART SCRATCHPAD+SCRATCHPAD_SIZE +.inc "basic/var.asm" +.equ BUF_RAMSTART VAR_RAMEND +.inc "basic/buf.asm" +.equ BAS_RAMSTART BUF_RAMEND +.inc "basic/main.asm" + +.out BAS_RAMEND boot: di - ld hl, RAMEND - ld sp, hl + ld sp, RAMEND im 1 ; enable ON key interrupt @@ -67,12 +79,15 @@ boot: halt main: + ; Fun fact: if I place this line just above basStart like I would + ; normally do, my TI-84+ refuses to validate the binary. But placed + ; here, validation works fine. + call basInit call kbdInit call lcdInit xor a call lcdSetCol - call shellInit - jp shellLoop + jp basStart handleInterrupt: di