]> 4ch.mooo.com Git - 16.git/blobdiff - src/scroll.c
ok getting there!
[16.git] / src / scroll.c
index 6b4176c9cb574aff112463120e72b6168de84897..41476b585927ab16bff9e03597ebfdc6b6751e60 100755 (executable)
@@ -37,8 +37,9 @@ map_view_t mv[3];
 map_view_t *bg, *spri, *mask;//, *tmp;
 planar_buf_t *p;
 float t;
+sword bakapee;
 
-void main()
+void main(int argc, char *argv[])
 {
 //     word panswitch=0, panq=1, pand=0;
        word panpagenum=0; //for panning!
@@ -48,6 +49,7 @@ void main()
        //static int persist_aniframe = 0;    /* gonna be increased to 1 before being used, so 0 is ok for default */
 
        //map_view_db_t pgid[4];
+       word pg;
 #ifdef FADE
        byte *dpal, *gpal;
 #endif
@@ -55,8 +57,13 @@ void main()
        byte *mappalptr;
        byte *mesg=malloc(sizeof(dword));
 
+
+       if(argv[1]) bakapee = atoi(argv[1]);
+       else bakapee = 1;
+
        player[0].persist_aniframe=0;
        player[0].speed=4;
+       gvar.video.page=&screen;
 
        printf("starting timer\n");
        start_timer(&gvar);
@@ -103,7 +110,7 @@ void main()
 #endif
 
        textInit();
-       VGAmodeX(1, &gvar);
+       VGAmodeX(bakapee, &gvar);
 #ifdef FADE
        modexPalBlack();        //reset the palette~
 #endif
@@ -150,8 +157,8 @@ void main()
 
        //TODO: put player in starting position of spot
        //default player position on the viewable map
-       player[0].tx = bg->tx + 10;
-       player[0].ty = bg->ty + 8;
+       player[0].tx = bg->tx + bg->page->tilemidposscreenx;
+       player[0].ty = bg->ty + bg->page->tilemidposscreeny;
        player[0].x = player[0].tx*TILEWH;
        player[0].y = player[0].ty*TILEWH;
        player[0].triggerx = player[0].tx;
@@ -374,8 +381,9 @@ void main()
        //TODO fmemtest into page
        if(IN_KeyDown(4+1))     //4
        {
+               pg=1;
                SELECT_ALL_PLANES();
-               _fmemset(VGA, 15, 64);
+               _fmemset(((mv[pg].page->data+4)+(16*(mv[pg].page->width/4))), 15, 4);
        }
 
        if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break;        //incase things go out of sync!