]> 4ch.mooo.com Git - 16.git/commitdiff
p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
authorsparky4 <sparky4@cock.li>
Wed, 12 Apr 2017 18:20:47 +0000 (13:20 -0500)
committersparky4 <sparky4@cock.li>
Wed, 12 Apr 2017 18:20:47 +0000 (13:20 -0500)
14 files changed:
1croll.exe [new file with mode: 0755]
data/G.PAL
makefile
ptmp.pcx [new file with mode: 0755]
src/lib/16_tail.h
src/lib/16_tail_.c
src/lib/16_tdef.h
src/lib/16_timer.c
src/lib/16_vl.c
src/lib/16_vl.h
src/lib/16_vl_2.c [new file with mode: 0755]
src/lib/scroll16.c
src/lib/scroll16.h
src/xcroll.c

diff --git a/1croll.exe b/1croll.exe
new file mode 100755 (executable)
index 0000000..beb750e
Binary files /dev/null and b/1croll.exe differ
index 8092380af954e11b165eae773d83f03429619756..eb359e82a594533d6532f55e134770124ae84393 100755 (executable)
Binary files a/data/G.PAL and b/data/G.PAL differ
index 9be1782ed1c91cf7e27a66a4466f40e96f441258..e8658adb37f4ce9ef245d523ef4df6a2bd4992c4 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -137,7 +137,7 @@ LIBFLAGS=$(WLIBQ) -b -n
 #
 VGMSNDOBJ = vgmSnd.$(OBJ)
 #OLDLIBOBJS=bitmap.$(OBJ) 16render.$(OBJ)
-GFXLIBOBJS = 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16_vrs.$(OBJ) 16_spri.$(OBJ) $(OLDLIBOBJS)
+GFXLIBOBJS = 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16_vl_2.$(OBJ) 16_vlpal.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16_vrs.$(OBJ) 16_spri.$(OBJ) $(OLDLIBOBJS)
 16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_head.$(OBJ) 16_enti.$(OBJ) 16_dbg.$(OBJ) 16_in.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_wcpu.$(OBJ) 16_timer.$(OBJ) jsmn.$(OBJ) 16_map.$(OBJ) 16text.$(OBJ) 16_sd.$(OBJ) 16_tail_.$(OBJ) 16_dbg_1.$(OBJ)
 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
 !ifeq DEBUGSERIAL 1
diff --git a/ptmp.pcx b/ptmp.pcx
new file mode 100755 (executable)
index 0000000..3b95631
Binary files /dev/null and b/ptmp.pcx differ
index a782a303e21236212ff8ee3185802116d40884d2..28864242f99fc9c6c863afad58b1640a414d6735 100755 (executable)
@@ -83,6 +83,7 @@
        if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss;                   IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(&gvar.video.page[0]);                                      IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation;                               IN_UserInput(1, &gvar); } \\r
+       if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar);                                          IN_UserInput(1, &gvar); } \\r
        RFDEBUGFUNCTIONS\r
 //FIZZLEFADEFUNCTION\r
 \r
        if(gvar.in.inst->Keyboard[sc_X]){ TESTBG12 } \\r
        if(gvar.in.inst->Keyboard[sc_C]){ TESTBG34 } \\r
        if(gvar.in.inst->Keyboard[sc_V]){ VL_PatternDraw(&gvar.video, 0, 1, 1); } \\r
-       if(gvar.in.inst->Keyboard[sc_I]){ dbg_maptext=!dbg_maptext; IN_UserInput(1, &gvar); }\r
-/*     if(gvar.in.inst->Keyboard[sc_PgDn]){ \\r
+       if(gvar.in.inst->Keyboard[sc_I]){ dbg_maptext=!dbg_maptext; IN_UserInput(1, &gvar); } \\r
+       if(gvar.in.inst->Keyboard[sc_PgDn]){ \\r
                rotateR(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
                VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_PgUp]){ \\r
                rotateL(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
-               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1, &gvar); }*/\r
+               VL_UpdatePaletteWrite(&gvar.video.palette, 0);          IN_UserInput(1, &gvar); }\r
 #ifdef __BORLANDC__\r
 #define PAL_WRITE_REG             0x03C8   /* Color register, write address */\r
 #define PAL_DATA_REG                   0x03C9   /* Color register, data port */\r
index 10ef73953477103afad322c014f91de2bd11f75d..a21780c05ca118a40b11e92062a91156ab07c945 100755 (executable)
@@ -39,5 +39,6 @@ void  TL_VidInit(global_game_variables_t *gvar)
        //in.h.ah = 0xf;\r
        //int86(0x10, &in, &out);\r
        if(!gvar->video.old_mode) gvar->video.old_mode = vgaGetMode();//out.h.al;\r
+       VL_LoadPalFileCore(gvar->video.palette);\r
        gvar->video.VL_Initiated = 1;\r
 }\r
index 6321841d39281a7348e64cd5f7bf314b19b9cb4a..341ada31e809f6669635243f4f045fb909bfc04a 100755 (executable)
@@ -430,6 +430,7 @@ typedef struct
        int tx,ty; //appears to be the top left tile position on the viewable screen map\r
        word dxThresh,dyThresh; //Threshold for physical tile switch\r
        video_t *video; //pointer to game variables of the video\r
+       kurokku_t *kurokku;     //pointer to game variables of the kurokku\r
        nibble __near *p;       // pointer to video's render page num\r
        nibble __near *sp;      // pointer to video's show page num\r
        int dx, dy;     // draw row and col var\r
index a9dba5d5d26eeeb58792e1bf0bfdc8ecffe0d7ea..c5aae48597f78c67a18d8d26d17322710d5f1ae1 100755 (executable)
@@ -65,10 +65,6 @@ double time_in_seconds(global_game_variables_t *gv)
        return (gv->kurokku.t) / CLOCKS_PER_SEC;\r
 }\r
 \r
