]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_head.h
updated the copyleft wwww i am not deAD! i just been 2 busy last 6 monthes
[16.git] / src / lib / 16_head.h
index c7d8ee28ee32c04a097fba1c0d24fbc0eef6ec1e..274722303b73d393709ee8d71f358669ad9034f4 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
  *\r
  */\r
 \r
-#if !defined(__LARGE__) && !defined(__COMPACT__) && !defined(__HUGE__)\r
-#error Invalid memory model for compiling project 16\r
-#endif\r
+//#if !defined(__LARGE__) && !defined(__COMPACT__) && !defined(__HUGE__)\r
+//#error Invalid memory model for compiling project 16\r
+//#endif\r
 \r
 #if !defined(__i86__) && defined(__i386__)\r
 #error i8088 only\r
 #endif\r
 \r
-#ifndef _LIBHEAD_H_\r
-#define _LIBHEAD_H_\r
+#ifndef __16_HEAD_H__\r
+#define __16_HEAD_H__\r
 #include <dos.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
-#include <conio.h> // just for wait\r
+#include <conio.h> // this is where Open Watcom hides the outp() etc. functions // just for wait\r
 #include <time.h> // just for wait\r
-#include <malloc.h>\r
 #include <ctype.h>\r
 #include <fcntl.h>\r
 #include <io.h>\r
 #include <sys/stat.h>\r
 #include <mem.h>\r
 #include <string.h>\r
+#include <limits.h>\r
+#include <errno.h>\r
+#include <process.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
+#ifdef __BORLANDC__\r
+#include <values.h>\r
+#include <dir.h>\r
+#define TILEWH 16\r
 #endif\r
+#include "src/lib/16_t.h"\r
+#include "src/lib/16_tdef.h"\r
 #include "src/lib/nyan/kitten.h"\r
-#include "src/lib/types.h"\r
 \r
 #define VERSION __DATE__ " " __TIME__\r
 \r
 #define KEY_MENU               (0x75)\r
 */\r
 \r
-static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+//static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 extern int                     profilehandle,debughandle;      //make it into game global\r
 \r
-#define __DEBUG__\r
+//#define OLD16_VL\r
 \r
 #define        nil     ((void *)0)\r
-#ifdef __BORLANDC__\r
-#define _FCORELEFT 0x90000UL-16UL\r
-#endif\r
+\r
 #ifdef __WATCOMC__\r
-#define _FCORELEFT 0x90000UL+16UL\r
+//----#define _FCORELEFT 0x90000UL+16UL\r
+extern union REGS CPURegs;\r
 \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
-#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value))\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
-typedef union REGPACK  regs_t;\r
-#endif\r
+#define _SI CPURegs.x.si\r
 \r
-#ifdef __WATCOMC__\r
-typedef void __based(__self) * memptr;\r
-#endif\r
-#ifdef __BORLANDC__\r
-typedef void _seg * memptr;\r
-#endif\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
 \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;   //pointer to root page[0] //TODO\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
-\r
-/* local function */\r
-void wait(clock_t wait);\r
 \r
+typedef union REGPACK  regs_t;\r
+#endif\r
+\r
+// local function //\r
 long int filesize(FILE *fp);\r
+void clrstdin();\r
+char *remove_ext(char* mystr, char dot, char sep);\r
+void rotateR(byte arr[], byte n);\r
+void rotateL(byte arr[], byte n);\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
+byte dirchar(byte in);\r
+void print_mem(void const *vp, size_t n);\r
+void hres (void);\r
+\r
+#define PRINT_OPAQUE_STRUCT(p)  print_mem((p), sizeof(*(p)))\r
 \r
-#endif/*_LIBHEAD_H_*/\r
+#endif/*__16_HEAD_H__*/\r