1 /*
2  *      Header file which will build the application DOR and all
3  *      that gubbins, most of it is already predefined, so you
4  *      may want to create your own hacked up version of this
5  *      if you need a special configuration
6  *
7  *      The default application type is AT_BAD|AT_DRAW and a default
8  *      of 8k required page
9  *
10  *      This file is somewhat bizarre in that we include it after
11  *      we define something - these defines are given to use via
12  *      including the file dor.h
13  *
14  *      You should supply all the variables defined in the #ifndef
15  *      clauses below, if not, you'll end up with the defaults!
16  *
17  *      7/4/99 djm Commands and topics now supported -see command?.h
18  *      for details on these brutes...it ain't fun!!
19  *
20  *	Packages are now supported (work for 16k packages)
21  *
22  *	$Id: application.h,v 1.10 2016-07-14 07:03:33 dom Exp $
23  */
24 
25 #ifndef HELP1
26         #define HELP1 "An application made with the z88dk"
27         #define HELP2 "For more information on the z88dk"
28         #define HELP3 "See http://www.z88dk.org"
29 #endif
30 
31 #ifndef HELP2
32         #define HELP2 ""
33 #endif
34 
35 #ifndef HELP3
36         #define HELP3 ""
37 #endif
38 
39 #ifndef HELP4
40         #define HELP4 ""
41 #endif
42 
43 #ifndef HELP5
44         #define HELP5 ""
45 #endif
46 
47 #ifndef HELP6
48         #define HELP6 ""
49 #endif
50 
51 
52 #ifndef APP_INFO
53         #define APP_INFO "Made by z88dk"
54 #endif
55 
56 #ifndef APP_NAME
57         #define APP_NAME "z88dkapp"
58 #endif
59 
60 #ifndef APP_KEY
61         #define APP_KEY 'A'
62 #endif
63 
64 #ifndef APP_TYPE
65         #define APP_TYPE AT_Def
66 #endif
67 
68 #ifndef APP_TYPE2
69         #define APP_TYPE2 AT2_Cl
70 #endif
71 
72 
73 /*
74  * Some macros which do our generation for us
75  */
76 
77 #define APPLBYTE(b)     defb    b
78 
79 #define APPLNAME(b)     defm    b, 0
80 
81 #define HELPTEXT(b)     defm    b, 127
82 
83 #define APPLTEXT(b)     defm    b
84 
85 
86 
application_dor(void)87 void application_dor(void)
88 {
89 #pragma asm
90 ; Here we go, with lots of assembler!
91         INCLUDE "dor.def"
92 
93         EXTERN    app_entrypoint  ; The real starting point for our apps
94         PUBLIC    applname        ; So startup can pick it up
95         PUBLIC    in_dor
96         PUBLIC    in_dor_seg_setup
97 	PUBLIC	in_dor_seg0
98 	PUBLIC	in_dor_seg1
99 	PUBLIC	in_dor_seg2
100 	PUBLIC	in_dor_seg3
101 
102 
103 .application_dor_entrypoint
104         jp      app_entrypoint
105 	defs	8		;enquire_entry - written by appmake
106 
107 ; Initally let us consider only single bank applications
108 
109         defc    in_bank = 63
110 
111 ; Application DOR
112 
113 .in_dor defb    0,0,0   ; links to parent, brother, son
114         defb    0,0,0	; brother
115 /* Packages use the son DOR link */
116 #ifdef MAKE_PACKAGE
117 	defw	in_package_dor
118 	defb	in_bank
119 #else
120         defw    0       ;brother_add
121         defb    0       ;brother_bank
122 #endif
123         defb    $83     ; DOR type - application
124         defb    indorend-indorstart
125 .indorstart
126         defb    '@'     ; key to info section
127         defb    ininfend-ininfstart
128 .ininfstart
129         defw    0
130         APPLBYTE(APP_KEY)
131 .in_dor_reqpag
132 	defb	0		; set by appmake
133         defw    0       ; overhead
134         defw    0       ; unsafe workspace
135 .in_dor_safedata
136         defw    0 	; safe workspace (used for startup vars)
137                         ; and user specifed safe data (patched by appmake)
138         defw    application_dor_entrypoint   ; entry point
139 ; These are set up by appmake, but we can define top for certain
140 .in_dor_seg_setup
141 .in_dor_seg0
142         defb    0       ; segment bindings
143 .in_dor_seg1
144         defb    0
145 .in_dor_seg2
146         defb    0
147 .in_dor_seg3
148         defb    in_bank
149 .in_dor_app_type
150         APPLBYTE(APP_TYPE)      ; at_bad etc
151         APPLBYTE(APP_TYPE2)     ;caps lock
152 .ininfend       defb    'H'     ; key to help section
153         defb    inhlpend-inhlpstart
154 .inhlpstart     defw    in_topics
155         defb    in_bank
156         defw    in_commands
157         defb    in_bank
158         defw    in_help
159         defb    in_bank
160         defb    0,0,0   ; no tokens
161 .inhlpend       defb    'N'     ; key to name section
162         defb    innamend-innamstart
163 .innamstart
164         APPLNAME(APP_NAME)
165 .innamend       defb    $ff
166 .indorend
167 
168 ; topics, shoved in header file to make this one more readable!
169 
170 .in_topics      defb    0
171 
172 #include <oz/command0.h>
173 
174 ; end marker for end of topics
175 
176 .incom_topend
177         defb    0
178 
179 /*
180  *      Command entries, to keep the file smaller, included
181  */
182 
183 .in_commands    defb    0
184 
185 #include        <oz/command1.h>
186 #include        <oz/command2.h>
187 #include        <oz/command3.h>
188 #include        <oz/command4.h>
189 #include        <oz/command5.h>
190 #include        <oz/command6.h>
191 #include        <oz/command7.h>
192 
193 
194 .in_coms_end    defb    0       ;end marker
195 
196 
197 ; Help entries
198 
199 .in_help        defb    $7f
200         HELPTEXT(HELP1)
201         HELPTEXT(HELP2)
202         HELPTEXT(HELP3)
203         HELPTEXT(HELP4)
204         HELPTEXT(HELP5)
205         HELPTEXT(HELP6)
206         defb    0
207 /*
208  * Help files for commands and topics, help0.h is for topics, rest are for
209  * commands for topic n - we assume that there isn't more than 8k of em, if
210  * there is then the whole DOR collapses!
211  */
212 #include <oz/help0.h>
213 #include <oz/help1.h>
214 #include <oz/help2.h>
215 #include <oz/help3.h>
216 #include <oz/help4.h>
217 #include <oz/help5.h>
218 #include <oz/help6.h>
219 #include <oz/help7.h>
220 .applname
221         APPLNAME(APP_INFO)
222 #pragma endasm
223 }
224 
225 
226 
227