-// big global status text buffer\r
-char global_temp_status_text[512];\r
-char global_temp_status_text2[512];\r
-\r
 /*double time_in_seconds(time_t in_t)\r
 {\r
        return (in_t) / CLOCKS_PER_SEC;\r
index 91776466836ea7cb0bd26297e9b02aaa5967d5af..24e3342ed0fe67efbba8d6fde36f65f6df8cb2bd 100755 (executable)
@@ -364,7 +364,8 @@ modexShowPage(page_t *page) {
 \r
 //args: page, vertical sync switch, screen resolution switch, page0 switch\r
 void\r
-VL_ShowPage(page_t *page, boolean vsync, boolean sr) {\r
+VL_ShowPage(page_t *page, boolean vsync, boolean sr)\r
+{\r
        word high_address, low_address, offset;\r
        byte crtcOffset;\r
 \r
@@ -402,6 +403,7 @@ VL_ShowPage(page_t *page, boolean vsync, boolean sr) {
        outp(AC_INDEX, 0x33);\r
        outp(AC_INDEX, (page->dx & 0x03) << 1);\r
        vga_state.vga_graphics_ram = (VGA_RAM_PTR)page->data;\r
+       vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = page->stridew;\r
 }\r
 \r
 //=============================================================================\r
@@ -694,10 +696,15 @@ modexLoadPalFile(byte *filename, byte *palette) {
        fclose(file);\r
 }\r
 \r
-\r
 void VL_LoadPalFile(const char *filename, byte *palette)\r
 {\r
-       VL_LoadPalFilewithoffset(filename, palette, 0);\r
+       VL_LoadPalFilewithoffset(filename, palette, 8);\r
+       VL_LoadPalFileCore(palette);\r
+}\r
+\r
+void VL_LoadPalFileCore(byte *palette)\r
+{\r
+       VL_LoadPalFilewithoffset("data/16.pal", palette, 0);\r
 }\r
 \r
 void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o)\r
index 962593c702d0c7389e6baa508834aa4a051b6284..3cfa4347d22c7258589f3f1be7eb998276e5993f 100755 (executable)
@@ -193,6 +193,7 @@ void modexPalSave(byte *palette);
 //byte *modexNewPal();\r
 void modexLoadPalFile(char *filename, byte *palette);\r
 void VL_LoadPalFile(const char *filename, byte *palette);\r
+void VL_LoadPalFileCore(byte *palette);\r
 void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o);\r
 void VL_UpdatePaletteWrite(byte *palette, word o);\r
 void modexSavePalFile(char *filename, byte *palette);\r
@@ -242,6 +243,7 @@ static inline byte modexreadPixel(page_t *page, int x, int y, word addr)
 void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr);\r
 void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, boolean sw, const byte *str);\r
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
+void VL_modexPrintTextBox(global_game_variables_t *gvar);\r
 void modexpdump(page_t *pee);\r
 void modexcls(page_t *page, byte color, byte *Where);\r
 void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
diff --git a/src/lib/16_vl_2.c b/src/lib/16_vl_2.c
new file mode 100755 (executable)
index 0000000..68bbe44
--- /dev/null
@@ -0,0 +1,118 @@
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#include <conio.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "src/lib/16_vl.h"\r
+\r
+// big global status text buffer\r
+char global_temp_status_text[512];\r
+char global_temp_status_text2[512];\r
+\r
+#define PRINTTEXTBOXSTABLE\r
+\r
+void VL_modexPrintTextBox(global_game_variables_t *gvar)\r
+{\r
+#define PRINTTEXTBOXW  gvar->video.page[0].width\r
+#define PRINTTEXTBOXH  160\r
+#define PRINTTEXTBOXHLINE              0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD,   0xCD//, 0xCD,   0xCD,   0xCD,   0xCD\r
+#define PRINTTEXTBOXHLINETOP           0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCB, 0xCD, PRINTTEXTBOXHLINE\r
+#define PRINTTEXTBOXHLINEBOTTOM        0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCD, 0xCA, 0xCD, PRINTTEXTBOXHLINE\r
+#define PRINTTEXTBOXSLINE              0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20,   0x20//, 0x20,   0x20,   0x20,   0x20\r
+#define PRINTTEXTBOXSTRA2CHAR  0x20//07\r
+#define PRINTTEXTBOXSTRA2STR   PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR, PRINTTEXTBOXSTRA2CHAR\r
+       byte    str1[41] = { 0xC9, PRINTTEXTBOXHLINETOP, 0xBB, 0x00 };\r
+#ifdef PRINTTEXTBOXSTABLE\r
+       byte    str2[41] = { 0xBA, PRINTTEXTBOXSTRA2STR, 0xBA, PRINTTEXTBOXSLINE, 0xBA, 0x00 };\r
+#else\r
+       byte    str2[2] = { 0xBA, 0x00 },\r
+               stra2[7] = { PRINTTEXTBOXSTRA2STR, 0x00 },\r
+               strb2[] = {  0xBA, PRINTTEXTBOXSLINE, 0xBA, 0x00 };\r
+#endif\r
+       byte    str3[41] = { 0xC8, PRINTTEXTBOXHLINEBOTTOM, 0xBC, 0x00 };\r
+       word x = gvar->video.page[/*!*/(gvar->video.p)].dx;     //(gv->video.page[(gv->video.p)].tlx) - // follow the screen\r
+       word y = gvar->video.page[/*!*/(gvar->video.p)].dy;     //(gv->video.page[(gv->video.p)].tly) - // follow the screen\r
+       word col = 3, bgcol = 0, type = 1;//w = 64, h = 8,\r
+       word v = gvar->video.page[0].height-PRINTTEXTBOXH;      //vertical offset\r
+       nibble i;\r
+       boolean                 done;\r
+       ScanCode                scan;\r
+#ifndef PRINTTEXTBOXSTABLE\r
+       word q;\r
+#endif\r
+       //backuppart\r
+       modexCopyPageRegion(&gvar->video.page[0], &gvar->video.page[2],\r
+                       0,\r
+                       0,\r
+                       x,\r
+                       PRINTTEXTBOXH,\r
+                       PRINTTEXTBOXW, PRINTTEXTBOXH);\r
+//             mxOutText(xpos+1, ypos+gvar.video.page[0].height-40, "|    |Chikyuu:$line1");\r
+//             mxOutText(xpos+1, ypos+gvar.video.page[0].height-32, "|    |$line2");\r
+//             mxOutText(xpos+1, ypos+gvar.video.page[0].height-24, "|    |$line3");\r
+//             mxOutText(xpos+1, ypos+gvar.video.page[0].height-16, "|    |$line4");\r
+//             mxOutText(xpos+1, ypos+gvar.video.page[0].height-8,  "========================================");\r
+\r
+       //modexprint(*page, x, y, type, tlsw, color, bgcolor, sw, *str)\r
+       sprintf(global_temp_status_text, "%s", str1);\r
+       modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text); v-=8;\r
+#ifdef PRINTTEXTBOXSTABLE\r
+       sprintf(global_temp_status_text, "%s", str2); for(i=0;i<8;i++)\r
+{      modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text); v-=8;     }\r
+#else\r
+       for(i=0;i<8;i++)\r
+       {\r
+       q=0;\r
+       sprintf(global_temp_status_text, "%s", str2);   modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1,             global_temp_status_text);       q+=8;\r
+       sprintf(global_temp_status_text, "%s", stra2);  modexprint(&(gvar->video.page[(gvar->video.p)]), x+q, y+gvar->video.page[0].height-v, type, 1, col, 3, 1,               global_temp_status_text);       q+=40;\r
+       sprintf(global_temp_status_text, "%s", strb2);  modexprint(&(gvar->video.page[(gvar->video.p)]), x+q-8, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text);\r
+               v-=8;\r
+       }\r
+#endif\r
+       sprintf(global_temp_status_text, "%s", str3);\r
+       modexprint(&(gvar->video.page[(gvar->video.p)]), x, y+gvar->video.page[0].height-v, type, 1, col, bgcol, 1, global_temp_status_text);\r
+       for (i = 0,done = false;!done;)\r
+       {\r
+               while (!(scan = gvar->in.inst->LastScan))\r
+               {}\r
+//                             SD_Poll();\r
+\r
+               IN_ClearKey(scan);\r
+               switch (scan)\r
+               {\r
+                       default:\r
+                       case sc_Escape:\r
+                               done = true;\r
+                       break;\r
+                       case sc_Enter:\r
+                               //PM_GetPage(i, gvar);\r
+                       break;\r
+               }\r
+       }\r
+       modexCopyPageRegion(&gvar->video.page[2], &gvar->video.page[0],\r
+                       x,\r
+                       PRINTTEXTBOXH,\r
+                       0,\r
+                       0,\r
+                       PRINTTEXTBOXW, PRINTTEXTBOXH);\r
+}\r
index 249d0b3da2120a7c1d2be44561338008699a9407..94338ab7d872a49765a44ccfe9f9c4d8f4606653 100755 (executable)
 */\r
 #include "src/lib/scroll16.h"\r
 \r
