From 126e8457280f8c9f6ddec9545d505b8cabae52be Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sun, 23 Nov 2014 19:56:28 -0600 Subject: [PATCH] modified: Project 16.bfproject modified: README modified: dos_kb.h modified: lib/lib_head.h --- Project 16.bfproject | 21 +++-- README | 3 +- dos_kb.h | 46 +++++----- lib/lib_head.h | 206 +++++++++++++++++++++---------------------- 4 files changed, 140 insertions(+), 136 deletions(-) diff --git a/Project 16.bfproject b/Project 16.bfproject index 0f779e64..3be3592b 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -1,10 +1,13 @@ c2e.convert_special: 0 e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:0:0:0: -openfiles: /dos/z/16/scroll.c:2811:2233:1: +openfiles: /dos/z/16/scroll.c:4789:4030:1: openfiles: /dos/z/16/modex16.c:9475:0:0: -openfiles: /dos/z/16/modex16.h:393:0:0: -openfiles: /dos/z/16/pcxtest.c:1339:753:0: +openfiles: /dos/z/16/modex16.h:1512:344:0: +openfiles: /dos/z/16/pcxtest.c:1339:442:0: +openfiles: /dos/z/16/dos_kb.c:3759:3388:0: +openfiles: /dos/z/16/dos_kb.h:464:0:0: +openfiles: /dos/z/16/lib/lib_head.h:2319:1809:0: snr_recursion_level: 0 convertcolumn_horizontally: 0 adv_open_matchname: 0 @@ -16,7 +19,7 @@ view_left_panel: 0 default_mime_type: text/plain e2c.convert_xml: 1 c2e.convert_iso: 0 -opendir: file:///dos/z/16 +opendir: file:///dos/z/16/lib wrap_text_default: 0 bookmarks_filename_mode: 1 ssearch_text: modexDrawSpriteRegion @@ -51,9 +54,6 @@ ssearch_regex: 0 e2c.convert_iso: 0 ssearch_casesens: 0 charmap_block: 1 -recent_files: file:///dos/z/16/16/lib/x/MAKEFILE -recent_files: file:///dos/z/16/16/lib/x/MODEX.DEF -recent_files: file:///dos/z/4x4_16/modex/DEMO01.PAS recent_files: file:///dos/z/16/16/lib/x/MXCR.ASM recent_files: file:///dos/z/4x4_16/modex/DEMO07.PAS recent_files: file:///dos/z/16/16/scrasm/MAIN.ASM @@ -97,12 +97,15 @@ recent_files: file:///dos/z/16/16/modex16/dos_kb.h recent_files: file:///dos/z/16/doc/16.16 recent_files: file:///dos/z/16/doc/16story.txt recent_files: file:///dos/z/16/scroll.c -recent_files: file:///dos/z/16/doc/project.txt recent_files: file:///dos/z/16/modex16.h +recent_files: file:///dos/z/16/doc/project.txt recent_files: file:///dos/z/16/pcxtest.c recent_files: file:///dos/z/16/modex16.c +recent_files: file:///dos/z/16/dos_kb.h +recent_files: file:///dos/z/16/dos_kb.c +recent_files: file:///dos/z/16/lib/lib_head.h snr_replacetype: 0 -savedir: file:///dos/z/16 +savedir: file:///dos/z/16/lib spell_check_default: 1 spell_insert_entities: 0 last_filefilter: diff --git a/README b/README index 5b8b3d8a..09a70158 100644 --- a/README +++ b/README @@ -15,7 +15,8 @@ DONE 5. sprite rendering 9. map rendering~ 10. map and item interation 11. item inventory~ -12. Memory management (EMS + XMS) +12. Memory management (EMS + XMS) +13. case switch with keyboard code (when your holding 2 arrow keys and a key is released the keyboard controller dose not read input from the port anymore for some weired reason) To compile: You need Open Watcom stable to compile and just run wmake diff --git a/dos_kb.h b/dos_kb.h index 846946b3..09617895 100644 --- a/dos_kb.h +++ b/dos_kb.h @@ -1,23 +1,23 @@ -#ifndef _DOSLIB_KB_H_ -#define _DOSLIB_KB_H_ -#include "lib\lib_head.h" - -/* Maximum number of scan codes on keyboard controllers */ -#define NUM_SCANCODES 128 - -#ifdef __cplusplus /* Functions must be declared C style */ -extern "C" { -#endif -void interrupt far newkb(void); -//extern void interrupt (far *oldkb)(void); -void setkb(int vq); -int keyp(byte c); - -/* Define macro */ -//#define kepn(c) key[c & 0x7F] - -#ifdef __cplusplus -} -#endif - -#endif/*_DOSLIB_KB_H_*/ +#ifndef _DOSLIB_KB_H_ +#define _DOSLIB_KB_H_ +#include "lib\lib_head.h" + +/* Maximum number of scan codes on keyboard controllers */ +#define NUM_SCANCODES 128 + +#ifdef __cplusplus /* Functions must be declared C style */ +extern "C" { +#endif +void interrupt far newkb(void); +//extern void interrupt (far *oldkb)(void); +void setkb(int vq); +int keyp(byte c); + +/* Define macro */ +//#define kepn(c) key[c & 0x7F] + +#ifdef __cplusplus +} +#endif + +#endif/*_DOSLIB_KB_H_*/ diff --git a/lib/lib_head.h b/lib/lib_head.h index ba2c8b59..7e034ad6 100644 --- a/lib/lib_head.h +++ b/lib/lib_head.h @@ -1,106 +1,106 @@ -#ifndef _LIBHEAD_H_ -#define _LIBHEAD_H_ -#include -#include -#include // just for wait +#ifndef _LIBHEAD_H_ +#define _LIBHEAD_H_ +#include +#include +#include // just for wait #include // just for wait -#include "types.h" - -/* Control codes for all keys on the keyboard */ -//here temperarly -#define KEY_A (0x1E) -#define KEY_B (0x30) -#define KEY_C (0x2E) -#define KEY_D (0x20) -#define KEY_E (0x12) -#define KEY_F (0x21) -#define KEY_G (0x22) -#define KEY_H (0x23) -#define KEY_I (0x17) -#define KEY_J (0x24) -#define KEY_K (0x25) -#define KEY_L (0x26) -#define KEY_M (0x32) -#define KEY_N (0x31) -#define KEY_O (0x18) -#define KEY_P (0x19) -#define KEY_Q (0x10) -#define KEY_R (0x13) -#define KEY_S (0x1F) -#define KEY_T (0x14) -#define KEY_U (0x16) -#define KEY_V (0x2F) -#define KEY_W (0x11) -#define KEY_X (0x2D) -#define KEY_Y (0x15) -#define KEY_Z (0x2C) -#define KEY_1 (0x02) -#define KEY_2 (0x03) -#define KEY_3 (0x04) -#define KEY_4 (0x05) -#define KEY_5 (0x06) -#define KEY_6 (0x07) -#define KEY_7 (0x08) -#define KEY_8 (0x09) -#define KEY_9 (0x0A) -#define KEY_0 (0x0B) -#define KEY_DASH (0x0C) /* -_ */ -#define KEY_EQUAL (0x0D) /* =+ */ -#define KEY_LBRACKET (0x1A) /* [{ */ -#define KEY_RBRACKET (0x1B) /* ]} */ -#define KEY_SEMICOLON (0x27) /* ;: */ -#define KEY_RQUOTE (0x28) /* '" */ -#define KEY_LQUOTE (0x29) /* `~ */ -#define KEY_PERIOD (0x33) /* .> */ -#define KEY_COMMA (0x34) /* ,< */ -#define KEY_SLASH (0x35) /* /? */ -#define KEY_BACKSLASH (0x2B) /* \| */ -#define KEY_F1 (0x3B) -#define KEY_F2 (0x3C) -#define KEY_F3 (0x3D) -#define KEY_F4 (0x3E) -#define KEY_F5 (0x3F) -#define KEY_F6 (0x40) -#define KEY_F7 (0x41) -#define KEY_F8 (0x42) -#define KEY_F9 (0x43) -#define KEY_F10 (0x44) -#define KEY_ESC (0x01) -#define KEY_BACKSPACE (0x0E) -#define KEY_TAB (0x0F) -#define KEY_ENTER (0x1C) -#define KEY_CONTROL (0x1D) -#define KEY_LSHIFT (0x2A) -#define KEY_RSHIFT (0x36) -#define KEY_PRTSC (0x37) -#define KEY_ALT (0x38) -#define KEY_SPACE (0x39) -#define KEY_CAPSLOCK (0x3A) -#define KEY_NUMLOCK (0x45) -#define KEY_SCROLLLOCK (0x46) -#define KEY_HOME (0x47) -#define KEY_UP (0x48) -#define KEY_PGUP (0x49) -#define KEY_MINUS (0x4A) -#define KEY_LEFT (0x4B) -#define KEY_CENTER (0x4C) -#define KEY_RIGHT (0x4D) -#define KEY_PLUS (0x4E) -#define KEY_END (0x4F) -#define KEY_DOWN (0x50) -#define KEY_PGDOWN (0x51) -#define KEY_INS (0x52) -#define KEY_DEL (0x53) - -#define KEY_LWIN (0x73) -#define KEY_RWIN (0x74) -#define KEY_MENU (0x75) - - +#include "types.h" + +/* Control codes for all keys on the keyboard */ +//here temperarly +#define KEY_A (0x1E) +#define KEY_B (0x30) +#define KEY_C (0x2E) +#define KEY_D (0x20) +#define KEY_E (0x12) +#define KEY_F (0x21) +#define KEY_G (0x22) +#define KEY_H (0x23) +#define KEY_I (0x17) +#define KEY_J (0x24) +#define KEY_K (0x25) +#define KEY_L (0x26) +#define KEY_M (0x32) +#define KEY_N (0x31) +#define KEY_O (0x18) +#define KEY_P (0x19) +#define KEY_Q (0x10) +#define KEY_R (0x13) +#define KEY_S (0x1F) +#define KEY_T (0x14) +#define KEY_U (0x16) +#define KEY_V (0x2F) +#define KEY_W (0x11) +#define KEY_X (0x2D) +#define KEY_Y (0x15) +#define KEY_Z (0x2C) +#define KEY_1 (0x02) +#define KEY_2 (0x03) +#define KEY_3 (0x04) +#define KEY_4 (0x05) +#define KEY_5 (0x06) +#define KEY_6 (0x07) +#define KEY_7 (0x08) +#define KEY_8 (0x09) +#define KEY_9 (0x0A) +#define KEY_0 (0x0B) +#define KEY_DASH (0x0C) /* -_ */ +#define KEY_EQUAL (0x0D) /* =+ */ +#define KEY_LBRACKET (0x1A) /* [{ */ +#define KEY_RBRACKET (0x1B) /* ]} */ +#define KEY_SEMICOLON (0x27) /* ;: */ +#define KEY_RQUOTE (0x28) /* '" */ +#define KEY_LQUOTE (0x29) /* `~ */ +#define KEY_PERIOD (0x33) /* .> */ +#define KEY_COMMA (0x34) /* ,< */ +#define KEY_SLASH (0x35) /* /? */ +#define KEY_BACKSLASH (0x2B) /* \| */ +#define KEY_F1 (0x3B) +#define KEY_F2 (0x3C) +#define KEY_F3 (0x3D) +#define KEY_F4 (0x3E) +#define KEY_F5 (0x3F) +#define KEY_F6 (0x40) +#define KEY_F7 (0x41) +#define KEY_F8 (0x42) +#define KEY_F9 (0x43) +#define KEY_F10 (0x44) +#define KEY_ESC (0x01) +#define KEY_BACKSPACE (0x0E) +#define KEY_TAB (0x0F) +#define KEY_ENTER (0x1C) +#define KEY_CONTROL (0x1D) +#define KEY_LSHIFT (0x2A) +#define KEY_RSHIFT (0x36) +#define KEY_PRTSC (0x37) +#define KEY_ALT (0x38) +#define KEY_SPACE (0x39) +#define KEY_CAPSLOCK (0x3A) +#define KEY_NUMLOCK (0x45) +#define KEY_SCROLLLOCK (0x46) +#define KEY_HOME (0x47) +#define KEY_UP (0x48) +#define KEY_PGUP (0x49) +#define KEY_MINUS (0x4A) +#define KEY_LEFT (0x4B) +#define KEY_CENTER (0x4C) +#define KEY_RIGHT (0x4D) +#define KEY_PLUS (0x4E) +#define KEY_END (0x4F) +#define KEY_DOWN (0x50) +#define KEY_PGDOWN (0x51) +#define KEY_INS (0x52) +#define KEY_DEL (0x53) + +#define KEY_LWIN (0x73) +#define KEY_RWIN (0x74) +#define KEY_MENU (0x75) + + //typedef unsigned char byte; //typedef unsigned int word; -//typedef unsigned short syte; - -void wait(clock_t wait); - -#endif/*_LIBHEAD_H_*/ +//typedef unsigned short syte; + +void wait(clock_t wait); + +#endif/*_LIBHEAD_H_*/ -- 2.39.5