1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
23 //#if !defined(__LARGE__) && !defined(__COMPACT__) && !defined(__HUGE__)
\r
24 //#error Invalid memory model for compiling project 16
\r
27 #if !defined(__i86__) && defined(__i386__)
\r
31 #ifndef __16_HEAD_H__
\r
32 #define __16_HEAD_H__
\r
36 #include <conio.h> // this is where Open Watcom hides the outp() etc. functions // just for wait
\r
37 #include <time.h> // just for wait
\r
41 #include <sys/stat.h>
\r
46 #include <process.h>
\r
51 #include <stdint.h> //16_vrs.h
\r
58 #include "src/lib/16_t.h"
\r
59 #include "src/lib/16_tdef.h"
\r
60 #include "src/lib/nyan/kitten.h"
\r
62 #define VERSION __DATE__ " " __TIME__
\r
64 /* Control codes for all keys on the keyboard */
\r
67 #define KEY_A (0x1E)
\r
68 #define KEY_B (0x30)
\r
69 #define KEY_C (0x2E)
\r
70 #define KEY_D (0x20)
\r
71 #define KEY_E (0x12)
\r
72 #define KEY_F (0x21)
\r
73 #define KEY_G (0x22)
\r
74 #define KEY_H (0x23)
\r
75 #define KEY_I (0x17)
\r
76 #define KEY_J (0x24)
\r
77 #define KEY_K (0x25)
\r
78 #define KEY_L (0x26)
\r
79 #define KEY_M (0x32)
\r
80 #define KEY_N (0x31)
\r
81 #define KEY_O (0x18)
\r
82 #define KEY_P (0x19)
\r
83 #define KEY_Q (0x10)
\r
84 #define KEY_R (0x13)
\r
85 #define KEY_S (0x1F)
\r
86 #define KEY_T (0x14)
\r
87 #define KEY_U (0x16)
\r
88 #define KEY_V (0x2F)
\r
89 #define KEY_W (0x11)
\r
90 #define KEY_X (0x2D)
\r
91 #define KEY_Y (0x15)
\r
92 #define KEY_Z (0x2C)
\r
93 #define KEY_1 (0x02)
\r
94 #define KEY_2 (0x03)
\r
95 #define KEY_3 (0x04)
\r
96 #define KEY_4 (0x05)
\r
97 #define KEY_5 (0x06)
\r
98 #define KEY_6 (0x07)
\r
99 #define KEY_7 (0x08)
\r
100 #define KEY_8 (0x09)
\r
101 #define KEY_9 (0x0A)
\r
102 #define KEY_0 (0x0B)
\r
103 #define KEY_DASH (0x0C) // -_
\r
104 #define KEY_EQUAL (0x0D) // =+
\r
105 #define KEY_LBRACKET (0x1A) // [{
\r
106 #define KEY_RBRACKET (0x1B) // ]}
\r
107 #define KEY_SEMICOLON (0x27) // ;:
\r
108 #define KEY_RQUOTE (0x28) // '"
\r
109 #define KEY_LQUOTE (0x29) // `~
\r
110 #define KEY_PERIOD (0x33) // .>
\r
111 #define KEY_COMMA (0x34) // ,<
\r
112 #define KEY_SLASH (0x35) // /?
\r
113 #define KEY_BACKSLASH (0x2B) // \|
\r
114 #define KEY_F1 (0x3B)
\r
115 #define KEY_F2 (0x3C)
\r
116 #define KEY_F3 (0x3D)
\r
117 #define KEY_F4 (0x3E)
\r
118 #define KEY_F5 (0x3F)
\r
119 #define KEY_F6 (0x40)
\r
120 #define KEY_F7 (0x41)
\r
121 #define KEY_F8 (0x42)
\r
122 #define KEY_F9 (0x43)
\r
123 #define KEY_F10 (0x44)
\r
124 #define KEY_ESC (0x01)
\r
125 #define KEY_BACKSPACE (0x0E)
\r
126 #define KEY_TAB (0x0F)
\r
127 #define KEY_ENTER (0x1C)
\r
128 #define KEY_CONTROL (0x1D)
\r
129 #define KEY_LSHIFT (0x2A)
\r
130 #define KEY_RSHIFT (0x36)
\r
131 #define KEY_PRTSC (0x37)
\r
132 #define KEY_ALT (0x38)
\r
133 #define KEY_SPACE (0x39)
\r
134 #define KEY_CAPSLOCK (0x3A)
\r
135 #define KEY_NUMLOCK (0x45)
\r
136 #define KEY_SCROLLLOCK (0x46)
\r
137 #define KEY_HOME (0x47)
\r
138 #define KEY_UP (0x48)
\r
139 #define KEY_PGUP (0x49)
\r
140 #define KEY_MINUS (0x4A)
\r
141 #define KEY_LEFT (0x4B)
\r
142 #define KEY_CENTER (0x4C)
\r
143 #define KEY_RIGHT (0x4D)
\r
144 #define KEY_PLUS (0x4E)
\r
145 #define KEY_END (0x4F)
\r
146 #define KEY_DOWN (0x50)
\r
147 #define KEY_PGDOWN (0x51)
\r
148 #define KEY_INS (0x52)
\r
149 #define KEY_DEL (0x53)
\r
151 #define KEY_LWIN (0x73)
\r
152 #define KEY_RWIN (0x74)
\r
153 #define KEY_MENU (0x75)
\r
156 //static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
\r
157 extern int profilehandle,debughandle; //make it into game global
\r
161 #define nil ((void *)0)
\r
164 //----#define _FCORELEFT 0x90000UL+16UL
\r
165 extern union REGS CPURegs;
\r
167 #define _AX CPURegs.x.ax
\r
168 #define _BX CPURegs.x.bx
\r
169 #define _CX CPURegs.x.cx
\r
170 #define _DX CPURegs.x.dx
\r
172 #define _SI CPURegs.x.si
\r
174 #define _AH CPURegs.h.ah
\r
175 #define _AL CPURegs.h.al
\r
176 #define _BH CPURegs.h.bh
\r
177 #define _BL CPURegs.h.bl
\r
178 #define _CH CPURegs.h.ch
\r
179 #define _CL CPURegs.h.cl
\r
180 #define _DH CPURegs.h.dh
\r
181 #define _DL CPURegs.h.dl
\r
183 #define geninterrupt(n) int86(n,&CPURegs,&CPURegs);
\r
186 typedef union REGPACK regs_t;
\r
189 // local function //
\r
190 long int filesize(FILE *fp);
\r
192 char *remove_ext(char* mystr, char dot, char sep);
\r
193 void rotateR(byte arr[], byte n);
\r
194 void rotateL(byte arr[], byte n);
\r
195 void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free);
\r
196 int US_CheckParm(char *parm,char **strings);
\r
197 byte dirchar(byte in);
\r
198 void print_mem(void const *vp, size_t n);
\r
201 #define PRINT_OPAQUE_STRUCT(p) print_mem((p), sizeof(*(p)))
\r
203 #endif/*__16_HEAD_H__*/
\r