+//check map edge\r
+boolean ZCL_mapEdgeChk(map_view_t *map_v, nibble dir, int tx, int ty, boolean pansw, boolean noscrollsw)\r
+{\r
+       int     w,h;\r
+\r
+       switch (pansw)\r
+       {\r
+               case 0:\r
+                       w = map_v[0].map->width;\r
+                       h = map_v[0].map->height;\r
+               break;\r
+               case 1:\r
+                       w = map_v[0].page->ti.tilesw;\r
+                       h = map_v[0].page->ti.tilesh;\r
+               break;\r
+       }\r
+\r
+       switch(dir)\r
+       {\r
+               default://no direction\r
+               case 2:\r
+                       //0000pip[0].video->startclk = (*clockw);\r
+                       return false;\r
+               break;\r
+               //right movement\r
+               case 3:\r
+                       if(noscrollsw) return tx < map_v[0].map->width;\r
+                       else return (map_v[0].tx >= 0 && map_v[0].tx+map_v[0].page->ti.tw < w);\r
+               break;\r
+               //left movement\r
+               case 1:\r
+                       if(noscrollsw) return tx > 1;\r
+                       else return (map_v[0].tx > 0 && map_v[0].tx+map_v[0].page->ti.tw <= w);\r
+               break;\r
+               //down movement\r
+               case 4:\r
+                       if(noscrollsw) return ty < map_v[0].map->height;\r
+                       else return (map_v[0].ty >= 0 && map_v[0].ty+map_v[0].page->ti.th < h);\r
+               break;\r
+               //up movement\r
+               case 0:\r
+                       if(noscrollsw) return ty > 1;\r
+                       else return (map_v[0].ty > 0 && map_v[0].ty+map_v[0].page->ti.th <= h);\r
+               break;\r
+       }\r
+       return false;\r
+}\r
+\r
+boolean ZCL_CollCheck(map_view_t *map_v, nibble dir, int tx, int ty)\r
+{\r
+       switch (dir)\r
+       {\r
+               default://no direction\r
+               case 2:\r
+               break;\r
+               case 3://right\r
+                       return !(map_v[0].map->layerdata[0].data[(tx)+(map_v[0].map->width*(ty-1))] == 0);\r
+               break;\r
+               case 1://left\r
+                       return !(map_v[0].map->layerdata[0].data[(tx-2)+(map_v[0].map->width*(ty-1))] == 0);\r
+               break;\r
+               case 4://down\r
+                       return !(map_v[0].map->layerdata[0].data[(tx-1)+(map_v[0].map->width*(ty))] == 0);\r
+               break;\r
+               case 0://up\r
+                       return !(map_v[0].map->layerdata[0].data[(tx-1)+(map_v[0].map->width*(ty-2))] == 0);\r
+               break;\r
+       }\r
+       return false;\r
+}\r
+\r
+boolean ZCL_ScreenMidPosChk(map_view_t *map_v, nibble dir, int tx, int ty)\r
+{\r
+       if(ZCL_mapEdgeChk(map_v, dir, 0, 0, 0, 0))\r
+               switch(dir)\r
+               {\r
+                       default://no direction\r
+                       case 2:\r
+                               //0000map_v[0].video->startclk = (*clockw);\r
+                               return false;\r
+                       break;\r
+                       //right movement\r
+                       case 3:\r
+                               return tx == map_v[0].tx+map_v[0].page->ti.tilemidposscreenx;\r
+                       break;\r
+                       //left movement\r
+                       case 1:\r
+                               return tx == map_v[0].tx+map_v[0].page->ti.tilemidposscreenx;\r
+                       break;\r
+                       //down movement\r
+                       case 4:\r
+                               return ty == map_v[0].ty+map_v[0].page->ti.tilemidposscreeny;\r
+                       break;\r
+                       //up movement\r
+                       case 0:\r
+                               return ty == map_v[0].ty+map_v[0].page->ti.tilemidposscreeny;\r
+                       break;\r
+               }\r
+       return false;\r
+}\r
+\r
 //#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+#define SHOWMVFUN__ ZC_ShowMV(pip, 1, 0);\r
