4 ; Plots borders given an icon block and a definition of the border shape
6 ; © 1995-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's Sculptrix.
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)
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.
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.
27 ;----- Overview -------------------------------------------------------------
33 [ :LNOT::DEF:border__dfn
38 ; On entry: R0 == pointer to border defintion
39 ; R1 == pointer to icon block
40 ; R2,R3 == window origin position
41 ; R4 == pointer to colour table
42 ; R5 == group box title width (optional)
43 ; R6 == group box title address (optional)
45 ; On exit: May return an error
47 ; Use: Plots a border using the border definition.
51 ;----- Command codes --------------------------------------------------------
53 ; We try to organise these in a way which makes it easy to decode. The
54 ; bottom two bits end up as an immediate operand in most cases, allowing us
55 ; to select entries in the icon bounding box easily.
60 bCmd_ret EQU {VAR} ;End border operation
63 bCmd_ldix0 EQU {VAR}+0 ;Fetch X0 of the icon
64 bCmd_ldiy0 EQU {VAR}+1 ;Fetch Y0 of the icon
65 bCmd_ldix1 EQU {VAR}+2 ;Fetch X1 of the icon
66 bCmd_ldiy1 EQU {VAR}+3 ;Fetch Y1 of the icon
69 bCmd_ldx0 EQU {VAR}+0 ;Fetch last stored X0
70 bCmd_ldy0 EQU {VAR}+1 ;Fetch last stored Y0
71 bCmd_ldx1 EQU {VAR}+2 ;Fetch last stored X1
72 bCmd_ldy1 EQU {VAR}+3 ;Fetch last stored Y1
75 bCmd_ldhc EQU {VAR}+0 ;Fetch horizontal centre
76 bCmd_ldvc EQU {VAR}+1 ;Fetch vertical centre
79 bCmd_add EQU {VAR}+0 ;Add next byte
80 bCmd_sub EQU {VAR}+1 ;Subtract next byte
83 bCmd_stx0 EQU {VAR}+0 ;Store as the X0 parameter
84 bCmd_sty0 EQU {VAR}+1 ;Store as the Y0 parameter
85 bCmd_stx1 EQU {VAR}+2 ;Store as the X1 parameter
86 bCmd_sty1 EQU {VAR}+3 ;Store as the Y1 parameter
89 bCmd_dark EQU {VAR}+0 ;Use the current `dark' col
90 bCmd_light EQU {VAR}+1 ;Use the current `light' col
91 bCmd_raw EQU {VAR}+2 ;Switch to uninverted colours
94 bCmd_icon EQU {VAR}+0 ;Set colours from icon
95 bCmd_indCol EQU {VAR}+1 ;Indirected colour
96 bCmd_litCol EQU {VAR}+2 ;Literal colour
99 bCmd_plot EQU {VAR}+0 ;Plot a rule (arg == branch)
102 bCmd_skpt EQU {VAR}+0 ;Skip past the `title'
105 bCmd_group EQU {VAR}+0 ;Plot a group box
108 bCmd_jmp EQU {VAR}+0 ;Jump to a routine
109 bCmd_call EQU {VAR}+1 ;Call subroutine
111 ;----- Macros ---------------------------------------------------------------
120 ; --- Load values ---
124 $label DCB bCmd_ldix0
129 $label DCB bCmd_ldiy0
134 $label DCB bCmd_ldix1
139 $label DCB bCmd_ldiy1
142 ; --- Load values ---
180 $label DCB bCmd_add,$val
185 $label DCB bCmd_sub,$val
193 ; --- Storing values ---
219 $label DCB bCmd_light
238 $label BINDCOL $colour
239 $label DCB bCmd_indCol,:INDEX:$colour
243 $label BLITCOL $colour
244 $label DCB bCmd_litCol,$colour
258 $label DCB bCmd_group
263 ; --- Subroutines ---
281 ;----- That's all, folks ----------------------------------------------------