From: sparky4 Date: Wed, 27 Apr 2016 18:46:45 +0000 (-0500) Subject: made major changes in code for the future of scroll ^^ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=e553045660c23a10ae193562ec2b46a8a2b84ee6;p=16.git made major changes in code for the future of scroll ^^ --- diff --git a/makefile b/makefile index 4ef4914a..9f9e4e43 100755 --- a/makefile +++ b/makefile @@ -74,7 +74,6 @@ OFLAGS=-obmiler -out -oh -ei -zp8 -fpi87 -onac -ol+ -ok####x FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS) -#DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ) VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ) @@ -82,21 +81,19 @@ DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) $(DOSLIBLIBS) DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib -#$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe planrpcx.exe -# tsthimem.exe -#testemm.exe testemm0.exe fonttes0.exe miditest.exe sega.exe sountest.exe + EXEC = 16.exe bakapi.exe $(TESTEXEC) tesuto.exe all: $(EXEC) joytest.exe vrs - -#$(16LIBOBJS) => 16.lib bug.... +#16.lib => $(16LIBOBJS) bug.... +16LIB=$(16LIBOBJS) # #game and bakapi executables # -16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.mah +16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib + wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib -fm=16.mah bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) -fm=bakapi.mah @@ -104,8 +101,8 @@ bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) # #Test Executables! # -scroll.exe: scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=scroll.mah +scroll.exe: scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib + wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib -fm=scroll.mah scroll.$(OBJ): $(SRC)scroll.c wcl $(FLAGS) -c $(SRC)scroll.c @@ -126,41 +123,29 @@ test.exe: test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) test2.exe: test2.$(OBJ) gfx.lib wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.mah -fonttest.exe: fonttest.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) fonttest.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fonttest.mah - -#fonttes0.exe: fonttes0.$(OBJ) $(16LIBOBJS) -# wcl $(FLAGS) fonttes0.$(OBJ) $(16LIBOBJS) - -fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) - wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) -fm=fontgfx.mah - -inputest.exe: inputest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.mah - -#sountest.exe: sountest.$(OBJ) $(16LIBOBJS) -# wcl $(FLAGS) sountest.$(OBJ) $(16LIBOBJS) +fonttest.exe: fonttest.$(OBJ) $(16LIB) gfx.lib + wcl $(FLAGS) fonttest.$(OBJ) $(16LIB) gfx.lib -fm=fonttest.mah -#miditest.exe: miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ) -# wcl $(FLAGS) miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ) +#fonttes0.exe: fonttes0.$(OBJ) $(16LIB) +# wcl $(FLAGS) fonttes0.$(OBJ) $(16LIB) -tsthimem.exe: tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) - wcl $(FLAGS) tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -fm=tsthimem.mah +fontgfx.exe: fontgfx.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) + wcl $(FLAGS) fontgfx.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS) -fm=fontgfx.mah -#testemm.exe: testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -# wcl $(FLAGS) testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) +inputest.exe: inputest.$(OBJ) $(16LIB) + wcl $(FLAGS) inputest.$(OBJ) $(16LIB) -fm=inputest.mah -#testemm0.exe: testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -# wcl $(FLAGS) testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) +#sountest.exe: sountest.$(OBJ) $(16LIB) +# wcl $(FLAGS) sountest.$(OBJ) $(16LIB) pcxtest.exe: pcxtest.$(OBJ) gfx.lib wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.mah -palettec.exe: palettec.$(OBJ) gfx.lib #$(16LIBOBJS) - wcl $(FLAGS) palettec.$(OBJ) gfx.lib -fm=palettec.mah #$(16LIBOBJS) +palettec.exe: palettec.$(OBJ) gfx.lib #$(16LIB) + wcl $(FLAGS) palettec.$(OBJ) gfx.lib -fm=palettec.mah #$(16LIB) -palettel.exe: palettel.$(OBJ) gfx.lib #$(16LIBOBJS) - wcl $(FLAGS) palettel.$(OBJ) gfx.lib -fm=palettel.mah #$(16LIBOBJS) +palettel.exe: palettel.$(OBJ) gfx.lib #$(16LIB) + wcl $(FLAGS) palettel.$(OBJ) gfx.lib -fm=palettel.mah #$(16LIB) pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib wcl $(FLAGS) pcxtest2.$(OBJ) gfx.lib -fm=pcxtest2.mah @@ -168,26 +153,17 @@ pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib planrpcx.exe: planrpcx.$(OBJ) gfx.lib wcl $(FLAGS) planrpcx.$(OBJ) gfx.lib -fm=planrpcx.mah -maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=maptest.mah +maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib + wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib -fm=maptest.mah -#maptest0.exe: maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ) -# wcl $(FLAGS) $(MFLAGS) maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ) +fmemtest.exe: fmemtest.$(OBJ) $(16LIB) + wcl $(FLAGS) fmemtest.$(OBJ) $(16LIB) -fm=fmemtest.mah -#emmtest.exe: emmtest.$(OBJ) memory.$(OBJ) -# wcl $(FLAGS) $(MFLAGS) emmtest.$(OBJ) memory.$(OBJ) +exmmtest.exe: exmmtest.$(OBJ) $(16LIB) + wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.mah $(16LIB) -#emsdump.exe: emsdump.$(OBJ) memory.$(OBJ) -# wcl $(FLAGS) $(MFLAGS) emsdump.$(OBJ) memory.$(OBJ) - -fmemtest.exe: fmemtest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) fmemtest.$(OBJ) $(16LIBOBJS) -fm=fmemtest.mah - -exmmtest.exe: exmmtest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.mah $(16LIBOBJS) - -vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIBOBJS) - wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.mah $(16LIBOBJS) +vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIB) + wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.mah $(16LIB) #====wcl -mc vgmtest.$(OBJ) $(VGMSNDOBJ) -fm=vgmtest.mah @@ -276,11 +252,8 @@ vgmtest.$(OBJ): $(SRC)vgmtest.c 16.lib: $(16LIBOBJS)# doslib.lib vgmsnd.lib wlib -b $(WLIBQ) 16.lib $(16LIBOBJS)# doslib.lib vgmsnd.lib -gfx.lib: $(GFXLIBOBJS) - wlib -b $(WLIBQ) gfx.lib $(GFXLIBOBJS) - -#doslib.lib: $(DOSLIBOBJ) # $(SRCLIB)cpu.lib -# wlib -b $(WLIBQ) doslib.lib $(DOSLIBOBJ) # $(SRCLIB)cpu.lib +gfx.lib: $(GFXLIBOBJS) 16_in.$(OBJ) 16_head.$(OBJ) + wlib -b $(WLIBQ) gfx.lib $(GFXLIBOBJS) 16_in.$(OBJ) 16_head.$(OBJ) vgmsnd.lib: $(VGMSNDOBJ) wlib -b $(WLIBQ) vgmsnd.lib $(VGMSNDOBJ) @@ -350,32 +323,6 @@ mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c midi.$(OBJ): $(SRCLIB)midi.h $(SRCLIB)midi.c wcl $(FLAGS) -c $(SRCLIB)midi.c -# -# doslib stuff -# -adlib.$(OBJ): $(DOSLIB)adlib.h $(DOSLIB)adlib.c - wcl $(FLAGS) -c $(DOSLIB)adlib.c - -8254.$(OBJ): $(DOSLIB)8254.h $(DOSLIB)8254.c - wcl $(FLAGS) -c $(DOSLIB)8254.c - -8259.$(OBJ): $(DOSLIB)8259.h $(DOSLIB)8259.c - wcl $(FLAGS) -c $(DOSLIB)8259.c - -dos.$(OBJ): $(DOSLIB)dos.h $(DOSLIB)dos.c - wcl $(FLAGS) -c $(DOSLIB)dos.c - -cpu.$(OBJ): $(DOSLIB)cpu.h $(DOSLIB)cpu.c - wcl $(FLAGS) -c $(DOSLIB)cpu.c - -himemsys.$(OBJ): $(DOSLIB)himemsys.h $(DOSLIB)himemsys.c - wcl $(FLAGS) -c $(DOSLIB)himemsys.c - -emm.$(OBJ): $(DOSLIB)emm.h $(DOSLIB)emm.c - wcl $(FLAGS) -c $(DOSLIB)emm.c - -# end of doslib stuff - 16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c wcl $(FLAGS) -c $(SRCLIB)16_head.c @@ -396,12 +343,6 @@ vgmSnd.$(OBJ): $(VGMSNDLIB)vgmSnd.h $(VGMSNDLIB)vgmSnd.c wcl $(FLAGS) -c $(VGMSNDLIB)vgmSnd.c #====wcl -c -mc $(VGMSNDLIB)vgmSnd.c -#3812intf.$(OBJ): $(VGMSNDLIB)3812intf.h $(VGMSNDLIB)3812intf.c -# wcl $(FLAGS) -c $(VGMSNDLIB)3812intf.c - -#farjsmn.$(OBJ): $(JSMNLIB)farjsmn.h $(JSMNLIB)farjsmn.c -# wcl $(FLAGS) $(MFLAGS) -c $(JSMNLIB)farjsmn.c - #memory.$(OBJ): $(EXMMLIB)memory.h $(EXMMLIB)memory.c # wcl $(FLAGS) $(MFLAGS) -c $(EXMMLIB)memory.c diff --git a/src/bakapi.h b/src/bakapi.h index 729e3b19..9a3821fa 100755 --- a/src/bakapi.h +++ b/src/bakapi.h @@ -25,7 +25,7 @@ #include "src/lib/bakapee.h" -//project 16 testing define switch for veiwing the contents of the video memory +//project 16 testing define switch for veiwing the contents of the video memory --sparky4 #define BOINK // what does this mean? --J.C. #endif /*__BAKAPI_H_*/ diff --git a/src/lib/modex16.c b/src/lib/modex16.c index b51b6223..8b7bf8c4 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -172,15 +172,15 @@ modexDefaultPage(page_t *p) page.dy = 0; page.sw = p->sw; page.sh = p->sh; - page.width = p->sw; - page.height = p->sh; + page.width = p->sw+TILEWHD; + page.height = p->sh+TILEWHD; page.tw = page.sw/TILEWH; page.th = page.sh/TILEWH; page.tilemidposscreenx = page.tw/2; page.tilemidposscreeny = (page.th/2)+1; page.tilesw=p->tilesw; page.tilesh=p->tilesh; - page.pagesize = page.width*page.height; + page.pagesize = (sdiword)page.width*page.height; page.id = 0; return page; @@ -220,7 +220,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.tw = p->width/TILEWH; result.th = p->height/TILEWH; result.id = p->id+1; - result.pagesize = result.width*result.height; + result.pagesize = (sdiword)result.width*result.height; return result; } @@ -228,24 +228,25 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) void modexCalcVmemRemain(video_t *video) { byte i; - video->vmem_remain=262144; - for(i=0; i<=video->num_of_pages; i++) + printf("\n\n 1st vmem_remain=%ld\n", video->vmem_remain); + for(i=0; i<=video->num_of_pages-1; 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); } } void modexHiganbanaPageSetup(video_t *video) { + video->vmem_remain=262144L; (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++; - video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); + //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); (video->page[1]) = modexNextPage(&(video->page[0])); video->num_of_pages++; -// (video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, 16); video->num_of_pages++; -// (video->page[2]) = modexNextPage(&(video->page[1])); video->num_of_pages++; - //(352*176)+1024 is the remaining amount of memory left wwww -// modexCalcVmemRemain(video); -// (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].sw, 92); 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]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH); video->num_of_pages++; modexCalcVmemRemain(video); + video->p=0; } void diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index a4aaf647..5e9a866d 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -41,7 +41,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); mapScrollRight(pip, player, 0, pn); mapScrollRight(pip, player, 1, pn); -// mapScrollRight(pip, player, 2, pn); + ScrollRight(pip, player, 2, pn); + ScrollRight(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } @@ -83,7 +84,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); mapScrollLeft(pip, player, 0, pn); mapScrollLeft(pip, player, 1, pn); -// mapScrollLeft(pip, player, 2, pn); + ScrollLeft(pip, player, 2, pn); + ScrollLeft(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } @@ -125,7 +127,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); mapScrollDown(pip, player, 0, pn); mapScrollDown(pip, player, 1, pn); -// mapScrollDown(pip, player, 2, pn); + ScrollDown(pip, player, 2, pn); + ScrollDown(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } @@ -167,7 +170,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); mapScrollUp(pip, player, 0, pn); mapScrollUp(pip, player, 1, pn); -// mapScrollUp(pip, player, 2, pn); + ScrollUp(pip, player, 2, pn); + ScrollUp(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } @@ -319,7 +323,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) { word x, y; /* coordinate for drawing */ - /* increment the pixel position and update the page */ + /* decrement the pixel position and update the page */ mv[id].page->dx -= player[plid].speed; /* check to see if this changes the tile */ @@ -348,7 +352,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) { word x, y; /* coordinate for drawing */ - /* increment the pixel position and update the page */ + /* decrement the pixel position and update the page */ mv[id].page->dy -= player[plid].speed; /* check to see if this changes the tile */ @@ -398,6 +402,65 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) //} } + +//TODO finish this wwww +void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid) +{ + /* increment the pixel position and update the page */ + mv[0].video->page[id].dx += player[plid].speed; + + /* check to see if this changes the tile */ + if(mv[0].video->page[id].dx >= mv[id].dxThresh ) + { + /* Snap the origin forward */ + mv[0].video->page[id].data += 4; + mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth; + } +} + + +void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid) +{ + /* decrement the pixel position and update the page */ + mv[0].video->page[id].dx -= player[plid].speed; + + /* check to see if this changes the tile */ + if(mv[0].video->page[id].dx == 0) + { + /* Snap the origin backward */ + mv[0].video->page[id].data -= 4; + mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth; + } +} + +void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid) +{ + /* decrement the pixel position and update the page */ + mv[0].video->page[id].dy -= player[plid].speed; + + /* check to see if this changes the tile */ + if(mv[0].video->page[id].dy == 0) + { + /* Snap the origin backward */ + mv[0].video->page[id].data -= 4; + mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; + } +} + +void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid) +{ + /* increment the pixel position and update the page */ + mv[0].video->page[id].dy += player[plid].speed; + + /* check to see if this changes the tile */ + if(mv[0].video->page[id].dy >= mv[id].dxThresh ) + { + /* Snap the origin forward */ + mv[0].video->page[id].data += 4; + mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; + } +} + sword chkmap(map_t *map, word q) { // bitmap_t bp; @@ -704,8 +767,11 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll #define FRAME2 modexClearRegion(pip[1].page, x, y, 24, 32, 1+dire); #define FRAME3 modexClearRegion(pip[1].page, x, y, 24, 32, dire); #define FRAME4 modexClearRegion(pip[1].page, x, y, 24, 32, 1+dire); -#endif - modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40); + #endif + if(pageflipflop) + modexCopyPageRegion(pip[pip->video->p].page, + pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 40); + else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40); //modexCopyPageRegion(pip[2].page, pip[1].page, 16, 16, 16, 16, (14*8)+4, 8+4); if(2>ls && ls>=1) { FRAME1 }else if(3>ls && ls>=2) { FRAME2 }else diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 7a4f24a0..67e09455 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -73,6 +73,10 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid); +void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid); +void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid); +void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid); +void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid); sword chkmap(map_t *map, word q); void mapGoTo(map_view_t *mv, int tx, int ty); void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 8c80cbe1..8eff787f 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -80,7 +80,7 @@ typedef struct { sword tilemidposscreeny; /* middle tile position */ sword tileplayerposscreenx; /* player position on screen */ sword tileplayerposscreeny; /* player position on screen */ - iword pagesize; /* page size */ + sdiword pagesize; /* page size */ } page_t; typedef struct @@ -106,7 +106,7 @@ typedef struct { char old_mode; //old video mode before game! page_t page[MAXPAGE]; //pointer to root page[0] - sdword vmem_remain; //remaining video memory + sdiword vmem_remain; //remaining video memory byte num_of_pages; //number of actual pages boolean p; //render page number word pr[MAXPAGE][4]; //render sections of pages diff --git a/src/lib/types.h b/src/lib/types.h index c01eeef3..69291248 100755 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -37,6 +37,9 @@ typedef signed long sdword; typedef unsigned int iword; typedef signed int siword; +typedef unsigned long int diword; +typedef signed long int sdiword; + typedef enum {false,true} boolean; #endif/*_TYPE_H_*/ diff --git a/src/scroll.c b/src/scroll.c index 8fe1bc42..30433ef7 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -161,7 +161,7 @@ void main(int argc, char *argv[]) /* setup camera and screen~ */ modexHiganbanaPageSetup(&gvar.video); - for(i=0;itilemidposscreenx; @@ -337,8 +336,9 @@ void main(int argc, char *argv[]) if(IN_KeyDown(2)){ modexShowPage(mv[0].page); panpagenum=0; } if(IN_KeyDown(3)){ modexShowPage(mv[1].page); panpagenum=1; } if(IN_KeyDown(4)){ modexShowPage(mv[2].page); panpagenum=2; } - if(IN_KeyDown(5)){ modexShowPage(&(gvar.video.page[3])); panpagenum=3; } - if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page); } //p + if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page); + //IN_Ack(); + } //p #ifdef MODEX #ifdef FADE if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); } @@ -356,6 +356,7 @@ void main(int argc, char *argv[]) if(IN_KeyDown(87)) //f11 { pageflipflop=!pageflipflop; + //IN_Ack(); // VGAmodeX(0, 0, &gvar); // IN_Shutdown(); // __asm @@ -415,11 +416,14 @@ void main(int argc, char *argv[]) printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh); printf("tile resolution: %dx", gvar.video.page[0].tilesh); printf("%d ", gvar.video.page[0].tilesh); printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); - printf("video memory remaining: %d\n", gvar.video.vmem_remain); + printf("video memory remaining: %ld\n", gvar.video.vmem_remain); printf("\npage "); for(i=0; i