+#endif\r
 \r
 void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
 {\r
@@ -36,8 +140,8 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                break;\r
                //right movement\r
                case 3:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 0) && player[pn].enti.tx == pip[0].tx+pip[0].page->ti.tilemidposscreenx &&\r
-                       !(pip[0].map->layerdata[0].data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))     //collision detection!\r
+                       if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))      //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -46,9 +150,13 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        ZC_mapScroll(pip, player, pn);\r
                                        player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->layerdata[0].data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -56,6 +164,9 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        player[pn].enti.x+=(player[pn].enti.speed);\r
                                        ZC_animatePlayer(pip, player, pn);\r
                                        player[pn].enti.q++;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
                        else\r
@@ -63,14 +174,17 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=0;\r
                                ZC_animatePlayer(pip, player, pn);\r
                                player[pn].enti.d = 2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                               SHOWMVFUN__\r
+#endif\r
                        }\r
                        player[pn].enti.triggerx = player[pn].enti.tx+1;\r
                        player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
                //left movement\r
                case 1:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 0) && player[pn].enti.tx == pip[0].tx+pip[0].page->ti.tilemidposscreenx &&\r
-                       !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))   //collision detection!\r
+                       if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))      //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -79,9 +193,13 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        ZC_mapScroll(pip, player, pn);\r
                                        player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       else if(player[pn].enti.tx > 1 && !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -89,6 +207,9 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        player[pn].enti.x-=(player[pn].enti.speed);\r
                                        ZC_animatePlayer(pip, player, pn);\r
                                        player[pn].enti.q++;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
                        else\r
@@ -96,14 +217,17 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=0;\r
                                ZC_animatePlayer(pip, player, pn);\r
                                player[pn].enti.d = 2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                               SHOWMVFUN__\r
+#endif\r
                        }\r
                        player[pn].enti.triggerx = player[pn].enti.tx-1;\r
                        player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
                //down movement\r
                case 4:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 0) && player[pn].enti.ty == pip[0].ty+pip[0].page->ti.tilemidposscreeny &&\r
