X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2F0.c;h=8734bb659ced166932ea17c4afb735a58dc3866c;hb=45f3e2d77b5287888a171d442f74ca4e0e807d9b;hp=3ac991ed292a913f52d36c3639c313813ad976bc;hpb=968b6bcf1d7f19f8902e1ae00f2a80ab78d399cc;p=16.git
diff --git a/src/0.c b/src/0.c
index 3ac991ed..8734bb65 100755
--- a/src/0.c
+++ b/src/0.c
@@ -1,3 +1,25 @@
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
+ *
+ * This file is part of Project 16.
+ *
+ * Project 16 is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Project 16 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see , or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
#include
#include
#include
@@ -30,10 +52,8 @@ int main(int argc,char **argv)
boolean anim=1,noanim=0,zerostoppause=1;
- gvar.video.panp=0;
-
bakapee1=malloc(64);
- bakapee2=malloc(1024);
+ bakapee2=malloc(64);
if (argc < 2) {
//fprintf(stderr,"drawvrl \n palette file optional\n");
@@ -85,15 +105,15 @@ int main(int argc,char **argv)
IN_Startup();
IN_Default(0,&player,ctrl_Keyboard1);
- EN_initplayer(&player, 0);
+ EN_initplayer(&player, 0, &gvar.video);
/* setup camera and screen~ */
modexHiganbanaPageSetup(&gvar.video);
ZC_MVSetup(&mv, &map, &gvar);
- ZC_ShowMV(&mv, gvar.video.panp, 0);
+ ZC_ShowMV(&mv, gvar.video.sp, 0);
// VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);
- VL_PatternDraw(&gvar.video, 0/*gvar.video.panp*/, 0, 1);
+ VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1);
TESTBG34
DRAWCORNERBOXES
@@ -134,7 +154,7 @@ int main(int argc,char **argv)
if(IN_KeyDown(sc_R)){
gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;
mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM;
-
+ VL_ShowPage(&gvar.video.page[gvar.video.sp], 1, 0);
player[0].enti.q = 1; player[0].enti.d = 2;
x=y=0;
xdir=ydir=1;
@@ -155,8 +175,8 @@ int main(int argc,char **argv)
/* block copy pattern to where we will draw the sprite */
vga_setup_wm1_block_copy();
- o2 = gvar.video.page[0].pagesize;
- o = (0x10000UL - (uint16_t)gvar.video.page[1].data) + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
+ o2 = gvar.video.page[0].pagesize+gvar.video.page[1].pagesize;
+ o = ((uint16_t)gvar.video.page[2].data) + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen 0x10000UL -
for (i=0;i < h;i++,o += gvar.video.page[0].stridew,o2 += (w >> 2)) 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();
@@ -164,7 +184,7 @@ int main(int argc,char **argv)
/* replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0) */
vga_state.vga_draw_stride_limit = (gvar.video.page[0].width + 3/*round up*/ - x) >> 2;
vga_state.vga_draw_stride = w >> 2;
- vga_state.vga_graphics_ram = omemptr + gvar.video.page[0].pagesize;
+ vga_state.vga_graphics_ram = omemptr + gvar.video.page[0].pagesize + gvar.video.page[1].pagesize;
/* then the sprite. note modding ram ptr means we just draw to (x&3,0) */
draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));
@@ -175,7 +195,7 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header
/* block copy to visible RAM from offscreen */
vga_setup_wm1_block_copy();
- o = gvar.video.page[0].pagesize; // source offscreen
+ o = gvar.video.page[0].pagesize+gvar.video.page[1].pagesize; // source offscreen
o2 = (ry * gvar.video.page[0].stridew) + (rx >> 2); // dest visible (original stride)
for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += gvar.video.page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2);
/* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */