Deleted Added
full compact
frames.4th (256281) frames.4th (281843)
1\ Words implementing frame drawing
2\ XXX Filled boxes are left as an exercise for the reader... ;-/
3\ $FreeBSD: stable/10/sys/boot/forth/frames.4th 244048 2012-12-09 15:25:34Z dteske $
1\ Copyright (c) 2003 Scott Long <scottl@FreeBSD.org>
2\ Copyright (c) 2012-2015 Devin Teske <dteske@FreeBSD.org>
3\ All rights reserved.
4\
5\ Redistribution and use in source and binary forms, with or without
6\ modification, are permitted provided that the following conditions
7\ are met:
8\ 1. Redistributions of source code must retain the above copyright
9\ notice, this list of conditions and the following disclaimer.
10\ 2. Redistributions in binary form must reproduce the above copyright
11\ notice, this list of conditions and the following disclaimer in the
12\ documentation and/or other materials provided with the distribution.
13\
14\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24\ SUCH DAMAGE.
25\
26\ $FreeBSD: stable/10/sys/boot/forth/frames.4th 281843 2015-04-22 01:08:40Z dteske $
4
5marker task-frames.4th
6
27
28marker task-frames.4th
29
30vocabulary frame-drawing
31only forth also frame-drawing definitions
32
33\ XXX Filled boxes are left as an exercise for the reader... ;-/
34
7variable h_el
8variable v_el
9variable lt_el
10variable lb_el
11variable rt_el
12variable rb_el
13variable fill
14
15\ ASCII frames (used when serial console is detected)
16 45 constant ascii_dash
35variable h_el
36variable v_el
37variable lt_el
38variable lb_el
39variable rt_el
40variable rb_el
41variable fill
42
43\ ASCII frames (used when serial console is detected)
44 45 constant ascii_dash
45 61 constant ascii_equal
17124 constant ascii_pipe
18 43 constant ascii_plus
19
20s" arch-pc98" environment? [if]
21 \ Single frames
22 149 constant sh_el
23 150 constant sv_el
24 152 constant slt_el

--- 31 unchanged lines hidden (view full) ---

56 \ Fillings
57 0 constant fill_none
58 32 constant fill_blank
59 176 constant fill_dark
60 177 constant fill_med
61 178 constant fill_bright
62[then]
63
46124 constant ascii_pipe
47 43 constant ascii_plus
48
49s" arch-pc98" environment? [if]
50 \ Single frames
51 149 constant sh_el
52 150 constant sv_el
53 152 constant slt_el

--- 31 unchanged lines hidden (view full) ---

85 \ Fillings
86 0 constant fill_none
87 32 constant fill_blank
88 176 constant fill_dark
89 177 constant fill_med
90 178 constant fill_bright
91[then]
92
93only forth definitions also frame-drawing
94
64: hline ( len x y -- ) \ Draw horizontal single line
65 at-xy \ move cursor
66 0 do
67 h_el @ emit
68 loop
69;
70
71: f_ascii ( -- ) ( -- ) \ set frames to ascii

--- 11 unchanged lines hidden (view full) ---

83 sv_el v_el !
84 slt_el lt_el !
85 slb_el lb_el !
86 srt_el rt_el !
87 srb_el rb_el !
88;
89
90: f_double ( -- ) \ set frames to double
95: hline ( len x y -- ) \ Draw horizontal single line
96 at-xy \ move cursor
97 0 do
98 h_el @ emit
99 loop
100;
101
102: f_ascii ( -- ) ( -- ) \ set frames to ascii

--- 11 unchanged lines hidden (view full) ---

114 sv_el v_el !
115 slt_el lt_el !
116 slb_el lb_el !
117 srt_el rt_el !
118 srb_el rb_el !
119;
120
121: f_double ( -- ) \ set frames to double
91 boot_serial? if f_ascii exit then
122 boot_serial? if
123 f_ascii
124 ascii_equal h_el !
125 exit
126 then
92 dh_el h_el !
93 dv_el v_el !
94 dlt_el lt_el !
95 dlb_el lb_el !
96 drt_el rt_el !
97 drb_el rb_el !
98;
99

--- 21 unchanged lines hidden (view full) ---

121 2dup 4 pick + at-xy lb_el @ emit \ Draw left bottom corner
122 2dup swap 5 pick + swap at-xy rt_el @ emit \ Draw right top corner
123 2 pick + swap 3 pick + swap at-xy rb_el @ emit
124 2drop
125;
126
127f_single
128fill_none fill !
127 dh_el h_el !
128 dv_el v_el !
129 dlt_el lt_el !
130 dlb_el lb_el !
131 drt_el rt_el !
132 drb_el rb_el !
133;
134

--- 21 unchanged lines hidden (view full) ---

156 2dup 4 pick + at-xy lb_el @ emit \ Draw left bottom corner
157 2dup swap 5 pick + swap at-xy rt_el @ emit \ Draw right top corner
158 2 pick + swap 3 pick + swap at-xy rb_el @ emit
159 2drop
160;
161
162f_single
163fill_none fill !
164
165only forth definitions