From: sparky4 Date: Fri, 26 Jun 2015 20:10:04 +0000 (-0500) Subject: wwww merging~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=548f31286ab49aa891dfc5d72536d7175496f006;p=16.git wwww merging~ modified: 16.LIB modified: 16.exe modified: Project 16.bfproject new file: inputext.exe modified: makefile modified: maptest.exe modified: pcxtest.exe modified: scroll.exe new file: src/inputest.c renamed: 16/cawat/16_in.c -> src/lib/16_in.c renamed: 16/cawat/16_in.h -> src/lib/16_in.h renamed: 16/cawat/16_us.h -> src/lib/16_us.h modified: src/lib/lib_head.h modified: test.exe modified: test2.exe --- diff --git a/16.LIB b/16.LIB index 33cc1111..c73feb57 100644 Binary files a/16.LIB and b/16.LIB differ diff --git a/16.exe b/16.exe index 67be5757..2b618baf 100644 Binary files a/16.exe and b/16.exe differ diff --git a/Project 16.bfproject b/Project 16.bfproject index f899dd48..5d5f6db4 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -3,7 +3,7 @@ e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:80:0:0: openfiles: /dos/z/16/src/palettec.c:882:0:0: openfiles: /dos/z/16/src/pcxtest.c:931:0:0: -openfiles: /dos/z/16/src/scroll.c:2847:2098:0: +openfiles: /dos/z/16/src/scroll.c:18038:17181:1: openfiles: /dos/z/16/src/fmemtest.c:891:0:0: openfiles: /dos/z/16/src/emmtest.c:405:0:0: openfiles: /dos/z/16/src/emsdump.c:890:0:0: @@ -11,7 +11,7 @@ openfiles: /dos/z/16/src/maptest.c:886:0:0: openfiles: /dos/z/16/src/maptest0.c:886:0:0: openfiles: /dos/z/16/src/test.c:890:0:0: openfiles: /dos/z/16/src/test2.c:886:0:0: -openfiles: /dos/z/16/src/lib/modex16.c:1963:3289:1: +openfiles: /dos/z/16/src/lib/modex16.c:3597:3271:0: openfiles: /dos/z/16/src/lib/modex16.h:1052:576:0: openfiles: /dos/z/16/src/lib/planar.h:1008:127:0: openfiles: /dos/z/16/src/lib/planar.c:894:0:0: @@ -53,7 +53,7 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/src/lib wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: geninterrupt +ssearch_text: puts snr_casesens: 0 view_blocks: 1 name: Project 16 @@ -86,13 +86,14 @@ recent_files: file:///dos/z/16/16.c recent_files: file:///dos/z/16/src/lib/wcpu/wtest.c recent_files: file:///dos/z/16/src/lib/wcpu/wtest.h recent_files: file:///dos/z/16/src/lib/wcpu/makefile +recent_files: file:///dos/z/16/src/lib/modex16.c recent_files: file:///dos/z/16/src/pcxtest.c recent_files: file:///dos/z/16/doc/project.txt recent_files: file:///dos/z/16/src/palettec.c recent_files: file:///dos/z/16/src/fmemtest.c recent_files: file:///dos/z/16/src/emmtest.c -recent_files: file:///dos/z/16/src/maptest.c recent_files: file:///dos/z/16/src/emsdump.c +recent_files: file:///dos/z/16/src/maptest.c recent_files: file:///dos/z/16/src/scroll.c recent_files: file:///dos/z/16/src/maptest0.c recent_files: file:///dos/z/16/src/test.c @@ -100,33 +101,32 @@ recent_files: file:///dos/z/16/src/test2.c recent_files: file:///dos/z/16/src/lib/modex16.h recent_files: file:///dos/z/16/src/lib/planar.h recent_files: file:///dos/z/16/src/lib/planar.c -recent_files: file:///dos/z/16/src/lib/modex16.c recent_files: file:///dos/z/16/src/lib/bitmap.c recent_files: file:///dos/z/16/src/lib/bitmap.h -recent_files: file:///dos/z/16/src/lib/wcpu/wcpu.h -recent_files: file:///dos/z/16/src/lib/dos_kb.h recent_files: file:///dos/z/16/src/lib/wcpu/wcpu.c +recent_files: file:///dos/z/16/src/lib/wcpu/wcpu.h recent_files: file:///dos/z/16/src/lib/dos_kb.c +recent_files: file:///dos/z/16/src/lib/dos_kb.h recent_files: file:///dos/z/16/src/lib/mapread.c recent_files: file:///dos/z/16/src/lib/mapread.h recent_files: file:///dos/z/16/src/lib/fmapread.c recent_files: file:///dos/z/16/src/lib/fmapread.h +recent_files: file:///dos/z/16/src/lib/lib_head.c +recent_files: file:///dos/z/16/src/lib/lib_head.h recent_files: file:///dos/z/16/src/lib/exmm/memory.h -recent_files: file:///dos/z/16/src/lib/exmm/emmret.h recent_files: file:///dos/z/16/src/lib/exmm/emmsize.h -recent_files: file:///dos/z/16/src/lib/exmm/memory.c +recent_files: file:///dos/z/16/src/lib/exmm/emmret.h recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.c recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.h -recent_files: file:///dos/z/16/src/lib/lib_head.c -recent_files: file:///dos/z/16/src/lib/lib_head.h +recent_files: file:///dos/z/16/src/lib/exmm/memory.c recent_files: file:///dos/z/16/makefile recent_files: file:///dos/z/16/src/lib/types.h -recent_files: file:///dos/z/16/src/16.h recent_files: file:///dos/z/16/src/16.c recent_files: file:///dos/z/16/src/lib/scroll16.h recent_files: file:///dos/z/16/src/lib/scroll16.c +recent_files: file:///dos/z/16/src/16.h snr_replacetype: 0 -savedir: file:///dos/z/16 +savedir: file:///dos/z/16/src spell_check_default: 1 spell_insert_entities: 0 last_filefilter: @@ -136,7 +136,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: mapscrollr searchlist: , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +/* + input test +*/ +#include "src/lib/16_in.h" + +void +main(int argc, char *argv[]) +{ + +} \ No newline at end of file diff --git a/16/cawat/16_in.c b/src/lib/16_in.c similarity index 85% rename from 16/cawat/16_in.c rename to src/lib/16_in.c index f8d3178e..34679d96 100644 --- a/16/cawat/16_in.c +++ b/src/lib/16_in.c @@ -35,110 +35,7 @@ // DEBUG - there are more globals // -#include "16_in.h" - -// Global variables - boolean JoystickCalibrated=false; // MDM (GAMERS EDGE) - added - ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added - - boolean Keyboard[NumCodes], - JoysPresent[MaxJoys], - MousePresent; - boolean Paused; - char LastASCII; - ScanCode LastScan; - KeyboardDef KbdDefs[MaxKbds] = {{0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51}}; - JoystickDef JoyDefs[MaxJoys]; - ControlType Controls[MaxPlayers]; - -#ifdef DEMO0 - Demo DemoMode = demo_Off; - byte __segment *DemoBuffer; - word DemoOffset,DemoSize; -#endif - -// Internal variables -static boolean IN_Started; -static boolean CapsLock; -static ScanCode CurCode,LastCode; -static byte far ASCIINames[] = // Unshifted ASCII for scan codes - { -// 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0 ,27 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,9 , // 0 - 'q','w','e','r','t','y','u','i','o','p','[',']',13 ,0 ,'a','s', // 1 - 'd','f','g','h','j','k','l',';',39 ,'`',0 ,92 ,'z','x','c','v', // 2 - 'b','n','m',',','.','/',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 - '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 - }, - far ShiftNames[] = // Shifted ASCII for scan codes - { -// 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0 ,27 ,'!','@','#','$','%','^','&','*','(',')','_','+',8 ,9 , // 0 - 'Q','W','E','R','T','Y','U','I','O','P','{','}',13 ,0 ,'A','S', // 1 - 'D','F','G','H','J','K','L',':',34 ,'~',0 ,'|','Z','X','C','V', // 2 - 'B','N','M','<','>','?',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 - '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 - }, - far SpecialNames[] = // ASCII for 0xe0 prefixed codes - { -// 0 1 2 3 4 5 6 7 8 9 A B C D E F - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 0 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,13 ,0 ,0 ,0 , // 1 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 2 - 0 ,0 ,0 ,0 ,0 ,'/',0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 3 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 4 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 - }, - -#if 0 - *ScanNames[] = // Scan code names with single chars - { - "?","?","1","2","3","4","5","6","7","8","9","0","-","+","?","?", - "Q","W","E","R","T","Y","U","I","O","P","[","]","|","?","A","S", - "D","F","G","H","J","K","L",";","\"","?","?","?","Z","X","C","V", - "B","N","M",",",".","/","?","?","?","?","?","?","?","?","?","?", - "?","?","?","?","?","?","?","?","\xf","?","-","\x15","5","\x11","+","?", - "\x13","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?", - "?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?", - "?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?" - }, // DEBUG - consolidate these -#endif - - far ExtScanCodes[] = // Scan codes with >1 char names - { - 1,0xe,0xf,0x1d,0x2a,0x39,0x3a,0x3b,0x3c,0x3d,0x3e, - 0x3f,0x40,0x41,0x42,0x43,0x44,0x57,0x59,0x46,0x1c,0x36, - 0x37,0x38,0x47,0x49,0x4f,0x51,0x52,0x53,0x45,0x48, - 0x50,0x4b,0x4d,0x00 - }; -#if 0 - *ExtScanNames[] = // Names corresponding to ExtScanCodes - { - "Esc","BkSp","Tab","Ctrl","LShft","Space","CapsLk","F1","F2","F3","F4", - "F5","F6","F7","F8","F9","F10","F11","F12","ScrlLk","Enter","RShft", - "PrtSc","Alt","Home","PgUp","End","PgDn","Ins","Del","NumLk","Up", - "Down","Left","Right","" - }; -#endif -static Direction DirTable[] = // Quick lookup for total direction - { - dir_NorthWest, dir_North, dir_NorthEast, - dir_West, dir_None, dir_East, - dir_SouthWest, dir_South, dir_SouthEast - }; - -static void (*INL_KeyHook)(void); -static void interrupt (*OldKeyVect)(void); - -static char *ParmStrings[] = {"nojoys","nomouse",nil}; +#include "src/lib/16_in.h" // Internal routines diff --git a/16/cawat/16_in.h b/src/lib/16_in.h similarity index 55% rename from 16/cawat/16_in.h rename to src/lib/16_in.h index e5adb56d..262f7b11 100644 --- a/16/cawat/16_in.h +++ b/src/lib/16_in.h @@ -26,12 +26,8 @@ #ifndef __16_IN__ #define __16_IN__ -#include "lib_head.h" -#include "16_us.h" - -#ifndef __TYPES__ -//#include "ID_Types.h" -#endif +#include "src/lib/lib_head.h" +#include "src/lib/16_us.h" #ifdef __DEBUG__ #define __DEBUG_InputMgr__ @@ -86,6 +82,17 @@ typedef byte ScanCode; #define sc_F11 0x57 #define sc_F12 0x59 +#define sc_1 0x02 +#define sc_2 0x03 +#define sc_3 0x04 +#define sc_4 0x05 +#define sc_5 0x06 +#define sc_6 0x07 +#define sc_7 0x08 +#define sc_8 0x09 +#define sc_9 0x0a +#define sc_0 0x0b + #define sc_A 0x1e #define sc_B 0x30 #define sc_C 0x2e @@ -173,25 +180,106 @@ typedef struct { joyMultXL,joyMultYL, joyMultXH,joyMultYH; } JoystickDef; -// Global variables -extern boolean Keyboard[], - MousePresent, - JoysPresent[]; -extern boolean Paused; -extern char LastASCII; -extern ScanCode LastScan; -extern KeyboardDef KbdDefs[]; -extern JoystickDef JoyDefs[]; -extern ControlType Controls[MaxPlayers]; - -extern boolean JoystickCalibrated; // MDM (GAMERS EDGE) - added -extern ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added +/* +============================================================================= + + GLOBAL VARIABLES + +============================================================================= +*/ + +// +// configuration variables +// +boolean MousePresent; +boolean JoysPresent[MaxJoys]; +boolean JoyPadPresent; + + +// Global variables + boolean JoystickCalibrated=false; // MDM (GAMERS EDGE) - added + ControlType ControlTypeUsed; // MDM (GAMERS EDGE) - added + + boolean Keyboard[NumCodes]; + boolean Paused; + char LastASCII; + ScanCode LastScan; + + KeyboardDef KbdDefs[] = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51}; + JoystickDef JoyDefs[MaxJoys]; + ControlType Controls[MaxPlayers]; + + dword MouseDownCount; + #ifdef DEMO0 -extern Demo DemoMode; -extern byte __segment *DemoBuffer; -extern word DemoOffset,DemoSize; + Demo DemoMode = demo_Off; + byte /*_seg*/ *DemoBuffer; + word DemoOffset,DemoSize; #endif + + + +/* +============================================================================= + + LOCAL VARIABLES + +============================================================================= +*/ +static byte far ASCIINames[] = // Unshifted ASCII for scan codes + { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0 ,27 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,9 , // 0 + 'q','w','e','r','t','y','u','i','o','p','[',']',13 ,0 ,'a','s', // 1 + 'd','f','g','h','j','k','l',';',39 ,'`',0 ,92 ,'z','x','c','v', // 2 + 'b','n','m',',','.','/',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 + '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 + }, + far ShiftNames[] = // Shifted ASCII for scan codes + { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0 ,27 ,'!','@','#','$','%','^','&','*','(',')','_','+',8 ,9 , // 0 + 'Q','W','E','R','T','Y','U','I','O','P','{','}',13 ,0 ,'A','S', // 1 + 'D','F','G','H','J','K','L',':',34 ,'~',0 ,'|','Z','X','C','V', // 2 + 'B','N','M','<','>','?',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 + '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 + }, + far SpecialNames[] = // ASCII for 0xe0 prefixed codes + { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 0 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,13 ,0 ,0 ,0 , // 1 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 2 + 0 ,0 ,0 ,0 ,0 ,'/',0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 3 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 4 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 + 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 + }; + + +static boolean IN_Started; +static boolean CapsLock; +static ScanCode CurCode,LastCode; + +static Direction DirTable[] = // Quick lookup for total direction + { + dir_NorthWest, dir_North, dir_NorthEast, + dir_West, dir_None, dir_East, + dir_SouthWest, dir_South, dir_SouthEast + }; + +static void (*INL_KeyHook)(void); +static void interrupt (*OldKeyVect)(void); + +static char *ParmStrings[] = {"nojoys","nomouse",nil}; // Function prototypes #define IN_KeyDown(code) (Keyboard[(code)]) diff --git a/16/cawat/16_us.h b/src/lib/16_us.h similarity index 100% rename from 16/cawat/16_us.h rename to src/lib/16_us.h diff --git a/src/lib/lib_head.h b/src/lib/lib_head.h index 3d5355d3..2ff4819f 100644 --- a/src/lib/lib_head.h +++ b/src/lib/lib_head.h @@ -121,20 +121,14 @@ #define KEY_MENU (0x75) */ -//#define FARPTR(S, O) MK_FP(S, O) - -//#define inportb(P) inp(P) -//#define outportb(P,V) outp(P,V) -//#define outportw(P,V) outpw(P,V) - -//#define R_AX w.ax -//#define R_BX w.bx -//#define R_BP w.bp -//#define R_ES w.es - -/* WARNING: for 32-bit code, unused fields of regs_t -must be zeroed before using this macro */ -//#define trap(N,R) intr(N,R) +#define nil ((void *)0) + +dword far* clockdw= (dword far*) 0x046C; /* 18.2hz clock */ + +#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) +#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) +#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) +#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value)) typedef union REGPACK regs_t; typedef enum {false,true} boolean; @@ -144,7 +138,4 @@ void* AllocateLargestFreeBlock(size_t* Size); size_t GetFreeSize(void); long int filesize(FILE *fp); -/* THIS FUNCTION CONVERTS A POINTER TO AN INTEL LONG */ -//int long ptr2long(char *p); - #endif/*_LIBHEAD_H_*/ diff --git a/test.exe b/test.exe index 6097e1df..122bcab1 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 6cda8f02..cea7c7d3 100644 Binary files a/test2.exe and b/test2.exe differ