]> 4ch.mooo.com Git - 16.git/commitdiff
4 page system needs to be tested ^^
authorsparky4 <sparky4@cock.li>
Mon, 9 May 2016 07:52:54 +0000 (02:52 -0500)
committersparky4 <sparky4@cock.li>
Mon, 9 May 2016 07:52:54 +0000 (02:52 -0500)
SCROLL.16L
src/lib/modex16.c
src/lib/modex16.h
src/lib/typdefst.h
src/scroll.c
src/test.c

index 15a839fb44ddfa2dcedff93960cab2750130476e..c1cf1cc5e73cca32fae75286fab3d31d567c9e67 100755 (executable)
@@ -1,36 +1,24 @@
 starting timer ok\r
 index=4096\r
-chkmap ok      \r
-\r
-       1st vmem_remain=262144\r
-               [0], video->page[i].pagesize=95744\r
-               [0], vmem_remain=166400\r
-               [1], video->page[i].pagesize=95744\r
-               [1], vmem_remain=70656\r
-               [2], video->page[i].pagesize=70400\r
-               [2], vmem_remain=256\r
-               [3], video->page[i].pagesize=256\r
-               [3], vmem_remain=0\r
-Project 16 scroll.exe. This is just a test file!\r
-version May  4 2016 10:25:12\r
-tx: 15\r
-ty: 4\r
+chkmap ok      Project 16 scroll.exe. This is just a test file!\r
+version May  9 2016 02:45:56\r
+tx: 0\r
+ty: 0\r
 player.x: 160          player.y: 128\r
-player.tx: 25          player.ty: 12\r
-player.triggx: 24      player.triggy: 12\r
-player.hp: 4   player.q: 1     player.info.dir: 2      player.d: 2 pdir=1\r
-tile data value at player trigger position: 3\r
+player.tx: 10          player.ty: 8\r
+player.triggx: 10      player.triggy: 9\r
+player.hp: 4   player.q: 1     player.info.dir: 2      player.d: 2 pdir=0\r
+tile data value at player trigger position: 0\r
 Virtual Screen: 352x272\r
 Screen: 320x240\r
 virtual tile resolution: 22x17\r
 tile resolution: 20x15 \r
 middle tile position: 10x8\r
-video memory remaining: 0\r
-page   [0]=(a000:163c)\r
-       [1]=(a000:73bc)\r
-       [2]=(a000:bd14)\r
-       [3]=(a000:010c)\r
-mv[1].tx: 15   mv[1].ty: 4     panswitch=0\r
+video memory remaining: 40447\r
+page   [0]=(a000:0000) size=30208 sw=320  sh=240  width=352  height=272\r
+       [1]=(a000:7600) size=30208 sw=320  sh=240  width=352  height=272\r
+       [2]=(a000:ec00) size=30208 sw=320  sh=240  width=352  height=272\r
+mv[1].tx: 0    mv[1].ty: 0     panswitch=0\r
 \r
 \r
 detected CPU type: 386 or newer\r
index 9b61ed8ba4bb1f8d0bd0707cf5f0077d6a930eab..a4f1a16ca97e1a5a4e8b57f867cda2429cc1c8b3 100755 (executable)
@@ -188,7 +188,7 @@ modexDefaultPage(page_t *p)
        page.tilemidposscreenx = page.tw/2;\r
        page.tilemidposscreeny = (page.th/2)+1;\r
        page.stridew=page.width/4;\r
-       page.pagesize = (sdiword)(page.width/4)*page.height;\r
+       page.pagesize = (word)(page.width/4)*page.height;\r
        page.id = 0;\r
 \r
     return page;\r
@@ -238,7 +238,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.tilesh=result.height/TILEWH;\r
        result.id = p->id+1;\r
        result.stridew=result.width/4;\r
-       result.pagesize = (sdiword)(result.width/4)*result.height;\r
+       result.pagesize = (word)(result.width/4)*result.height;\r
 \r
        return result;\r
 }\r
