Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sail / sh / termScript
1 ;
2 ; termScript.sh
3 ;
4 ; Coroutine handling for Termite Script
5 ;
6 ; © 1995 Straylight
7 ;
8
9 ;----- Overview -------------------------------------------------------------
10 ;
11 ; Functions provided:
12 ;
13 ; sail_wait
14 ; sail_end
15 ; sail_error
16
17 [ :LNOT::DEF:termScript__dfn
18 GBLL termScript__dfn
19
20 ; --- sail_wait ---
21 ;
22 ; On entry: --
23 ;
24 ; On exit: R0, R1, R2 == event and arguments from Termite
25 ;
26 ; Use: Waits for some multitasking and gets something from Termite.
27
28 IMPORT sail_wait
29
30 ; --- sail_end ---
31 ;
32 ; On entry: R0 == pointer to script to chain, 0 to just end, or -1 for
33 ; FINISH
34 ;
35 ; On exit: Doesn't, hopefully
36 ;
37 ; Use: Ends the script, optionally starting up another one.
38
39 IMPORT sail_end
40
41 ; --- sail_error ---
42 ;
43 ; On entry: R0 == pointer to error block
44 ;
45 ; On exit: Doesn't, probably
46 ;
47 ; Use: Returns an error to Termite.
48
49 IMPORT sail_error
50
51 ; --- Event codes returned by sail_wait ---
52
53 ^ 0
54
55 tscEvent_poll # 1 ;Nothing interesting happened
56
57 tscEvent_serial # 1 ;Serial input received
58 ;R1 == address of block
59 ;R2 == size of block
60
61 tscEvent_key # 1 ;User pressed a key
62 ;R1 == key number (from WIMP)
63
64 ]
65
66 ;----- That's all, folks ----------------------------------------------------
67
68 END