From: sparky4 Date: Tue, 4 Apr 2017 15:45:20 +0000 (-0500) Subject: p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=6c9e6f3b81c3daae1085654eeb822d1fb6c1db74;p=16.git p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] --- diff --git a/EXMMTEST.LOG b/EXMMTEST.LOG deleted file mode 100755 index c0eeeaa8..00000000 --- a/EXMMTEST.LOG +++ /dev/null @@ -1,112 +0,0 @@ -======================================load===================================== -====================================load end=================================== -contents of the buffer -[ - - -] - -yay! -======================================read===================================== -====================================read end=================================== -contents of the buffer -[ -{ "backgroundcolor":"#000000", - "height":30, - "layers":[ - { - "data":[1, 2, 3, 4, 0, 3, 3, 3, 3, 3, 3, 3, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 0, 1, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 6, 7, 8, 9, 10, 11, 12, 4, 1, 0, 1, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 1, 1, 5, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 14, 15, 16, 0, 0, 4, 0, 0, 0, 0, 0, 8, 8, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 8, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 1, 2, 3, 4, 3, 3, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 5, 6, 7, 8, 6, 6, 6, 6, 6, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 11, 11, 11, 11, 11, 9, 10, 11, 12, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 13, 14, 15, 16, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 0, 0, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 1, 2, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 1, 2, 3, 4, 5, 6, 7, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11, 5, 6, 7, 8, 9, 10, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 10, 11, 12, 13, 14, 15, 16, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 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 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, 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, 0, 0, 0, 0, 0, 0, 0, 0], - "height":30, - "name":"top", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":40, - "x":0, - "y":0 - }, - { - "height":30, - "name":"ob", - "objects":[ - { - "height":16, - "name":"trunk", - "properties": - { - "walkable":"0" - }, - "type":"nonc", - "visible":true, - "width":32, - "x":128, - "y":32 - }, - { - "height":16, - "name":"stump", - "properties": - { - "walkable":"0" - }, - "type":"nonc", - "visible":true, - "width":16, - "x":144, - "y":128 - }], - "opacity":1, - "type":"objectgroup", - "visible":true, - "width":40, - "x":0, - "y":0 - }], - "orientation":"orthogonal", - "properties": - { - - }, - "tileheight":16, - "tilesets":[ - { - "firstgid":1, - "image":"ed.png", - "imageheight":64, - "imagewidth":64, - "margin":0, - "name":"wwww", - "properties": - { - - }, - "spacing":0, - "tileheight":16, - "tilewidth":16 - }, - { - "firstgid":17, - "image":"forest.gif", - "imageheight": \ No newline at end of file diff --git a/bcexmm.dsk b/bcexmm.dsk index c7cdb89b..e6b4ad63 100755 Binary files a/bcexmm.dsk and b/bcexmm.dsk differ diff --git a/bcexmm.exe b/bcexmm.exe index f3389f41..947c9441 100755 Binary files a/bcexmm.exe and b/bcexmm.exe differ diff --git a/bcexmm.prj b/bcexmm.prj index 10728db9..8e3d98de 100755 Binary files a/bcexmm.prj and b/bcexmm.prj differ diff --git a/makefile b/makefile index 69486b5b..589d5ff0 100755 --- a/makefile +++ b/makefile @@ -188,8 +188,6 @@ EXTERNTESTEXEC = & db.exe TESTEXEC = & vidtest.exe & - tesuto.exe & - 0.exe & exmmtest.exe & vgmtest.exe & xcroll.exe & @@ -204,6 +202,8 @@ TESTEXEC2 = & fonttest.exe & fontgfx.exe & test0.exe & + tesuto.exe & + 0.exe & $(EXTERNTESTEXEC) TESTEXEC3= & pcxtest2.exe @@ -242,7 +242,7 @@ testexec: $(EXEC) $(TESTEXEC2) # game and bakapi executables # 16.exe: 16.$(OBJ) $(16LIB) gfx.lib $(DOSLIB) -bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIB) +bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIB) 16_wcpu.$(OBJ) # # Test Executables! @@ -347,7 +347,7 @@ joytest.exe: 16_vl.$(OBJ): $(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h 16_vl_1.$(OBJ): $(SRCLIB)/16_vl_1.c $(SRCLIB)/16_vl.h 16_vlpal.$(OBJ): $(SRCLIB)/16_vlpa_.c $(SRCLIB)/16_vlpal.c $(SRCLIB)/16_vlpal.h -bakapee.$(OBJ):$(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.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 16_vrs.$(OBJ): $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIB) diff --git a/src/bakapi.c b/src/bakapi.c index f787933a..cc61dcc8 100755 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -28,7 +28,7 @@ static bakapee_t bakapee; word key,d,xpos,ypos,xdir,ydir; sword vgamodex_mode = 1; // 320x240 default -int ch=0x0; +//int ch=0x0; void main(int argc, char *argvar[]) @@ -86,6 +86,7 @@ main(int argc, char *argvar[]) printf("This program requires VGA or higher graphics hardware\n"); return; } + textInit(); // main variables values d=4; // switch variable @@ -95,17 +96,15 @@ main(int argc, char *argvar[]) xdir=1; ydir=1; - VGAmodeX(vgamodex_mode, 1, &gvar); // TODO: Suggestion: Instead of magic numbers for the first param, might I suggest defining an enum or some #define constants that are easier to remember? --J.C. + VGAmodeX(vgamodex_mode, 0, &gvar); // TODO: Suggestion: Instead of magic numbers for the first param, might I suggest defining an enum or some #define constants that are easier to remember? --J.C. // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in. // we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C. bakapee.xx = rand()&0%gvar.video.page[0].width; bakapee.yy = rand()&0%gvar.video.page[0].height; bakapee.gq = 0; - bakapee.sx=0; - bakapee.sy=0; - bakapee.bakax=0; - bakapee.bakay=0; + bakapee.sx= bakapee.sy=0; + bakapee.bakax= bakapee.bakay=0; bakapee.coor=0; //once where #defines @@ -114,9 +113,18 @@ main(int argc, char *argvar[]) bakapee.lgq=32; bakapee.hgq=55; + switch(WCPU_detectcpu()) + { + case 0: + bakapee.tile=1; + break; + default: + bakapee.tile=0; + break; + } + /* setup camera and screen~ */ gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); - textInit(); //modexPalUpdate(bmp.palette); //____ //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____ @@ -125,7 +133,7 @@ main(int argc, char *argvar[]) VL_ShowPage(&gvar.video.page[0], 0, 0); // screen savers -#ifdef BOINK +//#ifdef BOINK while(d>0) // on! { int c; @@ -285,11 +293,12 @@ pee: break; default: key=0; - break; + break; } } } -#else // !defined(BOINK) +#if 0 +//#else // !defined(BOINK) // FIXME: Does not compile. Do you want to remove this? // INFO: This is a testing section for textrendering and panning for project 16 --sparky4 while(1) @@ -325,5 +334,7 @@ pee: // printf("page.width=%u ", gvar.video.page[0].width); printf("page.height=%u\n", gvar.video.page[0].height); printf("bakapi ver. 1.04.16.04\nis made by sparky4i†ƒÖ…j feel free to use it ^^\nLicence: GPL v3\n"); printf("compiled on 2016/04/04\n"); +// printf("[%u]%dx%d [%dx%d] %u %u %u\n[%u %u %u]", key, bakapee.bakax, bakapee.bakay, bakapee.xx, bakapee.yy, +//bakapee.coor, bakapee.tile, bakapee.gq, bakapee.bonk, bakapee.lgq, bakapee.hgq); } //pee! diff --git a/src/bakapi.h b/src/bakapi.h index 54af8984..cf9aa3fe 100755 --- a/src/bakapi.h +++ b/src/bakapi.h @@ -24,6 +24,7 @@ #define __BAKAPI_H_ #include "src/lib/bakapee.h" +#include "src/lib/wcpu/16_wcpu.h" //project 16 testing define switch for veiwing the contents of the video memory --sparky4 #define BOINK // what does this mean? --J.C. diff --git a/src/exmmtest.c b/src/exmmtest.c index c0d2bbd7..106ebab7 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -45,7 +45,8 @@ //#define EXMMVERBOSE__ // #define PRINTBBDUMP #define BUFFDUMP -//#define NOVID +#define NOVID + #define KEYP IN_Shutdown(&gvar); printf("\n\npress any key to continue!\n"); getch(); IN_Startup(&gvar); @@ -257,7 +258,7 @@ PRINTBB; KEYP switch (scan) { case sc_Space: - MM_ShowMemoryVidVer(&gvar); + MM_ShowMemory(&gvar); break; //#ifdef __WATCOMC__ case sc_O: @@ -353,7 +354,7 @@ PRINTBB; KEYP #endif printf("\n"); #endif - printf("old_mode=%u VL_Started=%u", gvar.video.old_mode, gvar.video.VL_Started); + //printf("old_mode=%u VL_Started=%u", gvar.video.old_mode, gvar.video.VL_Started); //printf("based core left: %lu\n", (dword)_basedcoreleft()); //printf("huge core left: %lu\n", (dword)_hugecoreleft()); } diff --git a/src/lib/16_dbg.h b/src/lib/16_dbg.h index 6903aa57..ede5c359 100755 --- a/src/lib/16_dbg.h +++ b/src/lib/16_dbg.h @@ -22,6 +22,7 @@ extern boolean dbg_debugmm; #endif #ifdef __DEBUG_PM__ +//#define __DEBUG_PM_MAIN__ extern boolean dbg_debugpm; #endif #ifdef __DEBUG_CA__ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index a265e958..8fa8de5b 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1260,31 +1260,34 @@ void MM_SortMem(global_game_variables_t *gvar) void MM_ShowMemory(global_game_variables_t *gvar) { mmblocktype far *scan; - //word temp; + unsigned color,temp,x,y,w; sdword end,owner; - //word chx,chy; - word w; - //dword wwww; - byte scratch[160],scratch0[4096],str[16];//[[[[scratch1[160], - //byte d = '#'; -//[[[[ VW_SetLineWidth(40); -//++++mh temp = bufferofs; -//++++mh bufferofs = 0; -//[[[[ VW_SetScreen (0,0); + byte scratch[160],scratch0[4096],str[16]; + + VL_SetLineWidth(40, &gvar->video.ofs); + temp = gvar->video.ofs.bufferofs; + gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs; scan = gvar->mm.mmhead; - end = -1; + + end = -1; w = 0; CA_OpenDebug (gvar); - w=0; - while(scan) + while (scan) { strcpy(scratch, AARESET); if(scan->attributes & PURGEBITS) + { + color = 5; // dark purple = purgable strcpy(scratch0, AAMAGENTA); // dark purple = purgable - else + }else{ + color = 9; // medium blue = non purgable strcpy(scratch0, AABLUE); // medium blue = non purgable + } if(scan->attributes & LOCKBIT) + { + color = 12; // red = locked strcpy(scratch0, AARED); // red = locked + } if(scan->start<=end) { printf("\nend==%d\n\n", end); @@ -1296,50 +1299,38 @@ void MM_ShowMemory(global_game_variables_t *gvar) ultoa (scan->start,str,10); strcat (scratch,str); write(gvar->handle.debughandle,scratch,strlen(scratch)); - //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n"); - break; + Quit (gvar, "MM_ShowMemory: Memory block order currupted!"); } - end = scan->start+(scan->length)-1; -//++++ chy = scan->start/320; -//++++ chx = scan->start%320; - //modexhlin(page, scan->start, (unsigned)end, chy, color); - //for(chx=scan->start;chx+4>=(word)end;chx+=4) - //{ -//++++ modexClearRegion(page, chx, chy, 4, 4, color); - //} -//++++ VW_Hlin(scan->start,(unsigned)end,0,color); + end = scan->length-1; + //end = scan->start+(scan->length)-1; + y = scan->start/320; + x = scan->start%320; + VW_Hlin(x,x+end,y,color, &gvar->video.ofs); + VL_Plot(x,y,15, &gvar->video.ofs); for(w=(scan->start)/80;w<=end/80;w++) { //printf("+ %u %lu\n", w, scan->length); strcat(scratch0, "+"); } - //++==++==optional strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_"); -//++++ VW_Plot(scan->start,0,15); -//++++ modexClearRegion(page, chx, chy, 4, 4, 15); -//++++ VW_Hlin(end+1,scan->next->start,0,0); // black = free - - //wwww=(dword)(scan->next->start)-(dword)scan->start; - //wwww=(dword)scan->start+(dword)(scan->next->start); - if (scan->next && scan->next->start >= end+1) +//++==++==optional strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_"); + if (scan->next && scan->next->start > end+1) + //if (scan->next && scan->next->start >= end+1) { + VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0, &gvar->video.ofs); // black = free strcat(scratch0, AARESET); - //++==++==optional strcat(scratch0, "\n"); +//++==++==optional strcat(scratch0, "\n"); strcat(scratch0,AAGREEN); for(w=(end+1)/80;w<=((scan->next->start-scan->start)/80);w++) - //for(w=(wwww)/80;w<=((end+1)/80);w++) - //for(w=(end+1)/80;w<=((wwww)/80);w++) { //printf("0 %x %u %lu\n", scan->next->start, w, scan->length); strcat(scratch0,"0"); } //printf("==================\n"); - //printf("w=%u wwww=%lu start=%04x next=%04x end=%lu\n", w/80, wwww/80, scan->start, (scan->next->start), end+1); + //printf("w=%u start=%04x next=%04x end=%lu\n", w/80, scan->start, (scan->next->start), end+1); //printf("==================\n"); strcat(scratch0, "\n"); - //getch(); }/*else {//if(scan->next->start <= scan->start){ scan->next->start=scan->start+0x1000; - wwww=(dword)(scan->next->start)-(dword)scan->start; strcat(scratch0, AARESET); strcat(scratch0, "\n"); strcat(scratch0,AAGREEN); @@ -1349,23 +1340,12 @@ void MM_ShowMemory(global_game_variables_t *gvar) strcat(scratch0,"0"); } printf("================\n"); - printf("w=%x start=%x next=%x end=%u %lu\n", w, scan->start, (scan->next->start), end+1, wwww); + printf("w=%x start=%x next=%x end=%u\n", w, scan->start, (scan->next->start), end+1); printf("================\n"); getch(); }*/ strcat(scratch0, AARESET); //strcat(scratch0,"\n"); - //for(chx=scan->next->start;chx+4>=(word)end+1;chx+=4) - //{ -// chx+=scan->next->start; -// modexClearRegion(page, chx, chy, 4, 4, 2); - //} - //modexhlin(page, end+1,scan->next->start, chy, 0); -/* y = scan->start/320; - x = scan->start%320; - VW_Hlin(x,x+end,y,color); - VW_Plot(x,y,15);*/ -//++++ VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0); // black = free strcat(scratch,"Seg:"); ultoa (scan->start,str,16); strcat (scratch,str); @@ -1379,76 +1359,19 @@ void MM_ShowMemory(global_game_variables_t *gvar) strcat (scratch,"\n"); write(gvar->handle.debughandle,scratch,strlen(scratch)); write(gvar->handle.debughandle,scratch0,strlen(scratch0)); -//modexprint(page, chx, chy, 1, 0, 24, &scratch); -//++++chy+=4; //fprintf(stdout, "%s", scratch); scan = scan->next; } - /*strcpy(scratch1, AARESET); - strcat(scratch1, "========================================\n"); - strcat(scratch1, "near= "); - ultoa (*(gvar->mm.nearheap),str,10); - strcat (scratch1,str); - strcat(scratch1, " far= "); - ultoa (*(gvar->mm.farheap),str,10); - strcat (scratch1,str); - strcat(scratch1, "\n"); - //strcat(scratch1, "&near= %Fp ", &(gvar->mm.nearheap)); - //strcat(scratch1, "&far= %Fp", &(gvar->mm.farheap)); - //strcat(scratch1, "\n"); - strcat(scratch1, "========================================\n"); - write(gvar->handle.debughandle,scratch1,strlen(scratch1));*/ - CA_CloseDebug (gvar); -//++++mh IN_Ack(); + IN_Ack(gvar); //**** VW_SetLineWidth(64); -//++++mh bufferofs = temp; + gvar->video.ofs.bufferofs = temp; } -void MM_ShowMemoryVidVer(global_game_variables_t *gvar) -{ - mmblocktype far *scan; - unsigned color,temp,x,y; - long end;//,owner; - //char scratch[80],str[10]; - temp = gvar->video.ofs.bufferofs; - gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs; - scan = gvar->mm.mmhead; - - end = -1; - - while (scan) - { - if (scan->attributes & PURGEBITS) - color = 5; // dark purple = purgable - else - color = 9; // medium blue = non purgable - if (scan->attributes & LOCKBIT) - color = 12; // red = locked - if (scan->start<=end) - Quit (gvar, "MM_ShowMemory: Memory block order currupted!"); - //end = scan->length-1; - end = scan->start+(scan->length)-1; - y = scan->start/320; - x = scan->start%320; - VW_Hlin(x,x+end,y,color, &gvar->video.ofs); - VL_Plot(x,y,15, &gvar->video.ofs); - //if (scan->next && scan->next->start > end+1) - if (scan->next && scan->next->start >= end+1) - VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0, &gvar->video.ofs); // black = free - - scan = scan->next; - } - - //----VL_FadeIn(0,255,&gvar->video.palette,10, &gvar->video); - IN_Ack(gvar); - - gvar->video.ofs.bufferofs = temp; -} //========================================================================== @@ -1610,7 +1533,7 @@ void MM_Report_(global_game_variables_t *gvar) printf(" %c%cEMM v%x.%x available\n", 0xC7, 0xC4, gvar->pm.emm.EMSVer>>4,gvar->pm.emm.EMSVer&0x0F); printf(" %c%ctotalEMSpages: %u ", 0xC7, 0xC4, gvar->pm.emm.totalEMSpages); printf("freeEMSpages: %u\n", gvar->pm.emm.freeEMSpages); printf(" %c%cEMSPageFrame: %04x\n", 0xC7, 0xC4, gvar->pm.emm.EMSPageFrame); - printf(" %c%cEMSmem: %lu\n", 0xD3, 0xC4, gvar->mmi.EMSmem); + printf(" %c%cEMSmem: %lu or %luk\n", 0xD3, 0xC4, gvar->mmi.EMSmem, gvar->mmi.EMSmem/1204); } if(MML_CheckForXMS()) { @@ -1618,7 +1541,7 @@ void MM_Report_(global_game_variables_t *gvar) printf(" %c%cXMS v%x.%x available\n", 0xC7, 0xC4, XMSVer>>8,XMSVer&0x0F); printf(" %c%cXMSDriver: %Fp\n", 0xC7, 0xC4, XMSDriver); printf(" %c%cXMSHandle: %04x\n", 0xC7, 0xC4, gvar->pm.xmm.XMSHandle); - printf(" %c%cXMSmem: %lu\n", 0xD3, 0xC4, gvar->mmi.XMSmem); + printf(" %c%cXMSmem: %lu or %lukb\n", 0xD3, 0xC4, gvar->mmi.XMSmem, gvar->mmi.XMSmem/1024); } printf(" %cConv. %u\n", 0xC9, gvar->pm.mm.MainPresent); DebugMemory_(gvar, 0); //printf("mainmem: %lu\n", gvar->mmi.mainmem); @@ -1773,7 +1696,8 @@ void MM_BombOnError(boolean bomb, global_game_variables_t *gvar) gvar->mm.bombonerror = bomb; } -/*void MM_GetNewBlock(global_game_variables_t *gvar) +#if 0 +void MM_GetNewBlock(global_game_variables_t *gvar) { if(!gvar->mm.mmfree) MML_ClearBlock(gvar); @@ -1792,7 +1716,8 @@ void MM_FreeBlock(mmblocktype *x, global_game_variables_t *gvar) x->useptr=NULL; x->next=gvar->mm.mmfree; gvar->mm.mmfree=x; -}*/ +} +#endif void xms_call(byte v, global_game_variables_t *gvar) { diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index bd529c03..f890a3bb 100755 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -42,11 +42,10 @@ #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer -//moved to typdefst +//moved to 16_tdef.h //#define MAXBLOCKS 1024 - //-------- #define EMS_INT 0x67 @@ -196,7 +195,6 @@ void MM_SetPurge(memptr *baseptr, int purge, global_game_variables_t *gvar); void MM_SetLock(memptr *baseptr, boolean locked, global_game_variables_t *gvar); void MM_SortMem(global_game_variables_t *gvar); void MM_ShowMemory(global_game_variables_t *gvar); -void MM_ShowMemoryVidVer(global_game_variables_t *gvar); void MM_DumpData(global_game_variables_t *gvar); dword MM_UnusedMemory(global_game_variables_t *gvar); dword MM_TotalFree(global_game_variables_t *gvar); diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index 9fabd9be..858bd4b9 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -507,7 +507,6 @@ PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length, global_game_v if (!addr) { Quit (gvar, "PML_XMSCopy: zero address\n"); - //return; } xoffset = (dword)xmspage * PMPageSize; @@ -621,8 +620,10 @@ PM_SetMainMemPurge(int level, global_game_variables_t *gvar) for (i = 0;i < PMMaxMainMem;i++) { #ifdef __DEBUG_PM__ +#ifdef __DEBUG_PM_MAIN__ printf("PM_SetMainMemPurge() info of gvar->pm.mm.MainMemPages[i]\n"); printf("& %Fp, %Fp\n", &gvar->pm.mm.MainMemPages[i], &(gvar->pm.mm.MainMemPages[i])); +#endif #endif if (gvar->pm.mm.MainMemPages[i]) MM_SetPurge(&(gvar->pm.mm.MainMemPages[i]),level, gvar); diff --git a/src/lib/16_spri.c b/src/lib/16_spri.c index 251bad5b..5c24d89b 100755 --- a/src/lib/16_spri.c +++ b/src/lib/16_spri.c @@ -22,6 +22,8 @@ #include "src/lib/16_spri.h" +struct glob_game_vars *ggvv; + char* get_curr_anim_name(struct sprite *spri) { // Retrive animation name list @@ -197,7 +199,11 @@ void animate_spri(entity_t *enti, video_t *video) ); #endif #ifdef __DEBUG_SPRI__ - if(dbg_delayanimation) delay(250);//{ while(!IN_KeyDown(sc_Space)/* && !IN_KeyDown(sc_Escape)*/){} delay(250); } +// if(ggvv->player[0].enti.q<5) + if(dbg_delayanimation) + { + IN_Ack(ggvv);// delay(250);//{ while(!IN_KeyDown(sc_Space)/* && !IN_KeyDown(sc_Escape)*/){} delay(250); } + } #endif if(!video->vga_state.rss) { diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index daa9fadc..c0d6d89f 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -20,11 +20,14 @@ * */ /* - * 16 library + * 16 tail library */ #include "src/lib/16_tail.h" #include "src/lib/16text.h" + +static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ + /* ========================== = @@ -127,7 +130,7 @@ void TL_VidInit(global_game_variables_t *gvar) // get old video mode //in.h.ah = 0xf; //int86(0x10, &in, &out); - gvar->video.old_mode = vgaGetMode();//out.h.al; + if(!gvar->video.old_mode) gvar->video.old_mode = vgaGetMode();//out.h.al; #else gvar->video.old_mode = 3; #endif @@ -281,6 +284,176 @@ void TL_VidInit(global_game_variables_t *gvar) //=========================================================================== +/* +=================== += += FizzleFade += +=================== +*/ + +#define PIXPERFRAME 1600 + +void FizzleFade (unsigned source, unsigned dest, + unsigned width,unsigned height, boolean abortable, global_game_variables_t *gv) +{ + unsigned drawofs,pagedelta; + unsigned char maskb[8] = {1,2,4,8,16,32,64,128}; + unsigned x,y,p,frame; + long rndval; + word TimeCount = *clockw; + word screenseg = SCREENSEG; + + pagedelta = dest-source; +//++++ VL_SetScreen (dest,0); + rndval = 1; + x = y = 0; + + __asm { + mov es,[screenseg] + mov dx,SC_INDEX + mov al,SC_MAPMASK + out dx,al + } + + TimeCount=frame=0; + do // while (1) + { + if (abortable) + { + IN_ReadControl(0,gv); + if (gv->player[0].info.button0 || gv->player[0].info.button1 || gv->in.inst->Keyboard[sc_Space] + || gv->in.inst->Keyboard[sc_Enter]) + { +//++++ VW_ScreenToScreen (source,dest,width/8,height); + return; + } + } + + for (p=0;pwidth || y>height) + continue; + drawofs = source+gv->video.ofs.ylookup[y]; + + __asm { + mov cx,[x] + mov si,cx + and si,7 + mov dx,GC_INDEX + mov al,GC_BITMASK + mov ah,BYTE PTR [maskb+si] + out dx,ax + + mov si,[drawofs] + shr cx,1 + shr cx,1 + shr cx,1 + add si,cx + mov di,si + add di,[pagedelta] + + mov dx,GC_INDEX + mov al,GC_READMAP // leave GC_INDEX set to READMAP + out dx,al + + mov dx,SC_INDEX+1 + mov al,1 + out dx,al + mov dx,GC_INDEX+1 + mov al,0 + out dx,al + + mov bl,[es:si] + xchg [es:di],bl + + mov dx,SC_INDEX+1 + mov al,2 + out dx,al + mov dx,GC_INDEX+1 + mov al,1 + out dx,al + + mov bl,[es:si] + xchg [es:di],bl + + mov dx,SC_INDEX+1 + mov al,4 + out dx,al + mov dx,GC_INDEX+1 + mov al,2 + out dx,al + + mov bl,[es:si] + xchg [es:di],bl + + mov dx,SC_INDEX+1 + mov al,8 + out dx,al + mov dx,GC_INDEX+1 + mov al,3 + out dx,al + + mov bl,[es:si] + xchg [es:di],bl + } + + if (rndval == 1) // entire sequence has been completed + { +//++++ VGABITMASK(255); +//++++ VGAMAPMASK(15); + return; + } + } + frame++; +//++++ while (TimeCount +#include +#include +#include +#include +#endif + +//gvar.video.ofs.bufferofs,gvar.video.ofs.displayofs, +#define FIZZLEFADEFUNCTION \ + if(gvar.in.inst->Keyboard[sc_F]){ FizzleFade(\ + atoi(gvar.video.page[0].data),atoi(gvar.video.page[1].data),\ +320,240,true, &gvar); IN_UserInput(1, &gvar); } \ + #define TAIL_FUNCTIONKEYFUNCTIONS \ if(gvar.in.inst->Keyboard[88]){ panswitch=!panswitch; IN_UserInput(1, &gvar); } \ TAIL_FUNCTIONKEYFUNCTIONS0EXE @@ -55,14 +69,15 @@ #define TAIL_FUNCTIONKEYFUNCTIONS0EXE \ if(gvar.in.inst->Keyboard[sc_F4]){ turboXT(12); IN_UserInput(1, &gvar); } \ - if(gvar.in.inst->Keyboard[68/*sc_F10*/]){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } \ - if(gvar.in.inst->Keyboard[sc_F8]){ gvar.video.vga_state.bgps=!gvar.video.vga_state.bgps; IN_UserInput(1, &gvar); } \ + if(gvar.in.inst->Keyboard[68/*sc_F10*/]){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } \ + if(gvar.in.inst->Keyboard[sc_F8]){ gvar.video.vga_state.bgps=!gvar.video.vga_state.bgps; IN_UserInput(1, &gvar); } \ if(gvar.in.inst->Keyboard[sc_F7]){ ZC_ShowMV(&gvar.mv, 0, 1); IN_UserInput(1, &gvar); } \ if(gvar.in.inst->Keyboard[sc_F6]){ ZC_ShowMV(&gvar.mv, 0, 0); IN_UserInput(1, &gvar); } \ - if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss; IN_UserInput(1, &gvar); } \ + if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss; IN_UserInput(1, &gvar); } \ if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(&gvar.video.page[0]); IN_UserInput(1, &gvar); } \ if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation; IN_UserInput(1, &gvar); } \ RFDEBUGFUNCTIONS +//FIZZLEFADEFUNCTION #define TAIL_PANKEYFUN \ TAIL_PANKEYFUNZC \ @@ -105,6 +120,7 @@ word modexPalOverscan(word col); void Shutdown16(global_game_variables_t *gvar); void Startup16(global_game_variables_t *gvar); void TL_VidInit(global_game_variables_t *gvar); +void FizzleFade (unsigned source, unsigned dest,unsigned width,unsigned height, boolean abortable, global_game_variables_t *gv); void DebugMemory_(global_game_variables_t *gvar, boolean q); void ClearMemory (global_game_variables_t *gvar); void Quit (global_game_variables_t *gvar, char *error); diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index a3ac0ae4..93a0d3e0 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -359,6 +359,12 @@ typedef struct #define MAXSCANLINES 240 // size of ylookup table //video +typedef struct +{ + word tileHeight, tileWidth; //defined by mapfile + word quadwh; //preproccessed quad size of tilewidth and tileheight +} tile_dimention_t; + typedef struct { unsigned int offscreen_ofs; @@ -396,6 +402,7 @@ typedef struct nibble sfip; //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible. ofs_t ofs; //offset vars used for doslib word vh; //video combined height + tile_dimention_t td; //0000word startclk; float clk, tickclk; //timer //wolf3d vars boolean screenfaded; @@ -659,7 +666,9 @@ typedef struct { vidsw_t vsw; } sw_t;*/ -typedef struct + + +typedef struct glob_game_vars { video_t video; // video settings variable ca_t ca; // ca stuff diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 833a75a6..514e7d4d 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -55,6 +55,10 @@ void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv) default: // init the video if(gv->video.VL_Started) return; + // get old video mode + //in.h.ah = 0xf; + //int86(0x10, &in, &out); + gv->video.old_mode = vgaGetMode();//out.h.al; // enter mode modexEnter(vq, cmem, gv); break; @@ -175,39 +179,6 @@ modexLeave() { vgaSetMode(TEXT_MODE); } -/* -==================== -= -= VL_SetLineWidth -= -= Line witdh is in WORDS, 40 words is normal width for vgaplanegr -= -==================== -*/ - -void VL_SetLineWidth (unsigned width, ofs_t *ofs) -{ - int i,offset; - -// -// set wide virtual screen -// - outport (CRTC_INDEX,CRTC_OFFSET+width*256); - -// -// set up lookup tables -// - ofs->linewidth = width*2; - - offset = 0; - - for (i=0;iylookup[i]=offset; - offset += ofs->linewidth; - } -} - page_t modexDefaultPage(page_t *p) { diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index 00cd2238..af357b08 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -35,14 +35,6 @@ // #include "src/lib/modex16/192x144_.h" // #include "src/lib/modex16/160x120.h" -#ifdef __WATCOMC__ -#include -#include -#include -#include -#include -#endif - //320x240 = 20x15 //192x144 = 12x9 diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index a6928b27..31c9f38e 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -25,6 +25,173 @@ #include #include "src/lib/16_vl.h" +static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ + +//=========================================================================== + +//============== +// +// VL_SetScreen +// +//============== + +void VL_SetScreen (unsigned int crtc, int pelpan) +{ +// PROC VL_SetScreen crtc:WORD, pel:WORD +// PUBLIC VL_SetScreen + word TimeCount = *clockw; + __asm { + mov cx,[TimeCount] // if TimeCount goes up by two, the retrace + add cx,2 // period was missed (an interrupt covered it) + + mov dx,STATUS_REGISTER_1 + + // wait for a display signal to make sure the raster isn't in the middle + // of a sync + +#ifdef __BORLANDC__ + } +#endif +SetScreen_waitdisplay: +#ifdef __BORLANDC__ + __asm { +#endif + in al,dx + test al,1 //1 = display is disabled (HBL / VBL) + jnz SetScreen_waitdisplay + +#ifdef __BORLANDC__ + } +#endif +SetScreen_loop: +#ifdef __BORLANDC__ + __asm { +#endif + sti + jmp SetScreen_skip1 + cli +#ifdef __BORLANDC__ + } +#endif +SetScreen_skip1: +#ifdef __BORLANDC__ + __asm { +#endif + cmp [TimeCount],cx // will only happen if an interrupt is + jae SetScreen_setcrtc // straddling the entire retrace period + + // when several succesive display not enableds occur, + // the bottom of the screen has been hit + + in al,dx + test al,8 + jnz SetScreen_waitdisplay + test al,1 + jz SetScreen_loop + + in al,dx + test al,8 + jnz SetScreen_waitdisplay + test al,1 + jz SetScreen_loop + + in al,dx + test al,8 + jnz SetScreen_waitdisplay + test al,1 + jz SetScreen_loop + + in al,dx + test al,8 + jnz SetScreen_waitdisplay + test al,1 + jz SetScreen_loop + + in al,dx + test al,8 + jnz SetScreen_waitdisplay + test al,1 + jz SetScreen_loop + +#ifdef __BORLANDC__ + } +#endif +SetScreen_setcrtc: +#ifdef __BORLANDC__ + __asm { +#endif + // set CRTC start + // for some reason, my XT's EGA card doesn't like word outs to the CRTC index... + + mov cx,[crtc] + mov dx,CRTC_INDEX + mov al,0ch //start address high register + out dx,al + inc dx + mov al,ch + out dx,al + dec dx + mov al,0dh //start address low register + out dx,al + mov al,cl + inc dx + out dx,al + + + // set horizontal panning + + mov dx,ATR_INDEX +// mov al,ATR_PELPAN or 20h + out dx,al + jmp SetScreen_done + mov al,[BYTE PTR pelpan] //pel pan value + out dx,al +#ifdef __BORLANDC__ + } +#endif +SetScreen_done: +#ifdef __BORLANDC__ + __asm { +#endif +// sti + +// ret + } +} + +/* +==================== += += VL_SetLineWidth += += Line witdh is in WORDS, 40 words is normal width for vgaplanegr += +==================== +*/ + +void VL_SetLineWidth (unsigned width, ofs_t *ofs) +{ + int i,offset; + +// +// set wide virtual screen +// + outport (CRTC_INDEX,CRTC_OFFSET+width*256); + +// +// set up lookup tables +// + ofs->linewidth = width*2; + + offset = 0; + + for (i=0;iylookup[i]=offset; + offset += ofs->linewidth; + } +} + /* ============================================================================= diff --git a/src/lib/bakapee.c b/src/lib/bakapee.c index bab3eba7..389a8159 100755 --- a/src/lib/bakapee.c +++ b/src/lib/bakapee.c @@ -329,5 +329,6 @@ void ding(page_t *page, bakapee_t *pee, word q) default: break; } + //printf(" %dx%d %dx%d\n", pee->xx, pee->yy, tx, ty); //pee->coor++; } diff --git a/src/lib/hb/demo16.c b/src/lib/hb/demo16.c new file mode 100755 index 00000000..e69de29b diff --git a/src/lib/hb/demokd.c b/src/lib/hb/demokd.c index 1b19e369..1059af5b 100755 --- a/src/lib/hb/demokd.c +++ b/src/lib/hb/demokd.c @@ -6,8 +6,7 @@ ===================== */ -void -DemoLoop (void) +void DemoLoop (void) { char *s; word move; diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 6f90915b..d6c33f34 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -753,7 +753,7 @@ void shinku(global_game_variables_t *gv) //modexCopyPageRegion(&video->page[0], &video->page[1], enti->x, enti->y, 0, 0, 24, 32); }*/ VL_ShowPage(&(gv->video.page[gv->video.sp]), gv->kurokku.fpscap, 0); - gv->video.dorender =!gv->video.dorender ; + gv->video.dorender =!gv->video.dorender; //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2; } PM_NextFrame(gv); diff --git a/src/xcroll.c b/src/xcroll.c index 38516c99..fcc7778d 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -52,6 +52,7 @@ void main(int argc, char *argv[]) { static global_game_variables_t gvar; char *bakapee1,*bakapee1p; + struct glob_game_vars *ggvv; // sword bakapee; // if(argv[1]) bakapee = atoi(argv[1]); // else bakapee = 1; @@ -60,6 +61,7 @@ void main(int argc, char *argv[]) bakapee1=malloc(64); bakapee1p=malloc(64); + ggvv=&gvar; if (argc < 2) { //fprintf(stderr,"drawvrl \n palette file optional\n"); diff --git a/video.ofs.bufferofs b/video.ofs.bufferofs new file mode 100755 index 00000000..e69de29b diff --git a/video.ofs.displayofs b/video.ofs.displayofs new file mode 100755 index 00000000..e69de29b