From: sparky4 <sparky4@cock.li>
Date: Mon, 31 Oct 2016 15:36:54 +0000 (-0500)
Subject: did some cleanings wwww
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=16fee04bfaa2cf218b1a906b0df0ed7e3a5706fa;p=16.git

did some cleanings wwww
---

diff --git a/src/lib/zcroll16.c b/16/zcroll16.c
similarity index 100%
rename from src/lib/zcroll16.c
rename to 16/zcroll16.c
diff --git a/src/lib/zcroll16.h b/16/zcroll16.h
similarity index 96%
rename from src/lib/zcroll16.h
rename to 16/zcroll16.h
index 6f663429..ca730c23 100755
--- a/src/lib/zcroll16.h
+++ b/16/zcroll16.h
@@ -25,7 +25,7 @@
 
 #include "src/lib/16_head.h"
 //#include "src/lib/bakapee.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 //#include "src/lib/16_in.h"
 #include "src/lib/bitmap.h"
 #include "src/lib/16_map.h" //map is loaded here www
@@ -93,7 +93,7 @@ extern unsigned char shinku_fps_indicator_page;
  * 1. Calculate, store and update a panning info, which includes, but not limited to:
  * 	combined layer information, actual map representation (reflecting real state of the game),
  * 	pixel shift for smooth tile scrolling.
- * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling, 
+ * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling,
  * 	additional row/column is always drawn at the each side of the map. This implies that 'fence'
  * 	should have a sprite too. Map is drawn left-to-right, top-to-bottom.
  */
diff --git a/MEMINFO.16W b/MEMINFO.16W
old mode 100644
new mode 100755
diff --git a/cutetest.bat b/cutetest.bat
old mode 100644
new mode 100755
diff --git a/fmemtest.exe b/fmemtest.exe
index ee3480f3..1dd10568 100755
Binary files a/fmemtest.exe and b/fmemtest.exe differ
diff --git a/fontgfx.exe b/fontgfx.exe
index d8891c5e..49b58b65 100755
Binary files a/fontgfx.exe and b/fontgfx.exe differ
diff --git a/fonttest.exe b/fonttest.exe
index 22505eb0..99e247b8 100755
Binary files a/fonttest.exe and b/fonttest.exe differ
diff --git a/inputest.exe b/inputest.exe
index 0bc39164..53a9bc31 100755
Binary files a/inputest.exe and b/inputest.exe differ
diff --git a/makefile b/makefile
index 91da58cd..4582df3c 100755
--- a/makefile
+++ b/makefile
@@ -66,7 +66,7 @@ SRCLIB=src/lib
 JSMNLIB=src/lib/jsmn
 NYANLIB=src/lib/nyan
 EXMMLIB=src/lib/exmm
-MODEXLIB16=src/lib/modex16
+MODEXLIB16=src/lib/16_vl
 MODEXLIB=src/lib/modex
 VGMSNDLIB=src/lib/vgmsnd
 DOSLIB=src/lib/doslib
@@ -106,7 +106,8 @@ LIBFLAGS=$(WLIBQ) -b -n
 # objects
 #
 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
-GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(OBJ)
+GFXLIBOBJS = 16_vl.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(OBJ)
+OLDGFXLIBOBJS=bitmap.$(OBJ)
 16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) wcpu.$(OBJ) 16_timer.$(OBJ)
 #16planar.$(OBJ) planar.$(OBJ)
 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
@@ -181,6 +182,7 @@ EXEC = &
     $(TESTEXEC)
 
 all: $(EXEC) joytest.exe
+testexec: $(EXEC) joytest.exe $(TESTEXEC2)
 
 #
 # game and bakapi executables
@@ -191,7 +193,7 @@ bakapi.exe:       bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS)
 #
 # Test Executables!
 #
-scroll.exe:       scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+scroll.exe:       scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS)
 scroll.$(OBJ):    $(SRC)/scroll.c
 zcroll.exe:       zcroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
 zcroll.$(OBJ):    $(SRC)/zcroll.c