-                       !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))     //collision detection!\r
+                       if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))      //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -112,9 +236,13 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        ZC_mapScroll(pip, player, pn);\r
                                        player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
+                       else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -122,6 +250,9 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        player[pn].enti.y+=(player[pn].enti.speed);\r
                                        ZC_animatePlayer(pip, player, pn);\r
                                        player[pn].enti.q++;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
                        else\r
@@ -129,14 +260,17 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=0;\r
                                ZC_animatePlayer(pip, player, pn);\r
                                player[pn].enti.d = 2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                               SHOWMVFUN__\r
+#endif\r
                        }\r
                        player[pn].enti.triggerx = player[pn].enti.tx;\r
                        player[pn].enti.triggery = player[pn].enti.ty+1;\r
                break;\r
                //up movement\r
                case 0:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 0) && player[pn].enti.ty == pip[0].ty+pip[0].page->ti.tilemidposscreeny &&\r
-                       !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))   //collision detection!\r
+                       if(ZCL_ScreenMidPosChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))      //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -145,9 +279,13 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        ZC_mapScroll(pip, player, pn);\r
                                        player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       else if(player[pn].enti.ty > 1 && !(pip[0].map->layerdata[0].data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
+                       else if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 0, 1) &&\r
+                       ZCL_CollCheck(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -155,6 +293,9 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        player[pn].enti.y-=(player[pn].enti.speed);\r
                                        ZC_animatePlayer(pip, player, pn);\r
                                        player[pn].enti.q++;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                                       SHOWMVFUN__\r
+#endif\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
                        else\r
@@ -162,6 +303,9 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=0;\r
                                ZC_animatePlayer(pip, player, pn);\r
                                player[pn].enti.d = 2;\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                               SHOWMVFUN__\r
+#endif\r
                        }\r
                        player[pn].enti.triggerx = player[pn].enti.tx;\r
                        player[pn].enti.triggery = player[pn].enti.ty-1;\r
@@ -178,7 +322,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
        {\r
                //right movement\r
                case 3:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 1))\r
+                       if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 1, 0))\r
                        {\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
@@ -191,7 +335,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
 \r
                //left movement\r
                case 1:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 1))\r
+                       if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 1, 0))\r
                        {\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
@@ -204,7 +348,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
 \r
                //down movement\r
                case 4:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 1))\r
+                       if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 1, 0))\r
                        {\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
@@ -217,7 +361,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
 \r
                //up movement\r
                case 0:\r
-                       if(ZC_mapEdgeChk(pip, player[pn].enti.d, 1))\r
+                       if(ZCL_mapEdgeChk(pip, player[pn].enti.d, player[pn].enti.tx, player[pn].enti.ty, 1, 0))\r
                        {\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
@@ -238,11 +382,12 @@ void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv)
 #define ZC_MVI 1\r
        nibble i;\r
        // 1st page\r
-       pip[0].page = &gv->video.page[0];\r
-       pip[0].map = map;\r
-       pip[0].video = &gv->video;\r
-       pip[0].p        = &gv->video.p;\r
-       pip[0].sp       = &gv->video.sp;\r
+       pip[0].page             = &gv->video.page[0];\r
+       pip[0].map              = map;\r
+       pip[0].video            = &gv->video;\r
+       pip[0].kurokku  = &gv->kurokku;\r
+       pip[0].p                = &gv->video.p;\r
+       pip[0].sp               = &gv->video.sp;\r
        ZC_MVInit(pip, 1, 1);\r
 \r
        for(i=ZC_MVI;i<gv->video.num_of_pages;i++)\r
@@ -269,43 +414,7 @@ void ZC_MVInit(map_view_t *pip, int tx, int ty)
 \r
 void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)\r
 {\r
-       word high_address, low_address, offset;\r
-       byte crtcOffset;\r
-\r
-       // calculate offset\r
-       offset = (word) moo[moo[0].video->sp].page->data;\r
-       offset += moo[0].page->dy * (moo[0].page->width >> 2 );\r
-       offset += moo[0].page->dx >> 2;\r
-\r
-       // calculate crtcOffset according to virtual width\r
-       switch(sr)\r
-       {\r
-               case 1:\r
-                       crtcOffset = moo[moo[0].video->sp].page->sw >> 3;\r
-               break;\r
-               default:\r
-               case 0:\r
-                       crtcOffset = moo[0].page->width >> 3;\r
-               break;\r
-       }\r
-\r
-       high_address = HIGH_ADDRESS | (offset & 0xff00);\r
-       low_address  = LOW_ADDRESS  | (offset << 8);\r
-\r
-       // wait for appropriate timing and then program CRTC\r
-       if(vsync) while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
-       outpw(CRTC_INDEX, high_address);\r
-       outpw(CRTC_INDEX, low_address);\r
-       outp(CRTC_INDEX, 0x13);\r
-       outp(CRTC_DATA, crtcOffset);\r
-\r
-       // wait for one retrace\r
-       if(vsync) while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
-\r
-       // do PEL panning here\r
-       outp(AC_INDEX, 0x33);\r
-       outp(AC_INDEX, (moo[0].page->dx & 0x03) << 1);\r
-       vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = moo[0].page->stridew;\r
+       VL_ShowPage(moo[0].page, vsync, sr);\r
 }\r
 \r
 #if 0\r
