+++ /dev/null
-# do not use GNU make.
-# Only use Open Watcom WMAKE
-
-all: cpu16.exe cpu16h.exe cpu32.exe
-
-clean: .symbolic
- rm -v *.exe *.obj *.map
-
-DOSLIBDIR=..
-!include $(DOSLIBDIR)/extdep.mak
-
-# library deps 16-bit large
-$(DOSLIBDIR)/hw/cpu/dos86l/cpu.lib:
- cd $(DOSLIBDIR)/hw/cpu && ./make.sh
-$(DOSLIBDIR)/hw/dos/dos86l/dos.lib:
- cd $(DOSLIBDIR)/hw/dos && ./make.sh
-
-# library deps 16-bit huge
-$(DOSLIBDIR)/hw/cpu/dos86h/cpu.lib:
- cd $(DOSLIBDIR)/hw/cpu && ./make.sh
-$(DOSLIBDIR)/hw/dos/dos86h/dos.lib:
- cd $(DOSLIBDIR)/hw/dos && ./make.sh
-
-# library deps 32-bit flat
-$(DOSLIBDIR)/hw/cpu/dos386f/cpu.lib:
- cd $(DOSLIBDIR)/hw/cpu && ./make.sh
-$(DOSLIBDIR)/hw/dos/dos386f/dos.lib:
- cd $(DOSLIBDIR)/hw/dos && ./make.sh
-
-# NOTE: dos86l = 16-bit large memory model. memory model must match!
-cpu16.exe: cpu16.obj $(DOSLIBDIR)/hw/cpu/dos86l/cpu.lib $(DOSLIBDIR)/hw/dos/dos86l/dos.lib
- %write tmp.cmd option quiet option map=cpu16.map $(DOSLIB_LDFLAGS_DOS16L) file cpu16.obj name cpu16.exe
- %write tmp.cmd library $(DOSLIBDIR)/hw/cpu/dos86l/cpu.lib
- %write tmp.cmd library $(DOSLIBDIR)/hw/dos/dos86l/dos.lib
- @wlink @tmp.cmd
-cpu16.obj: cpu.c
- wcl $(FLAGS) -fo=cpu16.obj -ml $(DOSLIB_CFLAGS_DOS16L) -c cpu.c
-
-# NOTE: dos86h = 16-bit huge memory model. memory model must match!
-cpu16h.exe: cpu16h.obj $(DOSLIBDIR)/hw/cpu/dos86h/cpu.lib $(DOSLIBDIR)/hw/dos/dos86h/dos.lib
- %write tmp.cmd option quiet option map=cpu16h.map $(DOSLIB_LDFLAGS_DOS16H) file cpu16h.obj name cpu16h.exe
- %write tmp.cmd library $(DOSLIBDIR)/hw/cpu/dos86h/cpu.lib
- %write tmp.cmd library $(DOSLIBDIR)/hw/dos/dos86h/dos.lib
- @wlink @tmp.cmd
-cpu16h.obj: cpu.c
- wcl $(FLAGS) -fo=cpu16h.obj -mh $(DOSLIB_CFLAGS_DOS16H) -c cpu.c
-
-# NOTE: dos386f = 32-bit flat memory model. memory model must match!
-cpu32.exe: cpu32.obj $(DOSLIBDIR)/hw/cpu/dos386f/cpu.lib $(DOSLIBDIR)/hw/dos/dos386f/dos.lib
- %write tmp.cmd option quiet option map=cpu32.map $(DOSLIB_LDFLAGS_DOS32) file cpu32.obj name cpu32.exe
- %write tmp.cmd library $(DOSLIBDIR)/hw/cpu/dos386f/cpu.lib
- %write tmp.cmd library $(DOSLIBDIR)/hw/dos/dos386f/dos.lib
- @wlink @tmp.cmd
-cpu32.obj: cpu.c
- wcl386 $(FLAGS) -fo=cpu32.obj -mf $(DOSLIB_CFLAGS_DOS32) -c cpu.c
-
void modexHiganbanaPageSetup(video_t *video)\r
{\r
(video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++;\r
- video->page[0].width += (TILEWH*2); video->page[0].height += (TILEWH*2);\r
+ 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, 16); video->num_of_pages++;\r
+// (video->page[2]) = modexNextPage(&(video->page[1])); video->num_of_pages++;\r
//(352*176)+1024 is the remaining amount of memory left wwww\r
- modexCalcVmemRemain(video);\r
- (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].sw, 92); video->num_of_pages++;\r
+// modexCalcVmemRemain(video);\r
+// (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].sw, 92); video->num_of_pages++;\r
modexCalcVmemRemain(video);\r
}\r
+\r
void\r
modexShowPage(page_t *page) {\r
word high_address;\r
{\r
word doffset = (word)dest->data + dy*(dest->width/4) + dx/4;\r
word soffset = (word)src->data + sy*(src->width/4) + sx/4;\r
- word scans = width/4;\r
+ word scans = vga_state.vga_stride;\r
word nextSrcRow = src->width/4 - scans - 1;\r
word nextDestRow = dest->width/4 - scans - 1;\r
byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */\r
animatePlayer(pip, player, pn, 1);
mapScrollRight(pip, player, 0, pn);
mapScrollRight(pip, player, 1, pn);
- modexShowPage(pip[1].page);
+// mapScrollRight(pip, player, 2, pn);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }
}
INC_PER_FRAME;
player[pn].x+=(player[pn].speed);
animatePlayer(pip, player, pn, 0);
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }
}
#else
modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 14);
#endif
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].d = 2;
}
player[pn].triggerx = player[pn].tx+1;
animatePlayer(pip, player, pn, 1);
mapScrollLeft(pip, player, 0, pn);
mapScrollLeft(pip, player, 1, pn);
- modexShowPage(pip[1].page);
+// mapScrollLeft(pip, player, 2, pn);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }
}
INC_PER_FRAME;
player[pn].x-=(player[pn].speed);
animatePlayer(pip, player, pn, 0);
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }
}
#else
modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 10);
#endif
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].d = 2;
}
player[pn].triggerx = player[pn].tx-1;
animatePlayer(pip, player, pn, 1);
mapScrollDown(pip, player, 0, pn);
mapScrollDown(pip, player, 1, pn);
- modexShowPage(pip[1].page);
+// mapScrollDown(pip, player, 2, pn);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }
}
INC_PER_FRAME;
player[pn].y+=(player[pn].speed);
animatePlayer(pip, player, pn, 0);
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }
}
#else
modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 9);
#endif
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].d = 2;
}
player[pn].triggerx = player[pn].tx;
animatePlayer(pip, player, pn, 1);
mapScrollUp(pip, player, 0, pn);
mapScrollUp(pip, player, 1, pn);
- modexShowPage(pip[1].page);
+// mapScrollUp(pip, player, 2, pn);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }
}
INC_PER_FRAME;
player[pn].y-=(player[pn].speed);
animatePlayer(pip, player, 0, pn);
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].q++;
} else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }
}
#else
modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 12);
#endif
- modexShowPage(pip[1].page);
+ if(!pageflipflop) modexShowPage(pip[1].page);
player[pn].d = 2;
}
player[pn].triggerx = player[pn].tx;
}*/
unsigned char shinku_fps_indicator_page = 0;
+boolean pageflipflop;
//gv->video.p
/* sync */
//modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4);
/* block copy to visible RAM from offscreen */
vga_setup_wm1_block_copy();
- o = *(gv->video.page[2].data); // source offscreen
- o2 = *(gv->video.page[shinku_fps_indicator_page].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride)
- for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) vga_wm1_mem_block_copy(o2,o,w >> 2);
+ modexCopyPageRegion(&(gv->video.page[shinku_fps_indicator_page]), &(gv->video.page[!shinku_fps_indicator_page]), x, y, x+w, 0, w, h);
+// o = *(gv->video.page[2].data); // source offscreen
+// o2 = *(gv->video.page[shinku_fps_indicator_page].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride)
+// for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) vga_wm1_mem_block_copy(o2,o,w >> 2);
/* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */
vga_restore_rm0wm0();
if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))
gv->kurokku.tiku=0;
/* block copy to visible RAM from offscreen */
vga_setup_wm1_block_copy();
- o = *(gv->video.page[shinku_fps_indicator_page].data); // source offscreen
- o2 = *(gv->video.page[2].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride)
- for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) vga_wm1_mem_block_copy(o2,o,w >> 2);
+// o = *(gv->video.page[shinku_fps_indicator_page].data); // source offscreen
+// o2 = *(gv->video.page[2].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride)
+// for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) vga_wm1_mem_block_copy(o2,o,w >> 2);
+ modexCopyPageRegion(&(gv->video.page[shinku_fps_indicator_page]), &(gv->video.page[!shinku_fps_indicator_page]), x, y, x, 0, w, h);
/* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */
vga_restore_rm0wm0();
}else //copy dat sheet
gv->kurokku.frames_per_second=60;
break;
}
+ if(pageflipflop) modexShowPage(&(gv->video.page[gv->video.p]));
gv->video.p=!gv->video.p;
}
chkmap(&map, 0);
printf("chkmap ok ");
fprintf(stderr, "yay map loaded~~\n");
- mv[0].map = ↦
- mv[1].map = ↦
- mv[2].map = ↦
/* draw the tiles */
#ifdef MODEX
/* setup camera and screen~ */
modexHiganbanaPageSetup(&gvar.video);
- mv[0].page = &gvar.video.page[0];
- mv[1].page = &gvar.video.page[1];
- mv[2].page = &gvar.video.page[2];
+ for(i=0;i<gvar.video.num_of_pages;i++)
+ {
+ mv[i].page = &gvar.video.page[i];
+ mv[i].map = ↦
+ mv[i].video = &gvar.video;
+ }
/* set up paging */
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
//TSR
if(IN_KeyDown(87)) //f11
{
- VGAmodeX(0, 0, &gvar);
- IN_Shutdown();
- __asm
- {
- mov ah,31h
- int 21h
- }
+ pageflipflop=!pageflipflop;
+// VGAmodeX(0, 0, &gvar);
+// IN_Shutdown();
+// __asm
+// {
+// mov ah,31h
+// int 21h
+// }
}
if(IN_KeyDown(88)) //s
{
- switch(gvar.kurokku.fpscap)
- {
- case 0:
- gvar.kurokku.fpscap=1;
- break;
- case 1:
- gvar.kurokku.fpscap=0;
- break;
- }
+ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;
//IN_Ack();
}
//TODO fmemtest into page
//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\n", gvar.video.page[0].height);
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\n", gvar.video.page[0].tilesh);
+ 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("\npage ");
+ for(i=0; i<gvar.video.num_of_pages;i++)
+ {
+ printf("[%u]=(%Fp) ", i, &(gvar.video.page[i].data));
+ }
+ printf("\n");
// printf("Screen2: %dx", gvar.video.page[1].width); printf("%d\n", gvar.video.page[1].height);
// printf("map: %dx%d\n", map.width, map.height);
// printf("\n");