Couple of extra nethack->anethack
[aNetHack.git] / sys / amiga / windefs.h
blob1f300fb00780a8255aa9211e420ed058a147eb89
1 /* aNetHack 0.0.1 windefs.h $ANH-Date: 1432512795 2015/05/25 00:13:15 $ $ANH-Branch: master $:$ANH-Revision: 1.7 $ */
2 /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
3 /* aNetHack may be freely redistributed. See license for details. */
5 #include <exec/types.h>
6 #include <exec/memory.h>
7 #include <exec/io.h>
8 #if !defined(_DCC) && !defined(__GNUC__)
9 #include <dos.h>
10 #endif
11 #include <exec/alerts.h>
12 #include <exec/devices.h>
13 #include <exec/execbase.h>
14 #include <devices/console.h>
15 #include <devices/conunit.h>
16 #include <graphics/gfxbase.h>
17 #include <intuition/intuition.h>
18 #include <intuition/intuitionbase.h>
19 #include <libraries/gadtools.h>
20 #include <libraries/dosextens.h>
21 #include <libraries/asl.h>
22 /* stddef.h is included in the precompiled version of hack.h . If we include
23 * it here normally (through string.h) we'll get an "illegal typedef" later
24 * on. This is the easiest way I can think of to fix it without messing
25 * around with the rest of the #includes. --AMC
27 #if defined(_DCC) && !defined(HACK_H)
28 #define ptrdiff_t ptrdiff_t_
29 #define size_t size_t_
30 #define wchar_t wchar_t_
31 #endif
32 #include <ctype.h>
33 #undef strcmpi
34 #include <string.h>
35 #include <errno.h>
36 #if defined(_DCC) && !defined(HACK_H)
37 #undef ptrdiff_t
38 #undef size_t
39 #undef wchar_T
40 #endif
42 #ifdef IDCMP_CLOSEWINDOW
43 #ifndef INTUI_NEW_LOOK
44 #define INTUI_NEW_LOOK
45 #endif
46 #endif
48 #ifndef HACK_H
49 #include "hack.h"
50 #endif
51 #include "wintype.h"
52 #include "winami.h"
53 #include "func_tab.h"
55 #ifndef CLIPPING
56 CLIPPING must be defined for the AMIGA version
57 #endif
59 #undef LI
60 #undef CO
62 /*#define TOPL_GETLINE /* Don't use a window for getlin() */
63 /*#define WINDOW_YN /* Use a window for y/n questions */
65 #ifdef AZTEC_C
66 #include <functions.h>
67 #else
68 #ifdef _DCC
69 #include <clib/dos_protos.h>
70 #include <clib/exec_protos.h>
71 #include <clib/console_protos.h>
72 #include <clib/layers_protos.h>
73 #include <clib/diskfont_protos.h>
74 #include <clib/gadtools_protos.h>
75 #else
76 #include <proto/dos.h>
77 #include <proto/exec.h>
78 #include <proto/console.h>
79 #include <proto/layers.h>
80 #include <proto/diskfont.h>
81 #include <proto/gadtools.h>
82 #include <proto/asl.h>
83 #endif
85 /* kludge - see amirip for why */
86 #undef red
87 #undef green
88 #undef blue
89 #ifdef _DCC
90 #include <clib/graphics_protos.h>
91 #else
92 #include <proto/graphics.h>
93 #endif
95 #ifdef _DCC
96 #define __asm /* DICE doesn't like __asm */
97 #endif
99 #ifndef __SASC_60
100 #undef index
101 #define index strchr
102 #endif
104 #ifdef _DCC
105 #include <clib/intuition_protos.h>
106 #else
107 #include <proto/intuition.h>
108 #endif
109 #endif
111 #ifdef SHAREDLIB
112 #include "NH:sys/amiga/lib/libmacs.h"
113 #endif
115 #ifdef INTUI_NEW_LOOK
116 #include <utility/tagitem.h>
117 #endif
119 #define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0)
120 #define WINVERS_AMIV (strcmp("amitile", windowprocs.name) == 0)
121 #define WINVERS_AMIT (strcmp("amitty", windowprocs.name) == 0)
123 /* cw->data[x] contains 2 characters worth of special information. These
124 * characters are stored at the offsets as described here.
126 #define VATTR 0 /* Video attribute is in this slot */
127 #define SEL_ITEM 1 /* If this is a select item, slot is 1 else 0 */
128 #define SOFF 2 /* The string starts here. */
130 #undef NULL
131 #define NULL 0L
134 * Versions we need of various libraries. We can't use LIBRARY_VERSION
135 * as defined in <exec/types.h> because some of the libraries we need
136 * don't have that version number in the 1.2 ROM.
139 #define LIBRARY_FONT_VERSION 34L
140 #define LIBRARY_TILE_VERSION 37L
142 /* These values are just sorta suggestions in use, but are minimum
143 * requirements
144 * in reality...
146 #define WINDOWHEIGHT 192
147 #define SCREENHEIGHT 200
148 #define WIDTH 640
150 /* This character is a solid block (cursor) in Hack.font */
151 #define CURSOR_CHAR 0x90
153 #define FONTHEIGHT 8
154 #define FONTWIDTH 8
155 #define FONTBASELINE 8
157 #define MAPFTWIDTH 8
158 #define MAPFTHEIGHT 8
159 #define MAPFTBASELN 6
161 /* If Compiling with the "New Look", redefine these now */
162 #ifdef INTUI_NEW_LOOK
163 #define NewWindow ExtNewWindow
164 #define NewScreen ExtNewScreen
165 #endif
167 #define SIZEOF_DISKNAME 8
169 #define CSI '\x9b'
170 #define NO_CHAR -1
171 #define RAWHELP 0x5F /* Rawkey code of the HELP key */
173 #define C_BLACK 0
174 #define C_WHITE 1
175 #define C_BROWN (WINVERS_AMIV ? 11 : 2)
176 #define C_CYAN (WINVERS_AMIV ? 2 : 3)
177 #define C_GREEN (WINVERS_AMIV ? 5 : 4)
178 #define C_MAGENTA (WINVERS_AMIV ? 10 : 5)
179 #define C_BLUE (WINVERS_AMIV ? 4 : 6)
180 #define C_RED 7
181 #define C_ORANGE 3
182 #define C_GREY 6
183 #define C_LTGREEN 8
184 #define C_YELLOW 9
185 #define C_GREYBLUE 12
186 #define C_LTBROWN 13
187 #define C_LTGREY 14
188 #define C_PEACH 15
190 /* Structure describing tile files */
191 struct PDAT
193 long nplanes; /* Depth of images */
194 long pbytes; /* Bytes in a plane of data */
195 long across; /* Number of tiles across */
196 long down; /* Number of tiles down */
197 long npics; /* Number of pictures in this file */
198 long xsize; /* X-size of a tile */
199 long ysize; /* Y-size of a-tile */
202 #undef MAXCOLORS
203 #define MAXCOLORS 256