@@ -207,12 +209,12 @@ fonttest.exe:     fonttest.$(OBJ) gfx.lib
 fontgfx.exe:      fontgfx.$(OBJ) gfx.lib $(DOSLIBLIBS)
 inputest.exe:     inputest.$(OBJ) $(16LIB) $(DOSLIBLIBS)
 #sountest.exe:    sountest.$(OBJ) $(16LIB)
-pcxtest.exe:      pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS)
+pcxtest.exe:      pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS)
 vrstest.exe:      vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
 #vgacamm.exe:      vgacamm.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
 palettec.exe:     palettec.$(OBJ) gfx.lib $(DOSLIBLIBS)
 palettel.exe:     palettel.$(OBJ) gfx.lib $(DOSLIBLIBS)
-pcxtest2.exe:     pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS)
+pcxtest2.exe:     pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS) $(OLDGFXLIBOBJS)
 #planrpcx.exe:    planrpcx.$(OBJ) gfx.lib
 maptest.exe:      maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) jsmn.$(OBJ) gfx.lib $(DOSLIBLIBS)
 fmemtest.exe:     fmemtest.$(OBJ)
@@ -224,17 +226,17 @@ vgmtest.exe:      vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIBLIBS)
 #
 16.$(OBJ):        $(SRC)/16.c $(SRC)/16.h
 bakapi.$(OBJ):    $(SRC)/bakapi.c $(SRC)/bakapi.h
-test.$(OBJ):      $(SRC)/test.c $(SRCLIB)/modex16.h
-#test2.$(OBJ):    $(SRC)/test2.c $(SRCLIB)/modex16.h
+test.$(OBJ):      $(SRC)/test.c $(SRCLIB)/16_vl.h
+#test2.$(OBJ):    $(SRC)/test2.c $(SRCLIB)/16_vl.h
 test0.$(OBJ):     $(SRC)/test0.c
-pcxtest.$(OBJ):   $(SRC)/pcxtest.c $(SRCLIB)/modex16.h
-vrstest.$(OBJ):   $(SRC)/vrstest.c $(SRCLIB)/modex16.h
-#vgacamm.$(OBJ):   $(SRC)/vgacamm.c $(SRCLIB)/modex16.h
-#planrpcx.$(OBJ): $(SRC)/planrpcx.c $(SRCLIB)/modex16.h
-pcxtest2.$(OBJ):  $(SRC)/pcxtest2.c $(SRCLIB)/modex16.h
+pcxtest.$(OBJ):   $(SRC)/pcxtest.c $(SRCLIB)/16_vl.h
+vrstest.$(OBJ):   $(SRC)/vrstest.c $(SRCLIB)/16_vl.h
+#vgacamm.$(OBJ):   $(SRC)/vgacamm.c $(SRCLIB)/16_vl.h
+#planrpcx.$(OBJ): $(SRC)/planrpcx.c $(SRCLIB)/16_vl.h
+pcxtest2.$(OBJ):  $(SRC)/pcxtest2.c $(SRCLIB)/16_vl.h
 palettec.$(OBJ):  $(SRC)/palettec.c
 palettel.$(OBJ):  $(SRC)/palettel.c
-maptest.$(OBJ):   $(SRC)/maptest.c $(SRCLIB)/modex16.h
+maptest.$(OBJ):   $(SRC)/maptest.c $(SRCLIB)/16_vl.h
 #emmtest.$(OBJ):  $(SRC)/emmtest.c
 #emsdump.$(OBJ):  $(SRC)/emsdump.c
 fmemtest.$(OBJ):  $(SRC)/fmemtest.c
@@ -278,7 +280,7 @@ joytest.exe:
 	cd $(DOSLIB_JOYSTICK:$(to_os_path)) && $(DOSLIBMAKE) && cd $(BUILD_ROOT)
 	$(COPYCOMMAND) $(DOSLIB_JOYSTICK:$(to_os_path))$(DIRSEP)dos86h$(DIRSEP)test.exe joytest.exe
 
