From 5e15fd0dadb195739e333d5d49acfdef1a42074b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 1 Jul 2015 17:32:17 -0500 Subject: [PATCH] made it cooler~ modified: Project 16.bfproject modified: makefile modified: src/16.h renamed: src/lib/lib_head.c -> src/lib/16_head.c renamed: src/lib/lib_head.h -> src/lib/16_head.h modified: src/lib/16_in.h modified: src/lib/16_mm.h modified: src/lib/16text.h modified: src/lib/bitmap.h modified: src/lib/dos_kb.h modified: src/lib/mapread.h modified: src/lib/modex16.h modified: src/lib/scroll16.h --- Project 16.bfproject | 4 +- makefile | 6 +- src/16.h | 2 +- src/lib/{lib_head.c => 16_head.c} | 2 +- src/lib/{lib_head.h => 16_head.h} | 0 src/lib/16_in.h | 196 +++++++++++++++--------------- src/lib/16_mm.h | 2 +- src/lib/16text.h | 2 +- src/lib/bitmap.h | 2 +- src/lib/dos_kb.h | 2 +- src/lib/mapread.h | 2 +- src/lib/modex16.h | 2 +- src/lib/scroll16.h | 1 + 13 files changed, 112 insertions(+), 111 deletions(-) rename src/lib/{lib_head.c => 16_head.c} (97%) rename src/lib/{lib_head.h => 16_head.h} (100%) diff --git a/Project 16.bfproject b/Project 16.bfproject index 92551881..204b7ab8 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -34,8 +34,8 @@ openfiles: /dos/z/16/src/lib/jsmn/farjsmn.c:7182:6170:0: openfiles: /dos/z/16/src/lib/jsmn/farjsmn.h:861:381:0: openfiles: /dos/z/16/src/lib/16_in.c:1522:1072:0: openfiles: /dos/z/16/src/lib/16_in.h:3692:3652:0: -openfiles: /dos/z/16/src/lib/lib_head.c:3456:2616:0: -openfiles: /dos/z/16/src/lib/lib_head.h:3332:2969:0: +openfiles: /dos/z/16/src/lib/16_head.c:3456:2616:0: +openfiles: /dos/z/16/src/lib/16_head.h:3332:2969:0: openfiles: /dos/z/16/makefile:1235:295:1: openfiles: /dos/z/16/src/lib/types.h:1043:28:0: openfiles: /dos/z/16/src/16.h:943:0:0: diff --git a/makefile b/makefile index 973cf984..000a0b58 100644 --- a/makefile +++ b/makefile @@ -22,7 +22,7 @@ JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) EXMMLIB=$(SRCLIB)exmm$(DIRSEP) WCPULIB=$(SRCLIB)wcpu$(DIRSEP) -16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) lib_head.$(OBJ) scroll16.$(OBJ) 16text.$(OBJ) +16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16text.$(OBJ) GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe inputest.exe exmmtest.exe @@ -157,8 +157,8 @@ mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c 16.lib 16_mm.$(OBJ): $(SRCLIB)16_mm.h $(SRCLIB)16_mm.c wcl $(FLAGS) -c $(SRCLIB)16_mm.c -lib_head.$(OBJ): $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c - wcl $(FLAGS) -c $(SRCLIB)lib_head.c +16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c + wcl $(FLAGS) -c $(SRCLIB)16_head.c jsmn.$(OBJ): $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c wcl $(FLAGS) -c $(JSMNLIB)jsmn.c diff --git a/src/16.h b/src/16.h index 7f2e0976..d6038ae8 100644 --- a/src/16.h +++ b/src/16.h @@ -23,7 +23,7 @@ #ifndef __16_H_ #define __16_H_ -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" #include "src/lib/modex16.h" #include "src/lib/wcpu/wcpu.h" #include "src/lib/planar.h" diff --git a/src/lib/lib_head.c b/src/lib/16_head.c similarity index 97% rename from src/lib/lib_head.c rename to src/lib/16_head.c index 4ca25c9c..d56b5260 100644 --- a/src/lib/lib_head.c +++ b/src/lib/16_head.c @@ -20,7 +20,7 @@ * */ -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" /* local function */ void wait(clock_t wait); diff --git a/src/lib/lib_head.h b/src/lib/16_head.h similarity index 100% rename from src/lib/lib_head.h rename to src/lib/16_head.h diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 1036b6ec..9a9c7685 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -20,23 +20,23 @@ // ID Engine // ID_IN.h - Header file for Input Manager // v1.0d1w -// By Jason Blochowiak +// By Jason Blochowiak // Open Watcom port by sparky4 // #ifndef __16_IN__ #define __16_IN__ - + #include -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" #ifdef __DEBUG__ #define __DEBUG_InputMgr__ -#endif +#endif #ifdef __DEBUG_InputMgr__ -#define TESTKEYIN -#define TESTCONTROLNOISY +#define TESTKEYIN +#define TESTCONTROLNOISY #endif #define KeyInt 9 // The keyboard ISR number @@ -48,7 +48,7 @@ #define MaxPlayers 4 #define MaxKbds 2 -#define MaxJoys 2 +#define MaxJoys 2 #define MaxPads 2 #define NumCodes 128 @@ -135,10 +135,10 @@ typedef byte ScanCode; #define key_BackSpace 0x08 #define key_Tab 0x09 #define key_Delete 0x7f - -#define key_LSuper 0x5b -#define key_RSuper 0x5c -#define key_Menu 0x5d + +#define key_LSuper 0x5b +#define key_RSuper 0x5c +#define key_Menu 0x5d // Stuff for the mouse #define MReset 0 @@ -157,8 +157,8 @@ typedef enum { ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2, ctrl_Joystick, ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2, - ctrl_Mouse, - ctrl_Joypad, + ctrl_Mouse, + ctrl_Joypad, ctrl_Joypad1 = ctrl_Joypad,ctrl_Joypad2 } ControlType; typedef enum { @@ -166,12 +166,12 @@ typedef enum { motion_None = 0, motion_Right = 1,motion_Down = 1 } Motion; -typedef enum { - dir_North,//dir_NorthEast, - dir_West,//dir_Nortinest, +typedef enum { + dir_North,//dir_NorthEast, + dir_West,//dir_Nortinest, dir_None, - dir_East,//,dir_SouthEast, - dir_South,//dir_Soutinest, + dir_East,//,dir_SouthEast, + dir_South,//dir_Soutinest, } Direction; typedef struct { boolean button0,button1,button2,button3; @@ -183,9 +183,9 @@ typedef struct { typedef struct { ScanCode button0,button1, //upleft, - up, - down, - left, + up, + down, + left, right //upright, //downleft, @@ -199,101 +199,101 @@ typedef struct { joyMaxX,joyMaxY, joyMultXL,joyMultYL, joyMultXH,joyMultYH; - } JoystickDef; -typedef struct -{ + } JoystickDef; +typedef struct +{ boolean w; -} JoypadDef; - -typedef struct -{ - int x; //player exact position on the viewable map - int y; //player exact position on the viewable map - int tx; //player tile position on the viewable map - int ty; //player tile position on the viewable map - int triggerx; //player's trigger box tile position on the viewable map - int triggery; //player's trigger box tile position on the viewable map - int setx; //NOT USED YET! player sprite sheet set on the image x - int sety; //NOT USED YET! player sprite sheet set on the image y - word q; //loop variable -// word d; //direction - //bitmap_t data; //supposively the sprite sheet data - int hp; //hitpoints of the player - CursorInfo info; - ControlType Controls; -} player_t; - +} JoypadDef; + +typedef struct +{ + int x; //player exact position on the viewable map + int y; //player exact position on the viewable map + int tx; //player tile position on the viewable map + int ty; //player tile position on the viewable map + int triggerx; //player's trigger box tile position on the viewable map + int triggery; //player's trigger box tile position on the viewable map + int setx; //NOT USED YET! player sprite sheet set on the image x + int sety; //NOT USED YET! player sprite sheet set on the image y + word q; //loop variable +// word d; //direction + //bitmap_t data; //supposively the sprite sheet data + int hp; //hitpoints of the player + CursorInfo info; + ControlType Controls; +} player_t; + /* ============================================================================= GLOBAL VARIABLES ============================================================================= -*/ -/*extern struct inconfig -{ +*/ +/*extern struct inconfig +{ boolean MousePresent; boolean JoysPresent[MaxJoys]; - boolean JoyPadPresent[MaxPads]; + boolean JoyPadPresent[MaxPads]; boolean Keyboard[NumCodes]; boolean Paused; char LastASCII; - ScanCode LastScan; - - KeyboardDef KbdDefs[MaxKbds]; - JoystickDef JoyDefs[MaxJoys]; - JoypadDef JoypadDefs[MaxPads]; -} inpu;*/ - + ScanCode LastScan; + + KeyboardDef KbdDefs[MaxKbds]; + JoystickDef JoyDefs[MaxJoys]; + JoypadDef JoypadDefs[MaxPads]; +} inpu;*/ + #ifdef DEMO0 static Demo DemoMode = demo_Off; static byte /*_seg*/ *DemoBuffer; static word DemoOffset,DemoSize; #endif - + extern dword far* clockdw; -// Internal routines -extern void interrupt INL_KeyService(); -extern void Mouse(int x); -//static void INL_GetMouseDelta(int *x,int *y); -//static word INL_GetMouseButtons(void); -extern void IN_GetJoyAbs(word joy,word *xp,word *yp); -//static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive); -//static word INL_GetJoyButtons(word joy); -extern word IN_GetJoyButtonsDB(word joy); -//static void INL_StartKbd(void); -//static void INL_ShutKbd(void); -//static boolean INL_StartMouse(void); -//static void INL_ShutMouse(void); -//static void INL_SetJoyScale(word joy); -extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy); -//static boolean INL_StartJoy(word joy); -//static void INL_ShutJoy(word joy); -extern void IN_Startup(); -extern void IN_Default(boolean gotit,player_t *player,ControlType nt); -extern void IN_Shutdown(); -extern void IN_SetKeyHook(void (*hook)()); -extern void IN_ClearKeysDown(); -//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy); -extern void IN_ReadCursor(CursorInfo *info); -extern void IN_ReadControl(int playnum,player_t *player); -extern void IN_SetControlType(word playnum,player_t *player,ControlType type); -#if DEMO0 -extern boolean IN_StartDemoRecord(word bufsize); -extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize); -extern void IN_StopDemo(void); -extern void IN_FreeDemoBuffer(void); -#endif -extern byte *IN_GetScanName(ScanCode scan); -extern ScanCode IN_WaitForKey(); -extern char IN_WaitForASCII(); -extern void IN_AckBack(); -extern void IN_Ack(); -extern boolean IN_IsUserInput(); -extern boolean IN_UserInput(dword delay,boolean clear); -extern boolean IN_KeyDown(byte code); -extern void IN_ClearKey(byte code); -extern boolean IN_qb(byte kee); +// Internal routines +extern void interrupt INL_KeyService(); +extern void Mouse(int x); +//static void INL_GetMouseDelta(int *x,int *y); +//static word INL_GetMouseButtons(void); +extern void IN_GetJoyAbs(word joy,word *xp,word *yp); +//static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive); +//static word INL_GetJoyButtons(word joy); +extern word IN_GetJoyButtonsDB(word joy); +//static void INL_StartKbd(void); +//static void INL_ShutKbd(void); +//static boolean INL_StartMouse(void); +//static void INL_ShutMouse(void); +//static void INL_SetJoyScale(word joy); +extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy); +//static boolean INL_StartJoy(word joy); +//static void INL_ShutJoy(word joy); +extern void IN_Startup(); +extern void IN_Default(boolean gotit,player_t *player,ControlType nt); +extern void IN_Shutdown(); +extern void IN_SetKeyHook(void (*hook)()); +extern void IN_ClearKeysDown(); +//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy); +extern void IN_ReadCursor(CursorInfo *info); +extern void IN_ReadControl(int playnum,player_t *player); +extern void IN_SetControlType(word playnum,player_t *player,ControlType type); +#if DEMO0 +extern boolean IN_StartDemoRecord(word bufsize); +extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize); +extern void IN_StopDemo(void); +extern void IN_FreeDemoBuffer(void); +#endif +extern byte *IN_GetScanName(ScanCode scan); +extern ScanCode IN_WaitForKey(); +extern char IN_WaitForASCII(); +extern void IN_AckBack(); +extern void IN_Ack(); +extern boolean IN_IsUserInput(); +extern boolean IN_UserInput(dword delay,boolean clear); +extern boolean IN_KeyDown(byte code); +extern void IN_ClearKey(byte code); +extern boolean IN_qb(byte kee); #endif diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index bb130101..f16663bf 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -23,7 +23,7 @@ #include #include -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" //++++mh #include "src/lib/16_in.h" #ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final diff --git a/src/lib/16text.h b/src/lib/16text.h index 98c3b904..935fb67f 100644 --- a/src/lib/16text.h +++ b/src/lib/16text.h @@ -6,7 +6,7 @@ */ #ifndef TEXT_H #define TEXT_H -#include "types.h" +#include "src/lib/types.h" /* font information type */ typedef struct font { diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h index 1a2abcf9..37d7f828 100644 --- a/src/lib/bitmap.h +++ b/src/lib/bitmap.h @@ -26,7 +26,7 @@ #ifndef BITMAP_H #define BITMAP_H #include "src/lib/types.h" -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" typedef struct { byte *data; diff --git a/src/lib/dos_kb.h b/src/lib/dos_kb.h index 8f85fe7f..3161cfe9 100644 --- a/src/lib/dos_kb.h +++ b/src/lib/dos_kb.h @@ -1,6 +1,6 @@ #ifndef _DOSLIB_KB_H_ #define _DOSLIB_KB_H_ -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" /* Maximum number of scan codes on keyboard controllers */ #define NUM_SCANCODES 128 diff --git a/src/lib/mapread.h b/src/lib/mapread.h index 06cab45a..4f174246 100644 --- a/src/lib/mapread.h +++ b/src/lib/mapread.h @@ -8,7 +8,7 @@ #include "src/lib/jsmn/jsmn.h" #include "src/lib/modex16.h" -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" //#define DEBUG_MAPDATA //#define DEBUG_MAPVAR diff --git a/src/lib/modex16.h b/src/lib/modex16.h index e25405d0..bb00795b 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -29,7 +29,7 @@ #include "src/lib/types.h" #include "src/lib/bitmap.h" #include "src/lib/planar.h" -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" /* -========================== Types & Macros ==========================- */ #define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2)) diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index e7fa1e16..71a0cbf3 100644 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -23,6 +23,7 @@ #ifndef __SCROLL16_H_ #define __SCROLL16_H_ +#include "src/lib/16_head.h" #include "src/lib/16_in.h" //#define TILEWH 16 -- 2.39.5