1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 12:38:05 +11:00

recipes/ti84: use the BASIC shell

This commit is contained in:
Virgil Dupras 2019-12-01 20:11:13 -05:00
parent 572e3566eb
commit 10864afa96
5 changed files with 45 additions and 14 deletions

View File

@ -1,5 +1,9 @@
# shell # 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 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 machine. It is not built to be user friendly, but to minimize binary space and
maximize code simplicity. maximize code simplicity.

View File

@ -8,6 +8,7 @@
## User guide ## User guide
* [The shell](../apps/shell/README.md) * [The shell](../apps/shell/README.md)
* [The BASIC shell](../apps/basic/README.md)
* [Load code in RAM and run it](load-run-code.md) * [Load code in RAM and run it](load-run-code.md)
* [Using block devices](blockdev.md) * [Using block devices](blockdev.md)
* [Using the filesystem](fs.md) * [Using the filesystem](fs.md)

View File

@ -51,6 +51,7 @@ init:
call aciaInit call aciaInit
ei ei
call basInit
jp basStart jp basStart

View File

@ -10,7 +10,7 @@ There is, however, a built-in USB controller that might prove very handy.
## Recipe ## 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. screen as output and its builtin keyboard as input.
## Gathering parts ## 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! 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 ## 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 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, on the current mode. In normal mode, it spits the digit/symbol. In Alpha mode,

View File

@ -37,19 +37,31 @@
.equ STDIO_PUTC lcdPutC .equ STDIO_PUTC lcdPutC
.inc "stdio.asm" .inc "stdio.asm"
; *** Shell *** ; *** BASIC ***
.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"
; 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: boot:
di di
ld hl, RAMEND ld sp, RAMEND
ld sp, hl
im 1 im 1
; enable ON key interrupt ; enable ON key interrupt
@ -67,12 +79,15 @@ boot:
halt halt
main: 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 kbdInit
call lcdInit call lcdInit
xor a xor a
call lcdSetCol call lcdSetCol
call shellInit jp basStart
jp shellLoop
handleInterrupt: handleInterrupt:
di di