X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Ftest.c;h=acd6886a6598d5e0ff38f251166f58c2426080f2;hb=44422cc93d788d1e5c51cbfb3e9ac2a218cb1cb5;hp=cb75a0fa248ae81e17025f162fe09489428c057d;hpb=2accbf2668001e82a8fec1e75f37c195996186b0;p=16.git diff --git a/src/test.c b/src/test.c index cb75a0fa..acd6886a 100755 --- a/src/test.c +++ b/src/test.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -21,32 +21,38 @@ */ #include -#include "src/lib/modex16.h" +#include "src/lib/16_vl.h" +#include "src/lib/16_vlpal.h" #include "src/lib/16_in.h" #include "src/lib/scroll16.h" -#include "src/lib/bakapee.h" -global_game_variables_t gvar; -player_t player[MaxPlayers]; -map_view_t mv[4]; -pan_t pan; +#define LGQ 32 +#define HGQ 55 + +static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ void main(int argc, char *argv[]) { + static word paloffset=0; + static global_game_variables_t gvar; + + map_t map; + map_view_t mv[4]; + int i, j; word startclk, endclk; word k; - byte *pal, *pal2; - sword bakapee; - word colo=LGQ; + imgtestpal_t bmp1, bmp2; + + + bmp1.width=bmp2.width= 40; + bmp1.width=bmp2.height= 30; - //argument - if(argv[1]) bakapee = atoi(argv[1]); - else bakapee = 1; + //====word colo=LGQ; // DOSLIB: check our environment - probe_dos(); + /*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. @@ -72,41 +78,38 @@ void main(int argc, char *argv[]) #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); + _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);*/ + Startup16(&gvar); /* save the palette */ - pal = modexNewPal(); - modexPalSave(pal); - modexFadeOff(1, pal); - modexPalBlack(); + //====modexPalSave(pal); + //====modexFadeOff(1, pal); + //====modexPalBlack(); - IN_Startup(); - IN_Default(0,&player,ctrl_Keyboard1); - IN_initplayer(&player, 0); + //IN_Startup(); + IN_Default(0,&gvar.player,ctrl_Keyboard1); + EN_initPlayer(&gvar.player, 0, &gvar.video); - textInit(); - VGAmodeX(bakapee, 1, &gvar); + VGAmodeX(1, 1, &gvar); modexPalBlack(); /* load our palette */ - modexLoadPalFile("data/default.pal", &pal2); + VL_LoadPalFile("data/16.pal", &gvar.video.palette); + bmp1.offset=(paloffset/3); + VL_palette(&bmp1, &gvar.video.palette, &paloffset, 0, 0, &gvar); + + //VL_LoadPalFilewithoffset("data/default.pal", &palette, paloffset); + modexLoadPalFile("data/16t.pal", &gvar.video.dpal); + bmp2.offset=(paloffset/3); + VL_palette(&bmp2, &gvar.video.dpal, &paloffset, 0, 0, &gvar); + //====modexLoadPalFile("data/default.pal", &pal2); /* overscan show */ //modexPalOverscan(44+1); /* set up the page, but with 16 pixels on all borders in offscreen mem */ modexHiganbanaPageSetup(&gvar.video); - for(i=0;i=31){ i++; j=0; goto baka; }else j++; }else if(j>=32){ k++; j=0; }else j++; break; case 1: // go left - gvar.video.page[pan.pn].dx--; + gvar.video.page[gvar.video.sp].dx--; if(j>=32){ k++; j=0; }else j++; break; case 2: // go up - gvar.video.page[pan.pn].dy++; + gvar.video.page[gvar.video.sp].dy++; if(j>=32){ k++; j=0; }else j++; break; case 3: // go down - gvar.video.page[pan.pn].dy--; + gvar.video.page[gvar.video.sp].dy--; if(j>=32){ k=0; j=0; i++; }else j++; break; default: @@ -180,40 +188,39 @@ void main(int argc, char *argv[]) // modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128); // } //} - if(IN_KeyDown(1+1)){ pan.pn=0; } - if(IN_KeyDown(2+1)){ pan.pn=1; } - if(IN_KeyDown(3+1)){ pan.pn=2; } - if(IN_KeyDown(4+1)){ pan.pn=3; } + TAIL_PANKEYFUN; if(IN_KeyDown(12)) modexClearRegion(&gvar.video.page[0], (gvar.video.page[0].width/2)-4, (gvar.video.page[0].height/2)-16, 24, 32, 15); if(IN_KeyDown(13)) modexClearRegion(&gvar.video.page[1], (gvar.video.page[1].width/2)-4, (gvar.video.page[1].height/2)-16, 24, 32, 15); - if(IN_KeyDown(7)){ +/*==== if(IN_KeyDown(7)){ for(i=0;i<3;i++) { pal2[i] = rand()%64; - modexPalUpdate1(pal2); + modexPalUpdate(pal2); colo++; if(colo>HGQ) colo=LGQ; } // if(i>PAL_SIZE) i=0; - }//9 - if(IN_KeyDown(25)){ - modexpdump(&gvar.video.page[pan.pn]); - IN_UserInput(1,1); - }//p - modexShowPage(&gvar.video.page[pan.pn]); + }//9*/ + if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1,1); }//p + //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0); + ZC_ShowMV(&mv, 0, 0); } endclk = *clockw; /* fade back to text mode */ - modexFadeOff(1, pal2); - modexPalBlack(); + //====modexFadeOff(1, pal2); + //====modexPalBlack(); VGAmodeX(0, 1, &gvar); + Shutdown16(&gvar); printf("Project 16 test.exe. This is just a test file!\n"); printf("version %s\n", VERSION); - modexprintmeminfo(&gvar.video); - printf("tx=%d ", mv[pan.pn].tx); printf("ty=%d ", mv[pan.pn].ty); printf("player.d=%d\n", player[0].d); - IN_Shutdown(); - modexPalBlack(); - modexFadeOn(1, pal); + VL_PrintmodexmemInfo(&gvar.video); + printf("tx=%d ", mv[gvar.video.sp].tx); printf("ty=%d ", mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); + printf("\n====\n"); + printf("0 paloffset= %d\n", paloffset/3); + printf("====\n\n"); + //IN_Shutdown(); + //====modexPalBlack(); + //====modexFadeOn(1, pal); }