@@ -246,23 +246,24 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
 void modexCalcVmemRemain(video_t *video)\r
 {\r
        byte i;\r
-       //printf("\n\n  1st vmem_remain=%ld\n", video->vmem_remain);\r
-       for(i=0; i<=video->num_of_pages-1; i++)\r
+       //printf("\n\n  1st vmem_remain=%u\n", video->vmem_remain);\r
+       for(i=0; i<video->num_of_pages; i++)\r
        {\r
                video->vmem_remain-=video->page[i].pagesize;\r
-               //printf("              [%u], video->page[i].pagesize=%ld\n", i, video->page[i].pagesize);\r
-               //printf("              [%u], vmem_remain=%ld\n", i, video->vmem_remain);\r
+               //printf("              [%u], video->page[%u].pagesize=%u\n", i, i, video->page[i].pagesize);\r
+               //printf("              [%u], vmem_remain=%u\n", i, video->vmem_remain);\r
        }\r
 }\r
 \r
 void modexHiganbanaPageSetup(video_t *video)\r
 {\r
-       video->vmem_remain=262144L;\r
+       video->vmem_remain=65535U;\r
        video->num_of_pages=0;\r
        (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++;  //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD);\r
        (video->page[1]) = modexNextPage(&(video->page[0]));    video->num_of_pages++;\r
        (video->page[2]) = modexNextPage(&(video->page[1]));    video->num_of_pages++;\r
-       //(video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40);  video->num_of_pages++;\r
+       (video->page[3]) = modexNextPage(&(video->page[2]));    video->num_of_pages++;\r
+//     (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].width/8, video->page[0].height/8);       video->num_of_pages++;\r
        //(video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH);      video->num_of_pages++;\r
        modexCalcVmemRemain(video);\r
        video->p=0;\r
@@ -1150,3 +1151,19 @@ void bios_cls() {
                printf("WARNING: bios cls no ptr\n");\r
        }\r
 }\r
+\r
+void modexprintmeminfo(video_t *v)\r
+{\r
+       byte i;\r
+       printf("video memory remaining: %u\n", v->vmem_remain);\r
+       printf("page ");\r
+       for(i=0; i<v->num_of_pages;i++)\r
+       {\r
+               printf("        [%u]=", i);\r
+               printf("(%Fp)", (v->page[i].data));\r
+               printf(" size=%u", v->page[i].pagesize);\r
+               printf(" sw=%lu  sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh);\r
+               printf(" width=%lu  height=%lu", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height);\r
+               printf("\n");\r
+       }\r
+}\r
index 45c8b137f2558582e1d003f7f8f2cce96b4fc7a9..3ba8753cc1f610978bac97e4ef8d07cdf2de3d8f 100755 (executable)
@@ -185,5 +185,6 @@ void modexpdump(page_t *pee);
 void modexcls(page_t *page, byte color, byte *Where);
 void modexWaitBorder();
 void bios_cls();
+void modexprintmeminfo(video_t *v);
 
 #endif
index dff4e2cc95002f81c6dcc10249a928e3520a2833..a82a8bd077b854bf22fdd319a137bae6ea1d00c1 100755 (executable)
@@ -83,7 +83,7 @@ typedef struct {
        sword tileplayerposscreenx;     /* player position on screen */\r
        sword tileplayerposscreeny;     /* player position on screen */\r
        word stridew;                   /*width/4*/\r
-       sdiword pagesize;                       /* page size */\r
+       word pagesize;                  /* page size */\r
 } page_t;\r
 \r
 typedef struct\r
@@ -112,7 +112,7 @@ typedef struct
 {\r
        char old_mode;          //old video mode before game!\r
        page_t page[MAXPAGE];           //pointer to root page[0]\r
-       sdiword vmem_remain;    //remaining video memory\r
+       word vmem_remain;       //remaining video memory\r
        byte num_of_pages;      //number of actual pages\r
        boolean __near p;                       //render page number\r
        word pr[MAXPAGE][4];    //render sections of pages\r
index 66a163d67ba2ddcc0e2391169fd442359c8071eb..7fd790a65de362b36585bc98fea063c0c93ac12a 100755 (executable)
@@ -33,7 +33,7 @@ global_game_variables_t gvar;
 static map_t map;
 player_t player[MaxPlayers];
 //page_t screen, gvar.video.page[1], gvar.video.page[2];
-map_view_t mv[3];
+map_view_t mv[4];
 bitmap_t p;
 //word pn=0; //i forgot ww
 static planar_buf_t huge *pp;
@@ -313,17 +313,7 @@ void main(int argc, char *argv[])
        printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw);      printf("%d\n", 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);
-       printf("video memory remaining: %ld\n", gvar.video.vmem_remain);
-       printf("page ");
-       for(i=0; i<gvar.video.num_of_pages;i++)
-       {
-               printf("        [%u]=", i);
-               printf("(%Fp)", (gvar.video.page[i].data));
-               printf(" size=%ld", gvar.video.page[i].pagesize);
-               printf(" sw=%lu  sh=%lu ", (unsigned long)gvar.video.page[i].sw, (unsigned long)gvar.video.page[i].sh);
-               printf(" width=%lu  height=%lu", (unsigned long)gvar.video.page[i].width, (unsigned long)gvar.video.page[i].height);
-               printf("\n");
-       }
+       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("panswitch=%u\n", panswitch);
        //printf("player[1].q: %d", player[1].q);       printf("        player[1].d: %d\n", player[1].d);
        printf("\n");
index a57eb37cf9748facf15f9f9e588ae173c332971f..515c5f63a39400b59bbbfa05629131cbe28123f1 100755 (executable)
@@ -173,17 +173,7 @@ void main(int argc, char *argv[])
        VGAmodeX(0, 1, &gvar);\r
        printf("Project 16 test.exe. This is just a test file!\n");\r
        printf("version %s\n", VERSION);\r
-       printf("video memory remaining: %ld\n", gvar.video.vmem_remain);\r
-       printf("page ");\r
-       for(i=0; i<gvar.video.num_of_pages;i++)\r
-       {\r
-               printf("        [%u]=", i);\r
-               printf("(%Fp)", (gvar.video.page[i].data));\r
-               printf(" size=%ld", gvar.video.page[i].pagesize);\r
-               printf(" sw=%lu  sh=%lu ", (unsigned long)gvar.video.page[i].sw, (unsigned long)gvar.video.page[i].sh);\r
-               printf(" width=%lu  height=%lu", (unsigned long)gvar.video.page[i].width, (unsigned long)gvar.video.page[i].height);\r
-               printf("\n");\r
-       }\r
+       modexprintmeminfo(&gvar.video);\r
        printf("tx=%d   ", mv[pan.pn].tx); printf("ty=%d        ", mv[pan.pn].ty); printf("player.d=%d\n", player[0].d);\r
        IN_Shutdown();\r
        modexPalBlack();\r