@@ -384,7 +493,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= mv[0].page->sw + mv[0].map->tiles->tileWidth;\r
-       if(ZC_mapEdgeChk(mv, player[plid].enti.d, 0))\r
+       if(ZCL_mapEdgeChk(mv, player[plid].enti.d, player[plid].enti.tx, player[plid].enti.ty, 0, 0))\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%4)\r
 #else\r
@@ -407,7 +516,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= 0;\r
-       if(ZC_mapEdgeChk(mv, player[plid].enti.d, 0))\r
+       if(ZCL_mapEdgeChk(mv, player[plid].enti.d, player[plid].enti.tx, player[plid].enti.ty, 0, 0))\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%4)\r
 #else\r
@@ -430,7 +539,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= 0;\r
-       if(ZC_mapEdgeChk(mv, player[plid].enti.d, 0))\r
+       if(ZCL_mapEdgeChk(mv, player[plid].enti.d, player[plid].enti.tx, player[plid].enti.ty, 0, 0))\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%3)\r
 #else\r
@@ -453,7 +562,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= mv[0].page->sh + mv[0].map->tiles->tileHeight;\r
-       if(ZC_mapEdgeChk(mv, player[plid].enti.d, 0))\r
+       if(ZCL_mapEdgeChk(mv, player[plid].enti.d, player[plid].enti.tx, player[plid].enti.ty, 0, 0))\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%3)\r
 #else\r
@@ -776,22 +885,8 @@ void shinku(global_game_variables_t *gv)
        }else //copy dat sheet\r
        gv->kurokku.tiku++;\r
 \r
-       switch(gv->kurokku.fpscap)\r
-       {\r
-               case 0: //turn this off if XT\r
-                       //modexprint(&(gv->video.page[0]), x, y+8, type, 1, col, bgcol, "sanic!");\r
-                       gv->kurokku.frames_per_second=1;\r
-               break;\r
-               case 1:\r
-                       //modexWaitBorder();\r
-                       //modexWaitBorder_start();\r
-                       //vga_wait_for_vsync();\r
-                       vga_wait_for_vsync_end();\r
-                       gv->kurokku.frames_per_second=60;\r
-               break;\r
-       }\r
        //render!!\r
-       if(gv->video.dorender )\r
+       if(gv->video.dorender)\r
        {//r=1\r
                /*if(video->bgp s)\r
                {\r
@@ -799,10 +894,30 @@ void shinku(global_game_variables_t *gv)
                }else{\r
                        //modexCopyPageRegion(&video->page[0], &video->page[1], enti->x, enti->y, 0, 0, 24, 32);\r
                }*/\r
+#ifndef OLDWALKSHOWPAGESTUFF\r
                VL_ShowPage(&(gv->video.page[gv->video.sp]), gv->kurokku.fpscap, 0);\r
+#endif\r
                gv->video.dorender =!gv->video.dorender;\r
                //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;\r
        }\r
