X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fscroll.c;h=5beb4743d33660ce11b0aec8ac039d03ff131010;hb=52711700f92f02fe8976d2e035a04a4501842b9f;hp=dd2db336a03f7457967c519b40f49f179dc0a540;hpb=de41863a916d793f03f7dba0d5a85bb8c325accc;p=16.git diff --git a/src/scroll.c b/src/scroll.c index dd2db336..5beb4743 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -20,10 +20,11 @@ * */ -#include "src/lib/scroll16.h" +#include "src/lib/16_scr.h" #include "src/lib/16_timer.h" #include "src/lib/wcpu/wcpu.h" #include "src/lib/mapread.h" +#include "src/lib/16_dbg.h" //#define FADE #define MODEX //this is for mode x initiating @@ -39,7 +40,7 @@ float t; sword bakapee; pan_t pan; //debugswitches -boolean panswitch=0; +boolean panswitch=0;//1 //extern boolean pageflipflop=1; unsigned int i; const char *cpus; @@ -57,44 +58,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); @@ -119,9 +89,7 @@ void main(int argc, char *argv[]) #endif /* input! */ - IN_Startup(); - IN_Default(0,&player,ctrl_Joystick); - //IN_Default(1,&player,ctrl_Joystick); + IN_Default(0,&player,ctrl_Keyboard1); /* save the palette */ #ifdef MODEX @@ -178,8 +146,7 @@ void main(int argc, char *argv[]) //default player position on the viewable map player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx; player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny; - IN_initplayer(&player);//, 0); - //IN_initplayer(&player, 1); + IN_initplayer(&player, 0); #ifndef SPRITE modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15); @@ -221,11 +188,11 @@ void main(int argc, char *argv[]) //when player[0].tx or player[0].ty == 0 or player[0].tx == 20 or player[0].ty == 15 then stop because that is edge of map and you do not want to walk of the map //player movement - IN_ReadControl(/*0,*/&player); + IN_ReadControl(0, &player); if(!panswitch){ - walk(mv, player, 0); + walk(mv, &player, 0); }else{ - panpagemanual(mv, player, 0); + panpagemanual(mv, &player, 0); //printf(" player[0].q: %d", player[0].q); printf(" player[0].d: %d\n", player[0].d); } @@ -318,41 +285,10 @@ void main(int argc, char *argv[]) #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); - printf("ty: %d\n", mv[0].ty); - printf("\n"); - printf("player vars:\n"); - printf(" x: %d", player[0].x); printf(" y: %d\n", player[0].y); - //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8); - //else printf("\nplayer[0].y: %d\n", player[0].y); - printf(" tx: %d", player[0].tx); printf(" ty: %d\n", player[0].ty); - printf(" triggx: %d", player[0].triggerx); printf(" triggy: %d\n", player[0].triggery); - 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); - printf("tile resolution: %dx", gvar.video.page[0].tw); printf("%d\n", gvar.video.page[0].th); - printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); - modexprintmeminfo(&gvar.video); - //printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty); - printf("gvar.video.p=%u ", gvar.video.p); printf("gvar.video.r=%u ", gvar.video.r); - printf("pageflipflop=%u\n", pageflipflop); - //0000printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk); - //0000printf("gvar.video.clk=%f", gvar.video.clk); - printf("\n"); - //printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]); - - printf("\n"); + SCROLLEXITMESG; switch(detectcpu()) { case 0: cpus = "8086/8088 or 186/88"; break;