/* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
#include <sys/stat.h>\r
#include <mem.h>\r
#include <string.h>\r
+#include <limits.h>\r
#ifdef __WATCOMC__\r
#include <i86.h>\r
#include <unistd.h>\r
#include <alloca.h>\r
+#include <stdint.h> //16_vrs.h\r
#endif\r
#include "src/lib/nyan/kitten.h"\r
#include "src/lib/types.h"\r
+#include "src/lib/typdefst.h"\r
+#include "src/lib/16_in.h"\r
\r
#define VERSION __DATE__ " " __TIME__\r
\r
#define nil ((void *)0)\r
#ifdef __BORLANDC__\r
#define _FCORELEFT 0x90000UL-16UL\r
+#define sprite\r
#endif\r
#ifdef __WATCOMC__\r
#define _FCORELEFT 0x90000UL+16UL\r
+static union REGS CPURegs;\r
\r
+#define _AX CPURegs.x.ax\r
+#define _BX CPURegs.x.bx\r
+#define _CX CPURegs.x.cx\r
+#define _DX CPURegs.x.dx\r
+\r
+#define _SI CPURegs.x.si\r
+\r
+#define _AH CPURegs.h.ah\r
+#define _AL CPURegs.h.al\r
+#define _BH CPURegs.h.bh\r
+#define _BL CPURegs.h.bl\r
+#define _CH CPURegs.h.ch\r
+#define _CL CPURegs.h.cl\r
+#define _DH CPURegs.h.dh\r
+#define _DL CPURegs.h.dl\r
+\r
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs)))\r
#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs)))\r
#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r
typedef union REGPACK regs_t;\r
#endif\r
\r
-#ifdef __WATCOMC__\r
-typedef void __based(__self) * memptr;\r
-#endif\r
-#ifdef __BORLANDC__\r
-typedef void _seg * memptr;\r
-#endif\r
-\r
-/*\r
- * typedefs of the game variables!\r
- */\r
-typedef struct {\r
- word id; /* the Identification number of the page~ For layering~ */\r
- byte far* data; /* the data for the page */\r
- word dx; /* col we are viewing on the virtual screen */\r
- word dy; /* row we are viewing on the virtual screen */\r
- word sw; /* screen width */\r
- word sh; /* screen heigth */\r
- word tilesw; /* screen width in tiles */\r
- word tilesh; /* screen height in tiles */\r
- word width; /* virtual width of the page */\r
- word height; /* virtual height of the page */\r
- word tw;\r
- word th;\r
- sword tilemidposscreenx; /* middle tile position */\r
- sword tilemidposscreeny; /* middle tile position */\r
- sword tileplayerposscreenx; /* player position on screen */\r
- sword tileplayerposscreeny; /* player position on screen */\r
-} page_t;\r
-\r
-typedef struct\r
-{\r
-// int showmemhandle;\r
- int profilehandle,debughandle;\r
- int heaphandle;\r
-} handle_t;\r
-\r
-typedef struct\r
-{\r
- word frames_per_second;\r
- clock_t t;\r
- dword tiku; //frames passed\r
- word clock_start; //timer start\r
- word *clock; //current time on clock\r
- boolean fpscap; //cap the fps var\r
-} kurokku_t;\r
-\r
-typedef struct\r
-{\r
- long old_mode; //old video mode before game!\r
- page_t page[4]; //pointer to root page[0]\r
-} video_t;\r
-\r
-typedef struct\r
-{\r
- video_t video; // video settings variable\r
- byte *pee; // message for fps\r
- handle_t handle; //handles for file logging\r
- kurokku_t kurokku; //clock struct\r
-} global_game_variables_t;\r
+#define INPUT_STATUS_1 0x03da\r
\r
/* local function */\r
void wait(clock_t wait);\r
long int filesize(FILE *fp);\r
void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free);\r
int US_CheckParm(char *parm,char **strings);\r
+#ifdef __BORLANDC__\r
+void Quit (char *error);\r
+#endif\r
+byte dirchar(byte in);\r
\r
#endif/*_LIBHEAD_H_*/\r