+\r
+       switch(gv->kurokku.fpscap)\r
+       {\r
+               case 0: //turn this off if XT\r
+                       //modexprint(&(gv->video.page[0]), x, y+8, type, 1, col, bgcol, "sanic!");\r
+                       gv->kurokku.frames_per_second=1;\r
+               break;\r
+               case 1:\r
+#ifdef OLDWALKSHOWPAGESTUFF\r
+                       //modexWaitBorder();\r
+                       //modexWaitBorder_start();\r
+#else\r
+                       vga_wait_for_vsync();\r
+                       //vga_wait_for_vsync_end();\r
+#endif\r
+                       gv->kurokku.frames_per_second=60;\r
+               break;\r
+       }\r
        PM_NextFrame(gv);\r
 }\r
 \r
@@ -942,6 +1057,8 @@ void player_walk(player_t *player, map_view_t *map_v){
  *     end\r
  */\r
 \r
+\r
+\r
 void mapScroll(map_view_t *mv, player_t *player)\r
 {\r
        //word x, y;  /* coordinate for drawing */\r
index f7887686a9daae4118d413a5d51f6062bfb605ec..546fbe2929850ad3f25b1c0b21d0f8431749ae7c 100755 (executable)
@@ -42,6 +42,8 @@
 \r
 #define SPRITE\r
 //#define TILERENDER\r
+#define SHOWFPS\r
+//#define OLDWALKSHOWPAGESTUFF\r
 \r
 #define PLAYERBMPDATAVAR       gvar.player[pn].data\r
 #define PLAYERBMPDATA          *PLAYERBMPDATAVAR\r
@@ -204,51 +206,6 @@ boolean ZC_walk2(entity_t *ent, map_view_t *map_v);
 // Move gvar.player around and call map scrolling if required/possible\r
 void walk_player(player_t *player, map_view_t *map_v);\r
 \r
-//check map edge\r
-inline boolean ZC_mapEdgeChk(map_view_t *map_v, nibble dir, boolean pansw)\r
-{\r
-       int     w,h;\r
-\r
-       switch (pansw)\r
-       {\r
-               case 0:\r
-                       w = map_v[0].map->width;\r
-                       h = map_v[0].map->height;\r
-               break;\r
-               case 1:\r
-                       w = map_v[0].page->ti.tilesw;\r
-                       h = map_v[0].page->ti.tilesh;\r
-               break;\r
-       }\r
-\r
-       switch(dir)\r
-       {\r
-               //no direction\r
-               default:\r
-               case 2:\r
-                       //0000pip[0].video->startclk = (*clockw);\r
-                       return false;\r
-               break;\r
-               //right movement\r
-               case 3:\r
-                       if(map_v[0].tx >= 0 && map_v[0].tx+map_v[0].page->ti.tw < w) return true;\r
-               break;\r
-               //left movement\r
-               case 1:\r
-                       if(map_v[0].tx > 0 && map_v[0].tx+map_v[0].page->ti.tw <= w) return true;\r
-               break;\r
-               //down movement\r
-               case 4:\r
-                       if(map_v[0].ty >= 0 && map_v[0].ty+map_v[0].page->ti.th < h) return true;\r
-               break;\r
-               //up movement\r
-               case 0:\r
-                       if(map_v[0].ty > 0 && map_v[0].ty+map_v[0].page->ti.th <= h) return true;\r
-               break;\r
-       }\r
-       return false;\r
-}\r
-\r
 // Scroll map in one direction (assumed from gvar.player's movement)\r
 void mapScroll(map_view_t *mv, player_t *player);\r
 \r
index bbfe552d10d7b8ddc0bff2c7a3dc1f12678e1d9c..2fd958694ae593fe83e6de65108d823f0ba19a55 100755 (executable)
@@ -26,7 +26,7 @@
 #include "src/lib/16_dbg.h"\r
 \r
 #define FADE\r
-#define NOMAPLOAD\r
+//#define NOMAPLOAD\r
 \r
 //map_view_t mv[4];\r
 static map_t map;\r
@@ -161,6 +161,7 @@ void main(int argc, char *argv[])
        {\r
                gvar.video.page[0].tlx=gvar.mv[0].tx*TILEWH;\r
                gvar.video.page[0].tly=gvar.mv[0].ty*TILEWH;\r
+               modexWaitBorder();\r
                shinku(&gvar);\r
                //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
                //to stop scrolling and have the gvar.player position data move to the edge of the screen with respect to the direction\r