X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fzcroll.c;h=d2786c16357f4f0a1efce6b4889d1ec0c17cdde8;hb=704ec571885c6255ead65280428ad72510cfe218;hp=d3912145c3d5a81096f2fb2fa91adeaadbfee136;hpb=cabce5636cbc1c69426cc29dc4a3d4ea9bcbde73;p=16.git diff --git a/src/zcroll.c b/src/zcroll.c index d3912145..d2786c16 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -20,13 +20,10 @@ * */ -#include "src/lib/16_tail.h" #include "src/lib/scroll16.h" #include "src/lib/16_timer.h" #include "src/lib/wcpu/wcpu.h" - -//#define FADE -#define MODEX //this is for mode x initiating +#include "src/lib/16render.h" //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ //bitmap_t *p; @@ -39,7 +36,7 @@ float t; sword bakapee; pan_t pan; //debugswitches -boolean panswitch=0; +boolean panswitch=0,baka=0; //extern boolean pageflipflop=1; unsigned int i; const char *cpus; @@ -57,44 +54,13 @@ boolean panswitch=0; void main(int argc, char *argv[]) { - byte *mesg=malloc(sizeof(dword)); - if(argv[1]) bakapee = atoi(argv[1]); else bakapee = 1; - // DOSLIB: check our environment - probe_dos(); - - // DOSLIB: what CPU are we using? - // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. - // So this code by itself shouldn't care too much what CPU it's running on. Except that other - // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for - // the CPU to carry out tasks. --J.C. - cpu_probe(); - - // DOSLIB: check for VGA - if (!probe_vga()) { - printf("VGA probe failed\n"); - return; - } - // hardware must be VGA or higher! - if (!(vga_state.vga_flags & VGA_IS_VGA)) { - printf("This program requires VGA or higher graphics hardware\n"); - return; - } - - if (_DEBUG_INIT() == 0) { -#ifdef DEBUGSERIAL - printf("WARNING: Failed to initialize DEBUG output\n"); -#endif - } - _DEBUG("Serial debug output started\n"); // NTS: All serial output must end messages with newline, or DOSBox-X will not emit text to log - _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); + Startup16(&gvar); pan.pn=1; - start_timer(&gvar); - /* create the map */ fprintf(stderr, "testing map load~ "); loadmap("data/test.map", &map); @@ -103,13 +69,11 @@ void main(int argc, char *argv[]) fprintf(stderr, "yay map loaded~~\n"); /* draw the tiles */ -#ifdef MODEX ptr = map.data; //mappalptr = map.tiles->btdata->palette; /* data */ - player[0].data = malloc(48*128); //TODO use exmm - *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite + if(CA_LoadFile("data/spri/chikyuu.vrs", &(player[0].gr), &gvar)) baka=1; else baka=0; /* create the planar buffer */ ////++++ (player[0].data) = *planar_buf_from_bitmap(&p); @@ -117,27 +81,20 @@ void main(int argc, char *argv[]) pp = planar_buf_from_bitmap(&p); printf("done!\n");*/ -#endif /* input! */ - IN_Startup(); IN_Default(0,&player,ctrl_Joystick); //IN_Default(1,&player,ctrl_Joystick); /* save the palette */ -#ifdef MODEX -#ifdef FADE dpal = modexNewPal(); modexPalSave(dpal); modexFadeOff(4, dpal); -#endif textInit(); VGAmodeX(bakapee, 1, &gvar); // printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh); -#ifdef FADE modexPalBlack(); //reset the palette~ -#endif -#endif + // printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize()); //++++ player[0].data.offset=(paloffset/3); //++++ modexPalUpdate1(&player[0].data, &paloffset, 0, 0); @@ -150,14 +107,11 @@ void main(int argc, char *argv[]) // printf("\n====\n"); // printf("0 paloffset= %d\n", paloffset/3); // printf("====\n\n"); -#ifdef MODEX -#ifdef FADE + gpal = modexNewPal(); modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal); modexPalBlack(); //so player will not see loadings~ -#endif -#endif /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); @@ -208,11 +162,7 @@ void main(int argc, char *argv[]) // } modexClearRegion(mv[3].page, 0, 128, 24, 36, 15); -#ifdef MODEX -#ifdef FADE modexFadeOn(4, gpal); -#endif -#endif while(!IN_KeyDown(sc_Escape) && player[0].hp>0) { shinku(&gvar); @@ -249,19 +199,14 @@ void main(int argc, char *argv[]) if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } //p -#ifdef MODEX -#ifdef FADE if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } if(IN_KeyDown(22)){ paloffset=0; modexPalBlack(); modexPalUpdate(player[0].data, &paloffset, 0, 0); - printf("1paloffset = %d\n", paloffset/3); - modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("2paloffset = %d\n", paloffset/3); modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } -#endif -#endif + //pan switch if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12 if(IN_KeyDown(87)) //f11 @@ -310,15 +255,11 @@ void main(int argc, char *argv[]) /* fade back to text mode */ /* but 1st lets save the game palette~ */ -#ifdef MODEX -#ifdef FADE modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal); modexFadeOff(4, gpal); -#endif VGAmodeX(0, 1, &gvar); -#endif - IN_Shutdown(); + Shutdown16(&gvar); printf("\nProject 16 scroll.exe. This is just a test file!\n"); printf("version %s\n", VERSION); printf("tx: %d ", mv[0].tx); @@ -333,11 +274,6 @@ void main(int argc, char *argv[]) printf(" hp: %d", (player[0].hp)); printf(" q: %d", player[0].q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].d); printf(" pdir=%d\n", player[0].pdir); printf(" tile data value at player trigger position: %d\n\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]); -// printf("palette offset: %d\n", paloffset/3); -//++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize()); -//++++ printf("Total free: %zu\n", GetFreeSize()); -//not used now printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); -//not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d ", gvar.video.page[0].height); printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh); printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d ", gvar.video.page[0].tilesh); @@ -361,9 +297,5 @@ void main(int argc, char *argv[]) default: cpus = "internal error"; break; } printf("detected CPU type: %s\n", cpus); -#ifdef MODEX -#ifdef FADE modexFadeOn(4, dpal); -#endif -#endif }