chiark / gitweb /
Create readable text `.bas' for each tokenized BASIC `,ffb' file.
[ssr] / StraySrc / Sculptrix / sculptrix / sh / vString
1 ;
2 ; vString.sh
3 ;
4 ; Parses validation strings for Sculptrix
5 ;
6 ; © 1995-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sculptrix.
12 ;
13 ; Sculptrix is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sculptrix is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sculptrix.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ;  vString_read
32 ;  vString_find
33
34                 [       :LNOT::DEF:vString__dfn
35                 GBLL    vString__dfn
36
37 ; --- vString_read ---
38 ;
39 ; On entry:     R1 == pointer to an icon block
40 ;
41 ; On exit:      CS if there's a border, and
42 ;                 R0 == border info word
43 ;                 R2 == pointer to `inverted' flag byte
44 ;               else CC and
45 ;                 R0, R2 preserved
46 ;
47 ; Use:          Reads an icon's validation string, and extracts relevant
48 ;               information.  The border info word contains what sort of
49 ;               graphics we have to plot around the icon, and any special
50 ;               options thrown in.  A string (for group borders etc.) is
51 ;               copied into the misc buffer if one was found.
52 ;
53 ;               The syntax of a Sculptrix validation string is as follows:
54 ;
55 ;                 `xb'<type>[<flags>][`,'<text>]
56 ;
57 ;               The <type> is a letter which determines what sort of border
58 ;               is to be drawn.  The <flags> modify the style of the border
59 ;               slightly.  Note that if the <type> is uppercase, then the
60 ;               border is inverted.  The <text> is only required for group
61 ;               boxes (type `g').  An unknown <type> causes the icon to be
62 ;               ignored.  Unknown <flags> are ignored.  If no text is
63 ;               specified, a null string is assumed by default.  Spaces
64 ;               are allowed in various sensible places.
65
66                 IMPORT  vString_read
67
68 ; --- vString_find ---
69 ;
70 ; On entry:     R0 == character to find in block (not case-sensitive)
71 ;               R1 == pointer to icon block
72 ;               R2 == old pointer to search from, or 0
73 ;
74 ; On exit:      R0 == character forced to lower case
75 ;               CS if found, and
76 ;                 R2 points to command string
77 ;               else CC and
78 ;                 R2 corrupted
79 ;
80 ; Use:          Tries to find a validation string command in the given
81 ;               icon block.
82
83                 IMPORT  vString_find
84
85 ;----- Border codes and flags -----------------------------------------------
86
87                 ^       0
88 vsCode_simple   #       &0100                   ;A simple border
89 vsCode_group    #       &0100                   ;A group box border
90 vsCode_tns      #       &0100                   ;Text+sprite icon
91
92                 ^       0
93 vsBrd_action    #       1                       ;Standard action button
94 vsBrd_default   #       1                       ;Default action button
95 vsBrd_ridge     #       1                       ;A ridge type border
96 vsBrd_write     #       1                       ;A writable border
97 vsBrd_offset    #       1                       ;Offset pressed-in border
98
99 vsFlag_invert   EQU     (1<<31)                 ;Icon border is inverted
100 vsFlag_fade     EQU     (1<<30)                 ;Icon border is faded
101 vsFlag_slab     EQU     (1<<29)                 ;Icon may be slabbed
102
103                 ]
104
105 ;----- That's all, folks ----------------------------------------------------
106
107                 END