-modex16.$(OBJ):   $(SRCLIB)/modex16.c $(SRCLIB)/modex16.h
+16_vl.$(OBJ):   $(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h
 bakapee.$(OBJ):   $(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h
 16render.$(OBJ):  $(SRCLIB)/16render.c $(SRCLIB)/16render.h
 16planar.$(OBJ):  $(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h
diff --git a/maptest.exe b/maptest.exe
index e8e04a63..e387020e 100755
Binary files a/maptest.exe and b/maptest.exe differ
diff --git a/pcxtest.exe b/pcxtest.exe
index 9f5b8217..5febf452 100755
Binary files a/pcxtest.exe and b/pcxtest.exe differ
diff --git a/pcxtest2.exe b/pcxtest2.exe
index ef3287a2..caffd3da 100755
Binary files a/pcxtest2.exe and b/pcxtest2.exe differ
diff --git a/q.sh b/q.sh
new file mode 100755
index 00000000..db78af58
--- /dev/null
+++ b/q.sh
@@ -0,0 +1 @@
+grep -iR "$1" src/*
diff --git a/src/16.h b/src/16.h
index 7f792bbb..958a8e39 100755
--- a/src/16.h
+++ b/src/16.h
@@ -25,7 +25,7 @@
 
 #include "src/lib/16_head.h"
 #include "src/lib/16_in.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/wcpu/wcpu.h"
 //#include "src/lib/planar.h"
 #include "src/lib/scroll16.h"
diff --git a/src/exmmtest.c b/src/exmmtest.c
index f68d148e..fc4eb11d 100755
--- a/src/exmmtest.c
+++ b/src/exmmtest.c
@@ -28,7 +28,7 @@
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
 #include "src/lib/16_hc.h"
-//#include "src/lib/modex16.h"
+//#include "src/lib/16_vl.h"
 #pragma hdrstop
 
 #pragma warn -pro
@@ -69,9 +69,9 @@ main(int argc, char *argv[])
 {
 	byte w=1;
 	static global_game_variables_t gvar;
-#ifdef __WATCOMC__
-	__segment sega;
-#endif
+//#ifdef __WATCOMC__
+//	__segment sega;
+//#endif
 	memptr bigbuffer;
 
 	//static byte bakapee[64];
@@ -133,9 +133,9 @@ for(w=0;w<2;w++)
 	}
 //	close(bakapeehandle);
 	//hmm functions in cache system use the buffered stuff
-#ifdef __WATCOMC__
-	printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));
-#endif
+//#ifdef __WATCOMC__
+//	printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));
+//#endif
 
 	printf("contents of the buffer\n[\n%s\n]\n", bigbuffer);
 	//printf("dark purple = purgable\n");
diff --git a/src/fontgfx.c b/src/fontgfx.c
index 354a897b..e25a130a 100755
--- a/src/fontgfx.c
+++ b/src/fontgfx.c
@@ -21,9 +21,9 @@
  */
 #include <stdio.h>
 #include <conio.h>
-#include "lib/types.h"
+#include "src/lib/types.h"
 //#include "lib/16text.h"
-#include "lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 #include <hw/cpu/cpu.h>
 #include <hw/dos/dos.h>
diff --git a/src/inputest.c b/src/inputest.c
index be6ac4a2..a573d54a 100755
--- a/src/inputest.c
+++ b/src/inputest.c
@@ -30,7 +30,7 @@ main(int argc, char *argv[])
 	global_game_variables_t gvar;
 	player_t player[MaxPlayers];
 	//extern struct inconfig inpu;
-	dbg_testkeyin=0;
+	dbg_testkeyin=1;
 	dbg_testcontrolnoisy=1;
 	IN_Startup();
 	IN_Default(0,&player,ctrl_Joystick1);
diff --git a/src/lib/16_head.h b/src/lib/16_head.h
index 6b189d87..ef63aaf3 100755
--- a/src/lib/16_head.h
+++ b/src/lib/16_head.h
@@ -155,13 +155,15 @@
 #define KEY_MENU		(0x75)
 */
 
-static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
+//static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 extern	int			profilehandle,debughandle;	//make it into game global
 
 #define __DEBUG__
 //#define __DEBUG_PM__
 //#define __DEBUG_MM__
 
+//#define OLD16_VL
+
 #define	nil	((void *)0)
 #ifdef __BORLANDC__
 #define _FCORELEFT 0x90000UL-16UL
@@ -169,7 +171,7 @@ extern	int			profilehandle,debughandle;	//make it into game global
 #endif
 #ifdef __WATCOMC__
 #define _FCORELEFT 0x90000UL+16UL
-static union REGS CPURegs;
+/*static union REGS CPURegs;
 
 #define _AX CPURegs.x.ax
 #define _BX CPURegs.x.bx
@@ -187,7 +189,7 @@ static union REGS CPURegs;
 #define _DH CPURegs.h.dh
 #define _DL CPURegs.h.dl
 
-#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);*/
 #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))
diff --git a/src/lib/16_in.c b/src/lib/16_in.c
index 85709c5e..0851baa9 100755
--- a/src/lib/16_in.c
+++ b/src/lib/16_in.c
@@ -42,6 +42,8 @@
 boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;
 #endif
 
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
+
 /*
 =============================================================================
 
diff --git a/src/lib/16_in.h b/src/lib/16_in.h
index 29ecc130..eb1650e4 100755
--- a/src/lib/16_in.h
+++ b/src/lib/16_in.h
@@ -33,7 +33,7 @@
 #ifdef __WATCOMC__	//borland C BCEXMM.EXE
 #include "src/lib/16_dbg.h"
 #include "src/lib/16_sprit.h"
-#include "src/lib/bitmap.h"	//old format
+//#include "src/lib/bitmap.h"	//old format
 #endif
 #ifdef	__DEBUG__
 #define	__DEBUG_InputMgr__
diff --git a/src/lib/16_map.c b/src/lib/16_map.c
index d697142d..c3d66e2c 100755
--- a/src/lib/16_map.c
+++ b/src/lib/16_map.c
@@ -84,7 +84,7 @@ void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {
 					map->tiles[k]->debug_text=false;
 					//Fix to load tileset specified.
 					//And move to vrs, probably
-					bp = bitmapLoadPcx("data/ed.pcx");
+					//bp = bitmapLoadPcx("data/ed.pcx");
 					map->tiles[k]->btdata = &bp;
 					k++;
 				}
@@ -151,6 +151,6 @@ int loadmap(char *mn, map_t *map) {
 	free(js);
 	free(tok);
 	fclose(fh);
-	
+
 	return 0;
 }
diff --git a/src/lib/16_map.h b/src/lib/16_map.h
index cd3f9349..0642d2b4 100755
--- a/src/lib/16_map.h
+++ b/src/lib/16_map.h
@@ -26,7 +26,7 @@
 #include "jsmn/jsmn.h"
 //#include "stdio.h" included in 16_head.h
 //#include "stdlib.h" included in 16_head.h
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_head.h"
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c
index 42a87440..c2636335 100755
--- a/src/lib/16_mm.c
+++ b/src/lib/16_mm.c
@@ -770,9 +770,7 @@ void MM_Startup(global_game_variables_t *gvar)
 	gvar->mm.mmhead = NULL;
 	gvar->mm.mmfree = &(gvar->mm.mmblocks[0]);
 	for(i=0;i<MAXBLOCKS-1;i++)
-	{
 		gvar->mm.mmblocks[i].next = &(gvar->mm.mmblocks[i+1]);
-	}
 	gvar->mm.mmblocks[i].next = NULL;
 
 //
diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c
index c9019b78..ac61e20d 100755
--- a/src/lib/16_pm.c
+++ b/src/lib/16_pm.c
@@ -70,6 +70,26 @@ boolean dbg_debugpm=0;
 	PageListStruct	far *gvar->pm.PMPages,
 					_seg *gvar->pm.PMSegPages;*/
 
+static union REGS CPURegs;
+
+#define _AX CPURegs.x.ax
+#define _BX CPURegs.x.bx
+#define _CX CPURegs.x.cx
+#define _DX CPURegs.x.dx
+
+#define _SI CPURegs.x.si
+
+#define _AH CPURegs.h.ah
+#define _AL CPURegs.h.al
+#define _BH CPURegs.h.bh
+#define _BL CPURegs.h.bl
+#define _CH CPURegs.h.ch
+#define _CL CPURegs.h.cl
+#define _DH CPURegs.h.dh
+#define _DL CPURegs.h.dl
+
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);
+
 static	char		*ParmStrings[] = {"nomain","noems","noxms",nil};
 
 /////////////////////////////////////////////////////////////////////////////
diff --git a/src/lib/16_timer.c b/src/lib/16_timer.c
index 4ce49709..5cb216c1 100755
--- a/src/lib/16_timer.c
+++ b/src/lib/16_timer.c
@@ -22,6 +22,8 @@
 
 #include "src/lib/16_timer.h"
 
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
+
 clock_t start_timer(global_game_variables_t *gv)
 {
 	gv->kurokku.t = clock();
diff --git a/src/lib/modex16.c b/src/lib/16_vl.c
similarity index 96%
rename from src/lib/modex16.c
rename to src/lib/16_vl.c
index b8f733be..503cad06 100755
--- a/src/lib/modex16.c
+++ b/src/lib/16_vl.c
@@ -23,7 +23,7 @@
 #include <conio.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 byte far* VGA=(byte far*) 0xA0000000;   /* this points to video memory. */
 
diff --git a/src/lib/modex16.h b/src/lib/16_vl.h
similarity index 92%
rename from src/lib/modex16.h
rename to src/lib/16_vl.h
index 3467a77d..37eab24a 100755
--- a/src/lib/modex16.h
+++ b/src/lib/16_vl.h
@@ -45,26 +45,6 @@
 #include <hw/vga/vrs.h>
 #endif
 
-static struct pcxHeader {
-	byte id;
-	byte version;
-	byte encoding;
-	byte bpp;
-	word xmin;
-	word ymin;
-	word xmax;
-	word ymax;
-	word hres;
-	word vres;
-	byte pal16[48];
-	byte res1;
-	word bpplane;
-	word palType;
-	word hScreenSize;
-	word vScreenSize;
-	byte padding[54];
-} head;
-
 //320x240 = 20x15
 //192x144 = 12x9
 
diff --git a/src/lib/16_vrs.h b/src/lib/16_vrs.h
index cdeb81a0..9aceda0a 100755
--- a/src/lib/16_vrs.h
+++ b/src/lib/16_vrs.h
@@ -22,7 +22,7 @@
 #ifndef __16_VRS__
 #define __16_VRS__
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/typdefst.h"
 //#include <hw/cpu/cpu.h>
 //#include <hw/dos/dos.h>
diff --git a/src/lib/16render.h b/src/lib/16render.h
index 9edce937..de842416 100755
--- a/src/lib/16render.h
+++ b/src/lib/16render.h
@@ -23,7 +23,7 @@
 #ifndef __RENDER_H__
 #define __RENDER_H__
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 void modexDrawPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite);
 void modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite); /*temp*/
diff --git a/src/lib/bakapee.h b/src/lib/bakapee.h
index 7ae770a1..4d3df42c 100755
--- a/src/lib/bakapee.h
+++ b/src/lib/bakapee.h
@@ -45,7 +45,7 @@
  *
  */
 #include "src/lib/16_head.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include <hw/cpu/cpu.h>
 #include <hw/dos/dos.h>
 #include <hw/vga/vga.h>
diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c
index 7696cc34..1e4a8d5b 100755
--- a/src/lib/bitmap.c
+++ b/src/lib/bitmap.c
@@ -25,6 +25,26 @@
 #include <malloc.h>
 #include "src/lib/bitmap.h"
 
+static struct pcxHeader {
+	byte id;
+	byte version;
+	byte encoding;
+	byte bpp;
+	word xmin;
+	word ymin;
+	word xmax;
+	word ymax;
+	word hres;
+	word vres;
+	byte pal16[48];
+	byte res1;
+	word bpplane;
+	word palType;
+	word hScreenSize;
+	word vScreenSize;
+	byte padding[54];
+} head;
+
 static void loadPcxStage1(FILE *file, bitmap_t *result) {
 	long bufSize;
 	int index;
diff --git a/src/lib/bitmap.h b/src/lib/bitmap.h
index 1d0154b1..6ef0af71 100755
--- a/src/lib/bitmap.h
+++ b/src/lib/bitmap.h
@@ -26,7 +26,7 @@
 #ifndef BITMAP_H
 #define BITMAP_H
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 bitmap_t bitmapLoadPcx(char *filename);
 tileset_t bitmapLoadPcxTiles(char *filename, word twidth, word theight);
diff --git a/src/lib/doslib b/src/lib/doslib
index 979eddc7..0ee1f206 160000
--- a/src/lib/doslib
+++ b/src/lib/doslib
@@ -1 +1 @@
-Subproject commit 979eddc7c8c7b92b6905d147c242ef7ea055d847
+Subproject commit 0ee1f206b4a2591ecfeca688c070a354e2ac0249
diff --git a/src/lib/mapread.c b/src/lib/mapread.c
index 5421d9dd..039e0a01 100755
--- a/src/lib/mapread.c
+++ b/src/lib/mapread.c
@@ -95,7 +95,7 @@ word dump(const char *js, jsmntok_t *t, size_t count, word indent, char *js_sv,
 			map->tiles = malloc(sizeof(tiles_t));
 			map->tiles->btdata = malloc(sizeof(bitmap_t));
 			//fix this to be far~
-			bp = bitmapLoadPcx("data/ed.pcx");
+//0000			bp = bitmapLoadPcx("data/ed.pcx");
 //			bp = bitmapLoadPcx("data/koishi^^.pcx");
 			map->tiles->btdata = &bp;
 //----			map->tiles->data = planar_buf_from_bitmap(&bp);
diff --git a/src/lib/mapread.h b/src/lib/mapread.h
index d3c26c03..88cc79ef 100755
--- a/src/lib/mapread.h
+++ b/src/lib/mapread.h
@@ -24,7 +24,7 @@
 #define _LIBMAPREAD_H_
 
 #include "src/lib/jsmn/jsmn.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_head.h"
 
 //#define DEBUG_MAPDATA
diff --git a/src/lib/modex16/16planar.h b/src/lib/modex16/16planar.h
index 2ff43e46..8084f70a 100755
--- a/src/lib/modex16/16planar.h
+++ b/src/lib/modex16/16planar.h
@@ -28,7 +28,7 @@
 #ifndef PLANW_H
 #define PLANW_H
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 planar_buf_t planarLoadPcx(char *filename);
 tileset_t planarLoadPcxTiles(char *filename, word twidth, word theight);
diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h
index 84b3eab0..2c75c4eb 100755
--- a/src/lib/scroll16.h
+++ b/src/lib/scroll16.h
@@ -25,7 +25,7 @@
 
 #include "src/lib/16_head.h"
 #include "src/lib/bakapee.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_in.h"
 #include "src/lib/bitmap.h"
 #include "src/lib/mapread.h" //map is loaded here www
diff --git a/src/palettec.c b/src/palettec.c
index 25437fcb..624b098f 100755
--- a/src/palettec.c
+++ b/src/palettec.c
@@ -20,7 +20,7 @@
  *
  */
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 
 global_game_variables_t gvar;
 
diff --git a/src/palettel.c b/src/palettel.c
index 04beeff6..53e86c2d 100755
--- a/src/palettel.c
+++ b/src/palettel.c
@@ -20,7 +20,7 @@
  *
  */
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/bakapee.h"
 
 global_game_variables_t gvar;
diff --git a/src/pcxtest.c b/src/pcxtest.c
index 2f61443d..84a83236 100755
--- a/src/pcxtest.c
+++ b/src/pcxtest.c
@@ -23,11 +23,12 @@
 #include <stdio.h>
 #include <dos.h>
 #include <string.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/bitmap.h"
 //----#include "src/lib/planar.h"
 
 global_game_variables_t gvar;
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 
 void main() {
 	bitmap_t bmp;
diff --git a/src/pcxtest2.c b/src/pcxtest2.c
index 167e1f6a..f92c300b 100755
--- a/src/pcxtest2.c
+++ b/src/pcxtest2.c
@@ -23,11 +23,12 @@
 #include <stdio.h>
 #include <dos.h>
 #include <string.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/bitmap.h"
 //----#include "src/lib/planar.h"
 
 global_game_variables_t gvar;
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 
 /*
 void
diff --git a/src/planrpcx.c b/src/planrpcx.c
index eea4796c..e6733026 100755
--- a/src/planrpcx.c
+++ b/src/planrpcx.c
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <dos.h>
 #include <string.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/modex16/16planar.h"
 
 global_game_variables_t gvar;
diff --git a/src/test.c b/src/test.c
index cb75a0fa..dfbc7de8 100755
--- a/src/test.c
+++ b/src/test.c
@@ -21,11 +21,12 @@
  */
 
 #include <stdio.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_in.h"
 #include "src/lib/scroll16.h"
 #include "src/lib/bakapee.h"
 
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
 global_game_variables_t gvar;
 player_t player[MaxPlayers];
 map_view_t mv[4];
diff --git a/src/test2.c b/src/test2.c
index 722678a6..b4c33ee3 100755
--- a/src/test2.c
+++ b/src/test2.c
@@ -22,7 +22,7 @@
 
 #include <stdio.h>
 #include <conio.h>
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/planar.h"
 //#include "src/lib/bitmap.h"
 
diff --git a/src/tesuto.h b/src/tesuto.h
index d1f8bbbe..7578e4ab 100755
--- a/src/tesuto.h
+++ b/src/tesuto.h
@@ -2,7 +2,7 @@
 #define __TESUTO_H__
 
 #include "src/lib/16_head.h"
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_in.h"
 #include <hw/cpu/cpu.h>
 #include <hw/dos/dos.h>
diff --git a/src/vgacamm.c b/src/vgacamm.c
index e77fbc6e..2c8eaa89 100755
--- a/src/vgacamm.c
+++ b/src/vgacamm.c
@@ -20,11 +20,13 @@
  *
  */
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_sprit.h"
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
 
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
+
 void main() {
 	global_game_variables_t gvar;
 	__segment sega;
diff --git a/src/vrstest.c b/src/vrstest.c
index cdba1e9b..9acf2649 100755
--- a/src/vrstest.c
+++ b/src/vrstest.c
@@ -20,25 +20,27 @@
  *
  */
 
-#include "src/lib/modex16.h"
+#include "src/lib/16_vl.h"
 #include "src/lib/16_sprit.h"
 #include "src/lib/16_tail.h"
 #include "src/lib/16_pm.h"
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
 
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
+
 void main() {
 	static global_game_variables_t gvar;
-	__segment sega;
+	//__segment sega;
 	memptr bigbuffer;
 	int i;
 	word start;
 	float t1, t2;
 	boolean baka;
-	byte *pal;
-	int size;
+	byte *pal=0;
+	int size=0;
 	struct sprite spri;
-	vrl1_vgax_offset_t * off, *off1;
+	//vrl1_vgax_offset_t * off, *off1;
 	struct vrs_container vrs;
 	vrl1_vgax_offset_t **vrl_line_offsets;
 	uint32_t huge *vrl_headers_offsets;
diff --git a/test.exe b/test.exe
index c26af169..fc489c2c 100755
Binary files a/test.exe and b/test.exe differ
diff --git a/test0.exe b/test0.exe
index a8a34c97..31c4ed41 100755
Binary files a/test0.exe and b/test0.exe differ
diff --git a/vgmtest.exe b/vgmtest.exe
index d4aeea4b..68c88c98 100755
Binary files a/vgmtest.exe and b/vgmtest.exe differ