1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2016 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 * Just some handy typedefs that make it easier to think about the low
\r
30 typedef unsigned char byte;
\r
31 typedef unsigned short word;
\r
32 typedef unsigned long dword;
\r
33 typedef signed char sbyte;
\r
34 typedef signed short sword;
\r
35 typedef signed long sdword;
\r
37 typedef unsigned int iword;
\r
38 typedef signed int siword;
\r
40 typedef unsigned long int diword;
\r
41 typedef signed long int sdiword;
\r
43 typedef enum {false,true} boolean;
\r
44 typedef enum {ichi,ni,san,yon,go,roku,shichi,hachi,kyu,ju,juichi,juni,jusan,juyon,jugo,juroku} nibble;
\r
45 //typedef unsigned nibb:4 nibble;
\r
47 #define HI_NIBBLE(b) (((b) >> 4) & 0x0F)
\r
48 #define LO_NIBBLE(b) ((b) & 0x0F)
\r
49 /*typedef unsigned memseg;
\r
51 memptr should be replaced by memseg in code.
\r
53 on usage where you need pointer convert memseg type (segment) to far pointer by
\r
54 MK_FP(segment value, 0)*/
\r
56 //typedef unsigned short _seg; // it will contains segment value (as Borland _seg)
\r
57 #define _seg __based( void )
\r
58 #define __SEGA __segment
\r
61 //typedef void _seg * memptr;
\r
65 typedef void _seg * memptr;//typedef void __based( void ) * memptr; ////old //----typedef void __based(__self) * memptr;
\r
68 #define _argv __argv
\r
69 #define _argc __argc
\r
71 //from http://www.verycomputer.com/3_65d875cc818b54ec_1.htm
\r
73 #pragma aux clrscr= \
\r
78 //from http://stackoverflow.com/questions/18425748/gotoxy-function-using-printf-s-position
\r
79 inline void gotoxy(int x,int y)
\r
81 printf("\x1B[%d;%df", y, x);
\r
82 fflush(stdout); // @jxh
\r