From b40411c754cec4dc88f6a4183f475584b9205a2b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 9 May 2016 02:52:54 -0500 Subject: [PATCH] 4 page system needs to be tested ^^ --- SCROLL.16L | 38 +++++++++++++------------------------- src/lib/modex16.c | 33 +++++++++++++++++++++++++-------- src/lib/modex16.h | 1 + src/lib/typdefst.h | 4 ++-- src/scroll.c | 14 ++------------ src/test.c | 12 +----------- 6 files changed, 44 insertions(+), 58 deletions(-) diff --git a/SCROLL.16L b/SCROLL.16L index 15a839fb..c1cf1cc5 100755 --- a/SCROLL.16L +++ b/SCROLL.16L @@ -1,36 +1,24 @@ starting timer ok index=4096 -chkmap ok - - 1st vmem_remain=262144 - [0], video->page[i].pagesize=95744 - [0], vmem_remain=166400 - [1], video->page[i].pagesize=95744 - [1], vmem_remain=70656 - [2], video->page[i].pagesize=70400 - [2], vmem_remain=256 - [3], video->page[i].pagesize=256 - [3], vmem_remain=0 -Project 16 scroll.exe. This is just a test file! -version May 4 2016 10:25:12 -tx: 15 -ty: 4 +chkmap ok Project 16 scroll.exe. This is just a test file! +version May 9 2016 02:45:56 +tx: 0 +ty: 0 player.x: 160 player.y: 128 -player.tx: 25 player.ty: 12 -player.triggx: 24 player.triggy: 12 -player.hp: 4 player.q: 1 player.info.dir: 2 player.d: 2 pdir=1 -tile data value at player trigger position: 3 +player.tx: 10 player.ty: 8 +player.triggx: 10 player.triggy: 9 +player.hp: 4 player.q: 1 player.info.dir: 2 player.d: 2 pdir=0 +tile data value at player trigger position: 0 Virtual Screen: 352x272 Screen: 320x240 virtual tile resolution: 22x17 tile resolution: 20x15 middle tile position: 10x8 -video memory remaining: 0 -page [0]=(a000:163c) - [1]=(a000:73bc) - [2]=(a000:bd14) - [3]=(a000:010c) -mv[1].tx: 15 mv[1].ty: 4 panswitch=0 +video memory remaining: 40447 +page [0]=(a000:0000) size=30208 sw=320 sh=240 width=352 height=272 + [1]=(a000:7600) size=30208 sw=320 sh=240 width=352 height=272 + [2]=(a000:ec00) size=30208 sw=320 sh=240 width=352 height=272 +mv[1].tx: 0 mv[1].ty: 0 panswitch=0 detected CPU type: 386 or newer diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 9b61ed8b..a4f1a16c 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -188,7 +188,7 @@ modexDefaultPage(page_t *p) page.tilemidposscreenx = page.tw/2; page.tilemidposscreeny = (page.th/2)+1; page.stridew=page.width/4; - page.pagesize = (sdiword)(page.width/4)*page.height; + page.pagesize = (word)(page.width/4)*page.height; page.id = 0; return page; @@ -238,7 +238,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.tilesh=result.height/TILEWH; result.id = p->id+1; result.stridew=result.width/4; - result.pagesize = (sdiword)(result.width/4)*result.height; + result.pagesize = (word)(result.width/4)*result.height; return result; } @@ -246,23 +246,24 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) void modexCalcVmemRemain(video_t *video) { byte i; - //printf("\n\n 1st vmem_remain=%ld\n", video->vmem_remain); - for(i=0; i<=video->num_of_pages-1; i++) + //printf("\n\n 1st vmem_remain=%u\n", video->vmem_remain); + for(i=0; inum_of_pages; i++) { video->vmem_remain-=video->page[i].pagesize; - //printf(" [%u], video->page[i].pagesize=%ld\n", i, video->page[i].pagesize); - //printf(" [%u], vmem_remain=%ld\n", i, video->vmem_remain); + //printf(" [%u], video->page[%u].pagesize=%u\n", i, i, video->page[i].pagesize); + //printf(" [%u], vmem_remain=%u\n", i, video->vmem_remain); } } void modexHiganbanaPageSetup(video_t *video) { - video->vmem_remain=262144L; + video->vmem_remain=65535U; video->num_of_pages=0; (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++; //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); (video->page[1]) = modexNextPage(&(video->page[0])); video->num_of_pages++; (video->page[2]) = modexNextPage(&(video->page[1])); video->num_of_pages++; - //(video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40); video->num_of_pages++; + (video->page[3]) = modexNextPage(&(video->page[2])); video->num_of_pages++; +// (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].width/8, video->page[0].height/8); video->num_of_pages++; //(video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH); video->num_of_pages++; modexCalcVmemRemain(video); video->p=0; @@ -1150,3 +1151,19 @@ void bios_cls() { printf("WARNING: bios cls no ptr\n"); } } + +void modexprintmeminfo(video_t *v) +{ + byte i; + printf("video memory remaining: %u\n", v->vmem_remain); + printf("page "); + for(i=0; inum_of_pages;i++) + { + printf(" [%u]=", i); + printf("(%Fp)", (v->page[i].data)); + printf(" size=%u", v->page[i].pagesize); + printf(" sw=%lu sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh); + printf(" width=%lu height=%lu", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height); + printf("\n"); + } +} diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 45c8b137..3ba8753c 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -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 diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index dff4e2cc..a82a8bd0 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -83,7 +83,7 @@ typedef struct { sword tileplayerposscreenx; /* player position on screen */ sword tileplayerposscreeny; /* player position on screen */ word stridew; /*width/4*/ - sdiword pagesize; /* page size */ + word pagesize; /* page size */ } page_t; typedef struct @@ -112,7 +112,7 @@ typedef struct { char old_mode; //old video mode before game! page_t page[MAXPAGE]; //pointer to root page[0] - sdiword vmem_remain; //remaining video memory + word vmem_remain; //remaining video memory byte num_of_pages; //number of actual pages boolean __near p; //render page number word pr[MAXPAGE][4]; //render sections of pages diff --git a/src/scroll.c b/src/scroll.c index 66a163d6..7fd790a6 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -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