From: Jonathan Campbell Date: Tue, 5 Apr 2016 00:00:29 +0000 (-0700) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=be588c0302f1248c7100cd97ad5effe2af3563cf;hp=d71e4ebbd3770b48eee2b2cc18288b97aad4e1e4;p=16.git Merge remote-tracking branch 'upstream/master' --- diff --git a/builq.sh b/builq.sh index f518246b..e60e695a 100755 --- a/builq.sh +++ b/builq.sh @@ -1,4 +1,5 @@ #! /bin/bash -wmake -h clean -wmake -h -wmake -h comq +. ./dld.sh +./cleanup.sh +./buildall.sh +#cd ../../../ diff --git a/data/me.gif b/data/me.gif new file mode 100755 index 00000000..d1ca57c4 Binary files /dev/null and b/data/me.gif differ diff --git a/git_con.fig b/git_con.fig index 927bd4df..9c560e30 100755 --- a/git_con.fig +++ b/git_con.fig @@ -3,13 +3,21 @@ filemode = true bare = false logallrefupdates = true -[remote "origin"] - url = https://github.com/sparky4/16 - fetch = +refs/heads/*:refs/remotes/origin/* +[remote "x4"] + url = ssh://sparky4@4ch.mooo.com:26/var/www/16/16.git + fetch = +refs/heads/*:refs/remotes/x4/* [branch "master"] remote = origin merge = refs/heads/master -[submodule "src/lib/doslib"] - url = https://github.com/joncampbell123/doslib.git -[submodule "src/lib/jsmn"] - url = https://github.com/zserge/jsmn.git +[remote "origin"] + url = git@github.com:sparky4/16.git + fetch = +refs/heads/*:refs/remotes/origin/* +[remote "sf"] + url = ssh://sparky4q@git.code.sf.net/p/project16/code + fetch = +refs/heads/*:refs/remotes/sf/* +[remote "jp"] + url = ssh://sparky4@git.pf.osdn.jp:/gitroot/s/sp/sparky4/project16.git + fetch = +refs/heads/*:refs/remotes/jp/* +[remote "bb"] + url = git@bitbucket.org:sparky4/16.git + fetch = +refs/heads/*:refs/remotes/bb/* diff --git a/makefile b/makefile index af0fa557..e33d63e4 100755 --- a/makefile +++ b/makefile @@ -78,7 +78,7 @@ VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ) -GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) +GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) $(DOSLIBLIBS) DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib @@ -410,6 +410,7 @@ modex.$(OBJ): $(MODEXLIB_)modex.asm # clean: .symbolic @$(REMOVECOMMAND) $(EXEC) + @$(REMOVECOMMAND) /var/www/$(EXEC)* @$(REMOVECOMMAND) *.$(OBJ) @$(REMOVECOMMAND) 16.lib @$(REMOVECOMMAND) gfx.lib diff --git a/src/16.c b/src/16.c index 10aad071..bfe777e2 100755 --- a/src/16.c +++ b/src/16.c @@ -45,7 +45,7 @@ main(int argc, char *argv[]) /*modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal);*/ printf("wwww loop wwww\n"); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); modexPalBlack(); //so player will not see loadings~ IN_Startup(); IN_Default(0,&player,ctrl_Joystick); @@ -62,7 +62,7 @@ main(int argc, char *argv[]) case 2: cpus = "386 or newer"; break; default: cpus = "internal error"; break; } - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); printf("Project 16 16.exe. This is supposed to be the actual finished game executable!\n"); printf("version %s\n", VERSION); printf("detected CPU type: %s\n", cpus); diff --git a/src/bakapi.c b/src/bakapi.c index 1b839a21..c6ae3ce3 100755 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -93,12 +93,10 @@ main(int argc, char *argvar[]) xdir=1; ydir=1; -#ifdef MXLIB - VGAmodeX(vgamodex_mode, &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. -#else -# error REMOVED // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in. + 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. + // 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. -#endif + bakapee.xx = rand()&0%gvar.video.page[0].width; bakapee.yy = rand()&0%gvar.video.page[0].height; bakapee.gq = 0; @@ -138,15 +136,22 @@ main(int argc, char *argvar[]) { int c; -# ifndef MXLIB -# error REMOVED // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in. + // 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. -# else - VGAmodeX(0, &gvar); -# endif + VGAmodeX(0, 0, &gvar); // user imput switch - fprintf(stderr, "xx=%d yy=%d tile=%d\n", bakapee.xx, bakapee.yy, bakapee.tile); - printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n"); + //fprintf(stderr, "xx=%d yy=%d tile=%d\n", bakapee.xx, bakapee.yy, bakapee.tile); + printf("Tiled mode is "); + switch (bakapee.tile) + { + case 0: + printf("off.\n"); + break; + case 1: + printf("on.\n"); + break; + } + printf("Enter 1, 2, 3, 4, 5, 6, 8, or 9 to run a screensaver, or enter 0 to quit.\n"); c = getch(); switch (c) { @@ -166,22 +171,22 @@ main(int argc, char *argvar[]) } key=0; break; + case '8': + c+=8; case '1': case '2': case '3': case '4': case '5': case '6': + case '9': key = c - '0'; -# ifdef MXLIB gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); gvar.video.page[0].width += (TILEWH*2); gvar.video.page[0].height += (TILEWH*2); - VGAmodeX(vgamodex_mode, &gvar); -# else -# error REMOVED // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in. + VGAmodeX(vgamodex_mode, 0, &gvar); + // 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. -# endif modexShowPage(&gvar.video.page[0]); break; default: @@ -192,6 +197,7 @@ main(int argc, char *argvar[]) } #else // !defined(BOINK) // FIXME: Does not compile. Do you want to remove this? +// TODO: This is a testing sextion for textrendering and panning for project 16 --sparky4 while(1) { // conditions of screen saver while(!kbhit()) @@ -266,6 +272,7 @@ main(int argc, char *argvar[]) } // VGAmodeX(0, &gvar); #endif // defined(BOINK) - printf("bakapi ver. 1.04.13.04\nis made by sparky4i†ƒÖ…j feel free to use it ^^\nLicence: GPL v3\n"); + printf("bakapi ver. 1.04.16.04\nis made by sparky4i†ƒÖ…j feel free to use it ^^\nLicence: GPL v3\n"); + printf("compiled on 2016/04/04\n"); } //pee! diff --git a/src/fontgfx.c b/src/fontgfx.c index 3edf22d5..2abb13ff 100755 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -63,7 +63,7 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ // static byte *rosa; static word chx, chy, colpee; textInit(); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); /* setup camera and screen~ */ gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); //gvar.video.page[0].width += (16*2); @@ -96,7 +96,7 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ // modexprintbig(&gvar.video.page[0], 0, 0, 1, colpee, 0, "IBM"); // modexprint(0, 0, 1, 0, colpee, ROSE); getch(); - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); // rosa=malloc(sizeof(ROSE)); // (*rosa)=(byte)ROSE; printf("\n%s\n", rose); diff --git a/src/lib/modex16.c b/src/lib/modex16.c index ee2f1a86..0d106037 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -35,7 +35,7 @@ static byte tmppal[PAL_SIZE]; // setvideo() - This function Manages the video modes // // // ///////////////////////////////////////////////////////////////////////////// -void VGAmodeX(sword vq, global_game_variables_t *gv) +void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv) { union REGS in, out; @@ -54,7 +54,7 @@ void VGAmodeX(sword vq, global_game_variables_t *gv) //int86(0x10, &in, &out); gv->video.old_mode = vgaGetMode();//out.h.al; // enter mode - modexEnter(vq, gv); + modexEnter(vq, cmem, gv); break; } } @@ -86,32 +86,65 @@ vgaGetMode() } /* -========================= Entry Points ==========================- */ -void -modexEnter(sword vq, global_game_variables_t *gv) +void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { word i; dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ int CRTParmCount; /* common mode X initiation stuff~ */ - modexsetBaseXMode(gv->video.page); + modexsetBaseXMode(); switch(vq) { case 1: - CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]); + //CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]); /* width and height */ - gv->video.page[0].sw=320; - gv->video.page[0].sh=240; + gv->video.page[0].sw=vga_state.vga_width = 320; // VGA lib currently does not update this + gv->video.page[0].sh=vga_state.vga_height = 240; // VGA lib currently does not update this /* send the CRTParms */ - for(i=0; ivideo.page[0].tilesw = gv->video.page[0].sw/TILEWH; @@ -193,8 +214,8 @@ modexEnter(sword vq, global_game_variables_t *gv) void modexLeave() { - /* TODO restore original mode and palette */ - vgaSetMode(TEXT_MODE); + /* TODO restore original mode and palette */ + vgaSetMode(TEXT_MODE); } // setBaseXMode() does the initialization to make the VGA ready to @@ -202,23 +223,24 @@ modexLeave() { // involves enabling writes to index 0 to 7 of the CRT controller (port // 0x3D4), by clearing the most significant bit (bit 7) of index 0x11. void -modexsetBaseXMode(page_t *page) +modexsetBaseXMode() { - word temp; /* TODO save current video mode and palette */ vgaSetMode(VGA_256_COLOR_MODE); + vga_enable_256color_modex(); + /* disable chain4 mode */ - outpw(SC_INDEX, 0x0604); + //outpw(SC_INDEX, 0x0604); /* synchronous reset while setting Misc Output */ - outpw(SC_INDEX, 0x0100); + //outpw(SC_INDEX, 0x0100); /* select 25 MHz dot clock & 60 Hz scanning rate */ outp(MISC_OUTPUT, 0xe3); /* undo reset (restart sequencer) */ - outpw(SC_INDEX, 0x0300); + //outpw(SC_INDEX, 0x0300); /* reprogram the CRT controller */ outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */ @@ -226,6 +248,7 @@ modexsetBaseXMode(page_t *page) // outp(CRTC_INDEX, 0x11); outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */ // outp(CRTC_DATA, temp); /* get current write protect on varios regs */ + update_state_from_vga(); } page_t diff --git a/src/lib/modex16.h b/src/lib/modex16.h index eae44931..fff256c3 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -36,7 +36,14 @@ #include "src/lib/modex16/256x192.h" #include "src/lib/modex16/192x144_.h" #include "src/lib/modex16/160x120.h" -extern byte gfxtest; + +#include +#include +#include +#include + +//TODO dos lib vga implementation ^^ +//#define DOSLIBVGA static struct pcxHeader { byte id; @@ -80,11 +87,11 @@ typedef union /* -============================ Functions =============================- */ /* mode switching, page, and plane functions */ -void VGAmodeX(sword vq, global_game_variables_t *gv); -void modexEnter(sword vq, global_game_variables_t *gv); +void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv); +void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv); long vgaGetMode(); void modexLeave(); -void modexsetBaseXMode(page_t *page); +void modexsetBaseXMode(); page_t modexDefaultPage(page_t *p); page_t modexNextPage(page_t *p); page_t modexNextPageFlexibleSize(page_t *p, word x, word y); @@ -128,7 +135,6 @@ void modexWaitBorder(); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ -//extern int old_mode; #define SCREEN_SEG 0xa000 #define VIDEO_INT 0x10 #define SET_MODE 0x00 diff --git a/src/palettec.c b/src/palettec.c index f1057dc0..a1e387dc 100755 --- a/src/palettec.c +++ b/src/palettec.c @@ -34,13 +34,13 @@ main(int argc, char *argv[]) if(argv[1]) bakapee = argv[1]; else bakapee = "data/default.pal"; - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); pal = modexNewPal(); modexPalSave(pal); modexSavePalFile(bakapee, pal); - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); } diff --git a/src/palettel.c b/src/palettel.c index a40bd3fd..d07452b6 100755 --- a/src/palettel.c +++ b/src/palettel.c @@ -38,7 +38,7 @@ main(int argc, char *argv[]) if(argv[1]) bakapee = argv[1]; else bakapee = "data/default.pal"; // modexPalSave(pal); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); modexPalBlack(); @@ -47,7 +47,7 @@ main(int argc, char *argv[]) modexFadeOn(1, pal); pdump(&gvar.video.page[0]); getch(); - modexLeave();//VGAmodeX(0, &gvar); + VGAmodeX(0, 0, &gvar); modexPalUpdate1(pal); /*for(i=0;i<768;i++) { diff --git a/src/pcxtest.c b/src/pcxtest.c index 0392b5cb..c05cff5f 100755 --- a/src/pcxtest.c +++ b/src/pcxtest.c @@ -42,7 +42,7 @@ void main() { bmp = bitmapLoadPcx("data/koishi^^.pcx"); // bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx"); p = planar_buf_from_bitmap(&bmp); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); /* fix up the palette and everything */ @@ -89,7 +89,7 @@ void main() { { //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); } - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); /*printf("\nmain=%Fp\n\n", &i); printf("bmp.data=%Fp\n", bmp.data); printf("*bmp.data=%Fp\n", *(bmp.data)); diff --git a/src/pcxtest2.c b/src/pcxtest2.c index 3b83c53d..059b448a 100755 --- a/src/pcxtest2.c +++ b/src/pcxtest2.c @@ -67,7 +67,7 @@ void main() { bmp = bitmapLoadPcx("data/koishi^^.pcx"); // bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx"); p = planar_buf_from_bitmap(&bmp); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); gvar.video.page[0].sw+=32; gvar.video.page[0].sh+=32; @@ -121,7 +121,7 @@ void main() { { //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); } - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); /*printf("\nmain=%Fp\n\n", &i); printf("bmp.data=%Fp\n", bmp.data); printf("*bmp.data=%Fp\n", *(bmp.data)); diff --git a/src/planrpcx.c b/src/planrpcx.c index 9ed1096d..06b1f29c 100755 --- a/src/planrpcx.c +++ b/src/planrpcx.c @@ -64,7 +64,7 @@ baka = 1; //getch(); textInit(); - VGAmodeX(baka, &gvar); + VGAmodeX(baka, 1, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); //fix up the palette and everything @@ -110,7 +110,7 @@ getch(); while(!kbhit()) { } - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); //print out the contents of each plane for(plane=0; plane < 4; plane++) { diff --git a/src/scroll.c b/src/scroll.c index 7d68b45d..5b480cf8 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -118,7 +118,7 @@ void main(int argc, char *argv[]) #endif textInit(); - VGAmodeX(bakapee, &gvar); + VGAmodeX(bakapee, 1, &gvar); // printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh); #ifdef FADE modexPalBlack(); //reset the palette~ @@ -368,7 +368,7 @@ void main(int argc, char *argv[]) //TSR if(IN_KeyDown(87)) //f11 { - VGAmodeX(0, &gvar); + VGAmodeX(0, 0, &gvar); IN_Shutdown(); __asm { @@ -411,7 +411,7 @@ void main(int argc, char *argv[]) modexSavePalFile("data/g.pal", gpal); modexFadeOff(4, gpal); #endif - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); #endif IN_Shutdown(); printf("Project 16 scroll.exe. This is just a test file!\n"); diff --git a/src/test.c b/src/test.c index df0af615..b80291fc 100755 --- a/src/test.c +++ b/src/test.c @@ -48,7 +48,7 @@ void main(int argc, char *argv[]) modexFadeOff(1, pal); modexPalBlack(); - VGAmodeX(bakapee, &gvar); + VGAmodeX(bakapee, 1, &gvar); modexPalBlack(); IN_Startup(); @@ -112,7 +112,7 @@ void main(int argc, char *argv[]) /* fade back to text mode */ modexFadeOff(1, pal2); modexPalBlack(); - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); IN_Shutdown(); printf("Project 16 test.exe. This is just a test file!\n"); printf("version %s\n", VERSION);