X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fscroll.c;h=36a7370c2fa96bfcc23fe33cac557dcda0f90455;hb=af3fef6d5d490fded0b36ad2f7e983fe732af986;hp=c262ec5e7e62c47b38fae02b5a419a3a85b53920;hpb=f46812eee344744353471ae7dfd56abd9cb56ec4;p=16.git
diff --git a/src/scroll.c b/src/scroll.c
old mode 100644
new mode 100755
index c262ec5e..36a7370c
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -1,379 +1,249 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * 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 "src/lib/scroll16.h"
-#include "src/lib/mapread.h"
-#include "src/lib/wcpu/wcpu.h"
-
-//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
-
-void main()
-{
- dword tiku = 0;
-// word panswitch=0, panq=1, pand=0;
- global_game_variables_t gvar;
- word panpagenum=0; //for panning!
- int i;
- static word paloffset=0;
- planar_buf_t *p;
- const char *cpus;
- //static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */
- page_t screen, screen2, screen3;
- static map_t map;
- map_view_t mv[3];
- map_view_t *bg, *spri, *mask;//, *tmp;
- //map_view_db_t pgid[4];
- byte *dpal, *gpal;
- byte *ptr;
- byte *mappalptr;
- byte *mesg=malloc(sizeof(dword));
- player_t player[MaxPlayers];
-
- player[0].persist_aniframe=0;
- player[0].speed=4;
-
- start_timer(&gvar);
- gvar.frames_per_second = 60;
- //extern struct inconfig inpu;
-
-// atexit(qclean());
-
- /* create the map */
- //printf("Total used @ before map load: %zu\n", oldfreemem-GetFreeSize());
- printf("Total free @ before map load: %zu\n", GetFreeSize());
- printf("Total near free @ before map load: %zu\n", GetNearFreeSize());
- printf("Total far free @ before map load: %zu\n", GetFarFreeSize());
-// getch();
-//0000 fprintf(stderr, "testing~\n");
-// loadmap("data/test.map", &map);
- map.width=0;
- map.height=0;
- chkmap(&map, 1);
-//0000 fprintf(stderr, "yay map loaded~~\n");
-//---- map = allocMap(map.width,map.height); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly
- //if(isEMS()) printf("%d tesuto\n", coretotalEMS());
-//---- initMap(&map);
- mv[0].map = ↦
- mv[1].map = ↦
- mv[2].map = ↦
-
- /* draw the tiles */
- ptr = map.data;
- mappalptr = map.tiles->data->palette;
- /* data */
-//0000 printf("Total used @ before image loading: %zu\n", oldfreemem-GetFreeSize());
- player[0].data = bitmapLoadPcx("data/ptmp.pcx"); // load sprite
- //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
-
- /* create the planar buffer */
-//0000 printf("Total used @ before planar buffer creation: %zu\n", oldfreemem-GetFreeSize());
- p = planar_buf_from_bitmap(&player[0].data);
-//0000 printf("Total used @ after planar buffer creation: %zu\n", oldfreemem-GetFreeSize());
-
- /* input! */
- IN_Startup();
- IN_Default(0,&player,ctrl_Joystick);
-
- /* save the palette */
- dpal = modexNewPal();
- modexPalSave(dpal);
- modexFadeOff(4, dpal);
-
- textInit();
- VGAmodeX(1);
- modexPalBlack(); //reset the palette~
-// printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize());
- player[0].data.offset=(paloffset/3);
- modexPalUpdate(&player[0].data, &paloffset, 0, 0);
- //printf(" %d\n", sizeof(ptmp->data));
- //printf("1: %d\n", paloffset);
- map.tiles->data->offset=(paloffset/3);
- //XTmodexPalUpdate(map.tiles->data, &paloffset, 0, 0);
-// printf("\n====\n");
-// printf("0 paloffset= %d\n", paloffset/3);
-// printf("====\n\n");
- gpal = modexNewPal();
- modexPalSave(gpal);
- modexSavePalFile("data/g.pal", gpal);
- modexPalBlack(); //so player will not see loadings~
-
- /* setup camera and screen~ */
- screen = modexDefaultPage();
- screen.width += (TILEWH*2);
- screen.height += (TILEWH*2);//+QUADWH;
- mv[0].page = &screen;
- screen2 = modexNextPage(mv[0].page);
- mv[1].page = &screen2;
- screen3 = modexNextPage0(mv[1].page, 320, 240); //(352*176)+1024 is the remaining amount of memory left wwww
- //screen3 = modexNextPage0(mv2.page, 320, 192); //(352*176)+1024 is the remaining amount of memory left wwww
- mv[2].page = &screen3;
-
- /* set up paging */
- bg = &mv[0];
- spri = &mv[1];
- mask = &mv[2];
-
-//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
- mapGoTo(bg, 0, 0);
- mapGoTo(spri, 0, 0);
- //mapGoTo(mask, 0, 0);
-
- //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].x = player[0].tx*TILEWH;
- player[0].y = player[0].ty*TILEWH;
- player[0].triggerx = player[0].tx;
- player[0].triggery = player[0].ty+1;
- player[0].q=1;
- player[0].info.dir=2;
- player[0].hp=4;
- //npc
- /*npc0.tx = bg->tx + 1;
- npc0.ty = bg->ty + 1;
- npc0.x = npc0.tx*TILEWH;
- npc0.y = npc0.ty*TILEWH;
- npc0.triggerx = npc0.tx;
- npc0.triggery = npc0.ty+1;
- npc0.q=1;
- npc0.d=0;
- modexDrawSpriteRegion(spri->page, npc0.x-4, npc0.y-TILEWH, 24, 64, 24, 32, &npctmp);*/
- modexDrawSpriteRegion(spri->page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32, &player[0].data);
-
- modexShowPage(spri->page);
-// printf("Total used @ before loop: %zu\n", oldfreemem-GetFreeSize());
- modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 1);
- modexFadeOn(4, gpal);
- while(!IN_KeyDown(sc_Escape) && player[0].hp>0)
- {
- sprintf(mesg, "%lu", tiku);
- modexprint(mv[1].page, 0, 0, 1, 15, 0, mesg);
- shinku(mv[1].page, &gvar);
- IN_ReadControl(0,&player);
- //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square
- //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction
- //when player[0].tx or player[0].ty == 0 or player[0].tx == 20 or player[0].ty == 15 then stop because that is edge of map and you do not want to walk of the map
-
- //player movement
- //if(!panswitch){
- walk(mv, player, 0);
- /*}else{
-//88 switch!
- //right movement
- if((IN_KeyDown(77) && !IN_KeyDown(75) && pand == 0) || pand == 2)
- {
- if(pand == 0){ pand = 2; }
- if(panq<=(TILEWH/(player[0].speed)))
- {
- switch(panpagenum)
- {
- case 0:
- //bg
- bg->page->dx++;
- modexShowPage(bg->page);
- break;
- case 1:
- //spri
- spri->page->dx++;
- modexShowPage(spri->page);
- break;
- case 2:
- //fg
- mask->page->dx++;
- modexShowPage(mask->page);
- break;
- }
- panq++;
- } else { panq = 1; pand = 0; }
- }
- //left movement
- if((IN_KeyDown(75) && !IN_KeyDown(77) && pand == 0) || pand == 4)
- {
- if(pand == 0){ pand = 4; }
- if(panq<=(TILEWH/(player[0].speed)))
- {
- switch(panpagenum)
- {
- case 0:
- //bg
- bg->page->dx--;
- modexShowPage(bg->page);
- break;
- case 1:
- //spri
- spri->page->dx--;
- modexShowPage(spri->page);
- break;
- case 2:
- //fg
- mask->page->dx--;
- modexShowPage(mask->page);
- break;
- }
- panq++;
- } else { panq = 1; pand = 0; }
- }
- //down movement
- if((IN_KeyDown(72) && !IN_KeyDown(80) && pand == 0) || pand == 3)
- {
- if(pand == 0){ pand = 3; }
- if(panq<=(TILEWH/(player[0].speed)))
- {
- switch(panpagenum)
- {
- case 0:
- //bg
- bg->page->dy--;
- modexShowPage(bg->page);
- break;
- case 1:
- //spri
- spri->page->dy--;
- modexShowPage(spri->page);
- break;
- case 2:
- //fg
- mask->page->dy--;
- modexShowPage(mask->page);
- break;
- }
- panq++;
- } else { panq = 1; pand = 0; }
- }
- //up movement
- if((IN_KeyDown(80) && !IN_KeyDown(72) && pand == 0) || pand == 1)
- {
- if(pand == 0){ pand = 1; }
- if(panq<=(TILEWH/(player[0].speed)))
- {
- switch(panpagenum)
- {
- case 0:
- //bg
- bg->page->dy++;
- modexShowPage(bg->page);
- break;
- case 1:
- //spri
- spri->page->dy++;
- modexShowPage(spri->page);
- break;
- case 2:
- //fg
- mask->page->dy++;
- modexShowPage(mask->page);
- break;
- }
- panq++;
- } else { panq = 1; pand = 0; }
- }
-}*/
-
-
- //the scripting stuf....
-
- //if(((player[0].triggerx == TRIGGX && player[0].triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))
- if(((bg->map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))
- {
- short i;
- for(i=800; i>=400; i--)
- {
- sound(i);
- }
- nosound();
- }
- if(player[0].q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].hp--; }
- //debugging binds!
- //if(IN_KeyDown(0x0E)) while(1){ if(xmsmalloc(24)) break; }
- if(IN_KeyDown(2)){ modexShowPage(bg->page); panpagenum=0; }
- if(IN_KeyDown(3)){ modexShowPage(spri->page); panpagenum=1; }
- if(IN_KeyDown(4)){ modexShowPage(mask->page); panpagenum=2; }
- if(IN_KeyDown(25)){ pdump(bg->page); pdump(spri->page); } //p
- if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; pdump(bg->page); pdump(spri->page); }
- if(IN_KeyDown(22)){
- paloffset=0; modexPalBlack(); modexPalUpdate(&player[0].data, &paloffset, 0, 0);
- printf("1paloffset = %d\n", paloffset/3);
- modexPalUpdate(map.tiles->data, &paloffset, 0, 0);
- printf("2paloffset = %d\n", paloffset/3);
- pdump(bg->page); pdump(spri->page); }
- //pan switch
- //if(IN_KeyDown(88)){if(!panswitch) panswitch++; else panswitch--; } //f12
- //TSR
- if(IN_KeyDown(87)) //f11
- {
- VGAmodeX(0);
- IN_Shutdown();
- __asm
- {
- mov ah,31h
- int 21h
- }
- }
-
- if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break; //incase things go out of sync!
-
- tiku++;
- }
-
- /* fade back to text mode */
- /* but 1st lets save the game palette~ */
- modexPalSave(gpal);
- modexSavePalFile("data/g.pal", gpal);
- modexFadeOff(4, gpal);
- VGAmodeX(0);
- IN_Shutdown();
- printf("Project 16 scroll.exe\n");
- printf("tx: %d\n", bg->tx);
- printf("ty: %d\n", bg->ty);
- printf("player[0].x: %d", player[0].x); printf(" player[0].y: %d\n", player[0].y);
- //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8);
- //else printf("\nplayer[0].y: %d\n", player[0].y);
- printf("player[0].tx: %d", player[0].tx); printf(" player[0].ty: %d\n", player[0].ty);
- printf("player[0].triggx: %d", player[0].triggerx); printf(" player[0].triggy: %d\n", player[0].triggery);
- printf("player[0].hp: %d", (player[0].hp)); printf(" player[0].q: %d", player[0].q); printf(" player[0].info.dir: %d\n", player[0].info.dir);
- printf("tile data value at player trigger position: %d\n", bg->map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]);
- printf("palette offset: %d\n", paloffset/3);
-//++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize());
-//++++ printf("Total free: %zu\n", GetFreeSize());
- printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n");
- printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n");
- printf("Screen: %dx", screen.width); printf("%d\n", screen.height);
- printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height);
- printf("map: %dx%d\n", map.width, map.height);
- //printf("map.width=%d map.height=%d map.data[0]=%d\n", bg->map->width, bg->map->height, bg->map->data[0]);
- //xmsfree(&map);
- //xmsfree(bg);
- //xmsfree(spri);
- //xmsfree(mask);
- //xmsreport();
- //emmclose(emmhandle);
- switch(detectcpu())
- {
- case 0: cpus = "8086/8088 or 186/88"; break;
- case 1: cpus = "286"; break;
- case 2: cpus = "386 or newer"; break;
- default: cpus = "internal error"; break;
- }
- printf("detected CPU type: %s\n", cpus);
- modexFadeOn(4, dpal);
-}
+/* 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 "src/lib/scroll16.h"
+#include "src/lib/16_timer.h"
+#include "src/lib/16_dbg.h"
+
+#define FADE
+#define MODEX //this is for mode x initiating
+
+static map_t map;
+map_view_t mv[4];
+float t;
+sword bakapee;
+//debugswitches
+boolean panswitch=0;//1
+//extern boolean pageflipflop=1;
+extern boolean pagenorendermap;
+unsigned int i;
+//#ifdef FADE
+ static word paloffset=0;
+ byte *gvar.video.dpal;
+//#endif
+// byte *ptr;
+ byte *mappalptr;
+
+void main(int argc, char *argv[])
+{
+ static global_game_variables_t gvar;
+ static player_t player[MaxPlayers];
+ if(argv[1]) bakapee = atoi(argv[1]);
+ else bakapee = 1;
+
+ Startup16(&gvar);
+
+ /* create the map */
+// fprintf(stderr, "testing map load~ ");
+ CA_loadmap("data/test.map", &map, &gvar);
+ chkmap(&map, 0);
+// printf("chkmap ok ");
+// fprintf(stderr, "yay map loaded~~\n");
+
+ /* draw the tiles */
+#ifdef MODEX
+// ptr = map.data;
+// mappalptr = map.tiles->btdata->palette;
+
+ /* data */
+ PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite
+
+#endif
+ /* input! */
+ IN_Default(0, &player,ctrl_Keyboard1);
+
+ /* save the palette */
+#ifdef MODEX
+#ifdef FADE
+ gvar.video.dpal = modexNewPal();
+ modexPalSave(gvar.video.dpal);
+ modexFadeOff(4, gvar.video.dpal);
+#endif
+
+ VGAmodeX(bakapee, 1, &gvar);
+
+ /* fix up the palette and everything */
+#ifdef FADE
+ modexPalBlack(); //reset the palette~
+#endif
+#endif
+//++++ PCXBMPVAR.offset=(paloffset/3);
+//++++ modexPalUpdate(&PCXBMPVAR, &paloffset, 0, 0);
+ modexPalUpdate(&PCXBMP->palette);
+//++++0000 modexPalUpdate(map.tiles->btdata->palette);
+ //printf(" %d\n", sizeof(ptmp->data));
+ //printf("1: %d\n", paloffset);
+//++++ map.tiles->data->offset=(paloffset/3);
+ //XTmodexPalUpdate(map.tiles->data, &paloffset, 0, 0);
+// printf("\n====\n");
+// printf("0 paloffset= %d\n", paloffset/3);
+// printf("====\n\n");
+#ifdef MODEX
+#ifdef FADE
+ &gvar.video.palette = modexNewPal();
+ modexPalSave(&gvar.video.palette);
+ modexSavePalFile("data/g.pal", &gvar.video.palette);
+ modexPalBlack(); //so player will not see loadings~
+#endif
+#endif
+
+ /* setup camera and screen~ */
+ modexHiganbanaPageSetup(&gvar.video);
+ ZC_MVSetup(&mv, &map, &gvar);
+
+ //renderswitch
+ gvar.video.rss=1;
+
+ /* set up paging */
+ //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
+ mapGoTo(&mv, 0, 0);
+
+ ZC_playerXYpos(0, 0, &player, &mv, 0, 1);
+ EN_initplayer(&player, 0, &gvar.video);
+ if (gvar.video.sprifilei == -1)
+ {
+#ifdef FADE
+ modexFadeOff(4, &gvar.video.palette);
+#endif
+ Quit(&gvar, "Wrong");
+#ifdef FADE
+ modexFadeOn(4, gvar.video.dpal);
+#endif
+ }
+
+#ifndef SPRITE
+ modexClearRegion(mv[0].page, player[0].enti.x, player[0].enti.y-TILEWH, 16, 32, 15);
+#else
+ modexDrawSpriteRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y-TILEWH, 16, 64, 16, 32, PCXBMPPTR);
+#endif
+
+ //if(!pageflipflop)
+ VL_ShowPage(mv[1].page, 0, 0);//modexShowPage(mv[1].page);
+ //else ZC_ShowMV(&mv, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p)
+
+ //modexDrawBmp(&gvar.video.page[0], 16, 16, PCXBMPPTR);
+ /* buffer pages */
+// modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47);
+// modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45);
+// {
+// unsigned int k,j,o;
+// /* fill screen with a distinctive pattern */
+// for (k=0;k < vga_state.vga_width;k++) {
+// o = k >> 2;
+// vga_write_sequencer(0x02/*map mask*/,1 << (k&3));
+// for (j=0;j < vga_state.vga_height;j++,o += vga_state.vga_stride)
+// vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15!
+// }
+// }
+ modexClearRegion(mv[3].page, 0, 128, 24, 36, 15);
+
+#ifdef MODEX
+#ifdef FADE
+ modexFadeOn(4, &gvar.video.palette);
+#endif
+#endif
+ while(!IN_KeyDown(sc_Escape) && player[0].enti.hp>0)
+ {
+ shinku(&gvar);
+ //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square
+ //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction
+ //when player[0].enti.tx or player[0].enti.ty == 0 or player[0].enti.tx == 20 or player[0].enti.ty == 15 then stop because that is edge of map and you do not want to walk of the map
+
+ //player movement
+ IN_ReadControl(0, &player);
+ if(!panswitch){
+ ZC_walk(&mv, &player, 0);
+ }else{
+ PANKEYFUNZC;//panPageManual(&mv, &player, 0);
+ //printf(" player[0].enti.q: %d", player[0].enti.q); printf(" player[0].d: %d\n", player[0].d);
+ }
+
+ //the scripting stuff....
+ //if(((player[0].enti.triggerx == TRIGGX && player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))
+ if(((mv[0].map->layerdata[0].data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))
+ {
+ short i;
+ for(i=800; i>=400; i--)
+ {
+ sound(i);
+ }
+ nosound();
+ }
+ if(player[0].enti.q == (TILEWH/(player[0].enti.speed))+1 && player[0].info.dir != 2 && (player[0].enti.triggerx == 5 && player[0].enti.triggery == 5)){ player[0].enti.hp--; }
+ //debugging binds!
+#ifdef MODEX
+#ifdef FADE
+ if(IN_KeyDown(24)){ modexPalUpdate0(&gvar.video.palette); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); } //p
+ /*if(IN_KeyDown(22)){
+ paloffset=0; modexPalBlack(); modexPalUpdate(PCXBMPVAR, &paloffset, 0, 0);
+ printf("1paloffset = %d\n", paloffset/3);
+ modexPalUpdate(map.tiles->data, &paloffset, 0, 0);
+ printf("2paloffset = %d\n", paloffset/3);
+ modexpdump(mv[0].page); modexpdump(mv[1].page);
+ IN_UserInput(1,1);
+ }*/
+#endif
+#endif
+ //pan switch
+ if(IN_KeyDown(62)) //f3
+ {
+ modexClearRegion(mv[1].page, 0, 0, mv[1].page->width, mv[1].page->height, 2);
+ modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 3);
+ modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 4);
+ modexClearRegion(mv[3].page, 0, 0, 20, 36, 15);
+ //IN_UserInput(1,1);
+ }
+
+ FUNCTIONKEYFUNCTIONS
+ FUNCTIONKEYDRAWJUNK
+ if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); }
+
+ //9
+#ifdef FADE
+ if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1,1); }
+#endif
+ if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r
+
+ if((player[0].enti.q==1) && !(player[0].enti.x%TILEWH==0 && player[0].enti.y%TILEWH==0)) break; //incase things go out of sync!
+ }
+
+ /* fade back to text mode */
+ /* but 1st lets save the game palette~ */
+#ifdef MODEX
+#ifdef FADE
+ modexPalSave(&gvar.video.palette);
+ modexSavePalFile("data/g.pal", &gvar.video.palette);
+ modexFadeOff(4, &gvar.video.palette);
+#endif
+ VGAmodeX(0, 1, &gvar);
+#endif
+ Shutdown16(&gvar);
+ printf("\nProject 16 scroll.exe. This is just a test file!\n");
+ printf("version %s\n", VERSION);
+ SCROLLEXITMESG;
+ WCPU_cpufpumesg();
+#ifdef MODEX
+#ifdef FADE
+ modexFadeOn(4, gvar.video.dpal);
+#endif
+#endif
+}