]> 4ch.mooo.com Git - 16.git/commitdiff
==== MAJOR CHANGES ARE BEING MADE!! WWWW ====
authorsparky4 <sparky4@cock.li>
Fri, 13 Jan 2017 15:26:12 +0000 (09:26 -0600)
committersparky4 <sparky4@cock.li>
Fri, 13 Jan 2017 15:26:12 +0000 (09:26 -0600)
18 files changed:
DEBUG.16W [new file with mode: 0755]
HEAP.16W [new file with mode: 0755]
MMDUMP.16W [new file with mode: 0755]
src/0.c
src/inputest.c
src/lib/16_enti.h
src/lib/16_in.c
src/lib/16_in.h
src/lib/16_tdef.h
src/lib/doslib
src/lib/scroll16.c
src/lib/scroll16.h
src/lib/wcpu/16_wcpu.c
src/scroll.c
src/test.c
src/vrstest.c
src/zcroll.c
wcpu.exe

diff --git a/DEBUG.16W b/DEBUG.16W
new file mode 100755 (executable)
index 0000000..6bab6d1
--- /dev/null
+++ b/DEBUG.16W
@@ -0,0 +1,210 @@
+\e[0mSeg:0      Size:9962       Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0000\r
+\e[0m\e[0mSeg:27b3       Size:44 Owner:0x0\r
+\e[41;31m+\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:27df       Size:256        Owner:0x1954\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:28df       Size:256        Owner:0x1746\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:29df       Size:256        Owner:0x1748\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2adf       Size:256        Owner:0x174a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2bdf       Size:256        Owner:0x174c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2cdf       Size:256        Owner:0x174e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2ddf       Size:256        Owner:0x1750\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2edf       Size:256        Owner:0x1752\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2fdf       Size:256        Owner:0x1754\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:30df       Size:256        Owner:0x1756\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:31df       Size:256        Owner:0x1758\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:32df       Size:256        Owner:0x175a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:33df       Size:256        Owner:0x175c\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:34df       Size:256        Owner:0x175e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:35df       Size:256        Owner:0x1760\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:36df       Size:256        Owner:0x1762\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:37df       Size:256        Owner:0x1764\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:38df       Size:256        Owner:0x1766\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:39df       Size:256        Owner:0x1768\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3adf       Size:256        Owner:0x176a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3bdf       Size:256        Owner:0x176c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3cdf       Size:256        Owner:0x176e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3ddf       Size:256        Owner:0x1770\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3edf       Size:256        Owner:0x1772\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3fdf       Size:256        Owner:0x1774\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:40df       Size:256        Owner:0x1776\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:41df       Size:256        Owner:0x1778\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:42df       Size:256        Owner:0x177a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:43df       Size:256        Owner:0x177c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:44df       Size:256        Owner:0x177e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:45df       Size:256        Owner:0x1780\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:46df       Size:256        Owner:0x1782\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:47df       Size:256        Owner:0x1784\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:48df       Size:256        Owner:0x1786\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:49df       Size:256        Owner:0x1788\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4adf       Size:256        Owner:0x178a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4bdf       Size:256        Owner:0x178c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4cdf       Size:256        Owner:0x178e\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4ddf       Size:256        Owner:0x1790\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4edf       Size:256        Owner:0x1792\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4fdf       Size:256        Owner:0x1794\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:50df       Size:256        Owner:0x1796\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:51df       Size:256        Owner:0x1798\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:52df       Size:256        Owner:0x179a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:53df       Size:256        Owner:0x179c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:54df       Size:256        Owner:0x179e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:55df       Size:256        Owner:0x17a0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:56df       Size:256        Owner:0x17a2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:57df       Size:256        Owner:0x17a4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:58df       Size:256        Owner:0x17a6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:59df       Size:256        Owner:0x17a8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5adf       Size:256        Owner:0x17aa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5bdf       Size:256        Owner:0x17ac\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5cdf       Size:256        Owner:0x17ae\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5ddf       Size:256        Owner:0x17b0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5edf       Size:256        Owner:0x17b2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5fdf       Size:256        Owner:0x17b4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:60df       Size:256        Owner:0x17b6\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:61df       Size:256        Owner:0x17b8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:62df       Size:256        Owner:0x17ba\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:63df       Size:256        Owner:0x17bc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:64df       Size:256        Owner:0x17be\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:65df       Size:256        Owner:0x17c0\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:66df       Size:256        Owner:0x17c2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:67df       Size:256        Owner:0x17c4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:68df       Size:256        Owner:0x17c6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:69df       Size:256        Owner:0x17c8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6adf       Size:256        Owner:0x17ca\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6bdf       Size:256        Owner:0x17cc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6cdf       Size:256        Owner:0x17ce\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6ddf       Size:256        Owner:0x17d0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6edf       Size:256        Owner:0x17d2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6fdf       Size:256        Owner:0x17d4\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:70df       Size:256        Owner:0x17d6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:71df       Size:256        Owner:0x17d8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:72df       Size:256        Owner:0x17da\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:73df       Size:256        Owner:0x17dc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:74df       Size:256        Owner:0x17de\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:75df       Size:256        Owner:0x17e0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:76df       Size:256        Owner:0x17e2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:77df       Size:256        Owner:0x17e4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:78df       Size:256        Owner:0x17e6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:79df       Size:256        Owner:0x17e8\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7adf       Size:256        Owner:0x17ea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7bdf       Size:256        Owner:0x17ec\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7cdf       Size:256        Owner:0x17ee\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7ddf       Size:256        Owner:0x17f0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7edf       Size:256        Owner:0x17f2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7fdf       Size:256        Owner:0x17f4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:80df       Size:256        Owner:0x17f6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:81df       Size:256        Owner:0x17f8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:82df       Size:256        Owner:0x17fa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:83df       Size:256        Owner:0x17fc\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:84df       Size:256        Owner:0x17fe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:85df       Size:256        Owner:0x1800\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:86df       Size:256        Owner:0x1802\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:87df       Size:256        Owner:0x1804\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:88df       Size:256        Owner:0x1806\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:89df       Size:256        Owner:0x1808\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8adf       Size:256        Owner:0x180a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8bdf       Size:256        Owner:0x180c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8cdf       Size:401        Owner:0xef22\r
+\e[44;34m++++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:b7df       Size:18464      Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
diff --git a/HEAP.16W b/HEAP.16W
new file mode 100755 (executable)
index 0000000..c1fae01
--- /dev/null
+++ b/HEAP.16W
@@ -0,0 +1,69 @@
+\r
+       == default ==\r
+\r
+  USED block at 27d50016 of size 136\r
+  FREE block at 27d5009e of size 68\r
+  USED block at 27d500e2 of size 50\r
+  USED block at 27d50114 of size 50\r
+  USED block at 27d50146 of size 50\r
+  USED block at 27d50178 of size 50\r
+  USED block at 27d501aa of size 50\r
+  USED block at 27d501dc of size 50\r
+  USED block at 27d5020e of size 50\r
+  USED block at 27d50240 of size 50\r
+  USED block at 27d50272 of size 50\r
+  USED block at 27d502a4 of size 50\r
+  USED block at 27d502d6 of size 50\r
+  USED block at 27d50308 of size 50\r
+  FREE block at 27d5033a of size 14\r
+  USED block at 27d50348 of size 20\r
+  FREE block at 27d5035c of size 7328\r
+OK - end of heap\r
+\r
+       == near ==\r
+\r
+  USED block at 17d4ef66 of size 12\r
+  USED block at 17d4ef72 of size 330\r
+  USED block at 17d4f0bc of size 52\r
+  USED block at 17d4f0f0 of size 20\r
+  USED block at 17d4f104 of size 20\r
+  USED block at 17d4f118 of size 20\r
+  USED block at 17d4f12c of size 20\r
+  USED block at 17d4f140 of size 20\r
+  USED block at 17d4f154 of size 3752\r
+OK - end of heap\r
+\r
+       == far ==\r
+\r
+  USED block at 27d50016 of size 136\r
+  USED block at 27d5009e of size 68\r
+  USED block at 27d500e2 of size 50\r
+  USED block at 27d50114 of size 50\r
+  USED block at 27d50146 of size 50\r
+  USED block at 27d50178 of size 50\r
+  USED block at 27d501aa of size 50\r
+  USED block at 27d501dc of size 50\r
+  USED block at 27d5020e of size 50\r
+  USED block at 27d50240 of size 50\r
+  USED block at 27d50272 of size 50\r
+  USED block at 27d502a4 of size 50\r
+  USED block at 27d502d6 of size 50\r
+  USED block at 27d50308 of size 50\r
+  USED block at 27d5033a of size 14\r
+  USED block at 27d50348 of size 20\r
+  USED block at 27d5035c of size 7328\r
+OK - end of heap\r
+\r
+Memory Type         Total      Used       Free\r
+----------------  --------   --------   --------\r
+Default                   8166         756       7410\r
+Near              4246         494       3752\r
+Far               8166         756       7410\r
+----------------  --------   --------   --------\r
+coreleft = 3750\r
+farcoreleft = 35566\r
+GetFreeSize = 31836\r
+GetNearFreeSize = 3752\r
+GetFarFreeSize = 31836\r
+memavl = 3750\r
+stackavail = 31545\r
diff --git a/MMDUMP.16W b/MMDUMP.16W
new file mode 100755 (executable)
index 0000000..dabc7f6
Binary files /dev/null and b/MMDUMP.16W differ
diff --git a/src/0.c b/src/0.c
index f635289a00c1e363d742fa92f090534781a08af9..2eceb18a1579ad131f4add12562b68b7156e9794 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -141,7 +141,7 @@ int main(int argc,char **argv)
                                gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;\r
                                mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM;\r
                                modexShowPage(&(gvar.video.page[gvar.video.panp]));\r
-                               player[0].q = 1; player[0].d = 2;\r
+                               player[0].enti.q = 1; player[0].enti.d = 2;\r
                                x=y=0;\r
                                xdir=ydir=1;\r
                                //TESTBG;\r
index d020d58c4742112063af36a3e2fb338be2447e3f..07b3930696bd68a310dd005af2a543d63e3bb79c 100755 (executable)
@@ -41,10 +41,10 @@ main(int argc, char *argv[])
        IN_Default(0,&player,ctrl_Keyboard1);\r
        IN_SetControlType(0,&player,ctrl_Keyboard1);\r
 \r
-       player[0].q=1;\r
-       player[0].d=2;\r
-       player[0].persist_aniframe=0;\r
-       player[0].speed=4;\r
+       player[0].enti.q=1;\r
+       player[0].enti.d=2;\r
+       player[0].enti.persist_aniframe=0;\r
+       player[0].enti.speed=4;\r
 \r
 //0000 nibbletest();\r
 //0000 booleantest();\r
@@ -53,43 +53,43 @@ main(int argc, char *argv[])
        {\r
 //0000         shinkutxt(&gvar);\r
                IN_ReadControl(0, &player);\r
-               #define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1;\r
-               switch(player[0].d)\r
+               #define INC_PER_FRAME if(player[0].enti.q&1) player[0].enti.persist_aniframe++; if(player[0].enti.persist_aniframe>4) player[0].enti.persist_aniframe = 1;\r
+               switch(player[0].enti.d)\r
                {\r
                //right movement\r
                case 3:\r
-                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       if(player[0].enti.q<=(TILEWH/(player[0].enti.speed)))\r
                        {\r
                                INC_PER_FRAME;\r
-                               player[0].q++;\r
-                       } else { player[0].q = 1; player[0].d = 2; }\r
+                               player[0].enti.q++;\r
+                       } else { player[0].enti.q = 1; player[0].enti.d = 2; }\r
                break;\r
 \r
                //left movement\r
                case 1:\r
-                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       if(player[0].enti.q<=(TILEWH/(player[0].enti.speed)))\r
                        {\r
                                INC_PER_FRAME;\r
-                               player[0].q++;\r
-                       } else { player[0].q = 1; player[0].d = 2; }\r
+                               player[0].enti.q++;\r
+                       } else { player[0].enti.q = 1; player[0].enti.d = 2; }\r
                break;\r
 \r
                //down movement\r
                case 4:\r
-                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       if(player[0].enti.q<=(TILEWH/(player[0].enti.speed)))\r
                        {\r
                                INC_PER_FRAME;\r
-                               player[0].q++;\r
-                       } else { player[0].q = 1; player[0].d = 2; }\r
+                               player[0].enti.q++;\r
+                       } else { player[0].enti.q = 1; player[0].enti.d = 2; }\r
                break;\r
 \r
                //up movement\r
                case 0:\r
-                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       if(player[0].enti.q<=(TILEWH/(player[0].enti.speed)))\r
                        {\r
                                INC_PER_FRAME;\r
-                               player[0].q++;\r
-                       } else { player[0].q = 1; player[0].d = 2; }\r
+                               player[0].enti.q++;\r
+                       } else { player[0].enti.q = 1; player[0].enti.d = 2; }\r
                break;\r
        }\r
                //printf("%u\n", IN_KeyDown(sc_Escape));\r
index 17ee10fae9a000436b6387d6b0f58132ed6472d5..4e92d99027566635f4c536769144e70d44721dc4 100755 (executable)
@@ -5,21 +5,21 @@
 #include "src/lib/16_head.h"
 #include "src/lib/16_in.h"
 
-
-typedef        struct
-{
-       int x; // exact position on the viewable map
-       int y; // exact position on the viewable map
-       int tx; // tile position on the viewable map
-       int ty; // tile position on the viewable map
-       int triggerx; // trigger box tile position on the viewable map
-       int triggery; // trigger box tile position on the viewable map
-       byte d;         // direction the NPC faces
-       struct sprite *spri; // sprite used by NPC
-       sword hp; // hitpoints of the NPC
-       byte near pdir; // previous direction~
-       word speed;             // NPC's speed
-       word spt;               // speed per tile
-} entity_t;
+//moved to 16_tdef.h
+// typedef     struct
+// {
+//     int x; // exact position on the viewable map
+//     int y; // exact position on the viewable map
+//     int tx; // tile position on the viewable map
+//     int ty; // tile position on the viewable map
+//     int triggerx; // trigger box tile position on the viewable map
+//     int triggery; // trigger box tile position on the viewable map
+//     byte d;         // direction the NPC faces
+//     struct sprite *spri; // sprite used by NPC
+//     sword hp; // hitpoints of the NPC
+//     byte near pdir; // previous direction~
+//     word speed;             // NPC's speed
+//     word spt;               // speed per tile
+// } entity_t;
 
 #endif
index 314ddbfd2318fc15ed845e2f22bb94902e78dfef..2e54a6270f55ac21b4cee79920ef3f8d6681a08a 100755 (executable)
@@ -703,7 +703,7 @@ IN_Default(boolean gotit,player_t *player,ControlType nt)
        //in.KbdDefs[0].downright = 0x51;\r
        IN_SetControlType(0,player,nt);\r
        for(i=0; i>MaxPlayers;i++)\r
-               player[i].d=2;\r
+               player[i].enti.d =2;\r
 }\r
 \r
 ///////////////////////////////////////////////////////////////////////////\r
@@ -814,7 +814,7 @@ IN_ReadCursor(CursorInfo *info)
 //\r
 ///////////////////////////////////////////////////////////////////////////\r
 void near\r
-IN_ReadControl(int pn,player_t *player)\r
+IN_ReadControl(word pn, player_t *player)\r
 {\r
                        boolean         realdelta;\r
 #if DEMO0\r
@@ -949,10 +949,10 @@ register  KeyboardDef     *def;
        player[pn].info.dir = DirTable[conpee];\r
 \r
        if(DirTable[conpee]!=2) player[pn].pdir=DirTable[conpee];\r
-       if(player[pn].q==1 &&( dir!=2 || (mx!=motion_None || my!=motion_None)))\r
+       if(player[pn].enti.q==1 &&( dir!=2 || (mx!=motion_None || my!=motion_None)))\r
        {\r
-               if(dir==2) player[pn].d = player[pn].info.dir;\r
-               else player[pn].d = DirTable[dir];\r
+               if(dir==2) player[pn].enti.d = player[pn].info.dir;\r
+               else player[pn].enti.d = DirTable[dir];\r
        }\r
 \r
 #if DEMO0\r
@@ -982,12 +982,12 @@ register  KeyboardDef     *def;
 #endif\r
 #ifdef __DEBUG_InputMgr__\r
 if(dbg_testcontrolnoisy > 0)\r
-if(player[pn].info.dir!=2/*(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])*/ || player[pn].q>1)\r
+if(player[pn].info.dir!=2/*(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])*/ || player[pn].enti.q>1)\r
 {\r
        //printf("b1=%u b2=%u b3=%u b4=%u       ", player[pn].info.button0, player[pn].info.button1, player[pn].info.button2, player[pn].info.button3);\r
-       //printf("q=%d ", player[pn].q);\r
+       //printf("q=%d ", player[pn].enti.q);\r
        //printf("cpee=%c ", dirchar(conpee));\r
-       printf("pdir=%c d=%c dir=%c ", dirchar(player[pn].pdir), dirchar(player[pn].d), dirchar(player[pn].info.dir));\r
+       printf("pdir=%c d=%c dir=%c ", dirchar(player[pn].pdir), dirchar(player[pn].enti.d), dirchar(player[pn].info.dir));\r
        /*if(realdelta) */printf("dx=%d dy=%d   mx=%d   my=%d", player[pn].info.x, player[pn].info.y, player[pn].info.xaxis, player[pn].info.yaxis);\r
        //else if(!realdelta) printf("%c%d %c%d %c%d %c%d", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);\r
        printf("\n");\r
@@ -1279,18 +1279,18 @@ boolean IN_qb(byte kee)
 //init player!\r
 void IN_initplayer(player_t *player, word pn)\r
 {\r
-       player[pn].x = player[pn].tx*TILEWH;\r
-       player[pn].y = player[pn].ty*TILEWH;\r
-       player[pn].triggerx = player[pn].tx;\r
-       player[pn].triggery = player[pn].ty+1;\r
+       player[pn].enti.x = player[pn].enti.tx*TILEWH;\r
+       player[pn].enti.y = player[pn].enti.ty*TILEWH;\r
+       player[pn].enti.triggerx = player[pn].enti.tx;\r
+       player[pn].enti.triggery = player[pn].enti.ty+1;\r
 /*     player[0].info.x = player[0].tx;\r
        player[0].info.xaxis = player[0].tx*TILEWH;\r
        player[0].info.y = player[0].ty;\r
        player[0].info.yaxis = player[0].ty*TILEWH;*/\r
-       player[pn].q=1;\r
-       player[pn].d=2;\r
-       player[pn].hp=4;\r
-       player[pn].speed=4;\r
-       player[pn].persist_aniframe=0;\r
-       player[pn].spt=(TILEWH/(player[pn].speed));     //speed per tile wwww\r
+       player[pn].enti.q =1;\r
+       player[pn].enti.d =2;\r
+       player[pn].enti.hp=4;\r
+       player[pn].enti.speed=4;\r
+       player[pn].enti.persist_aniframe=0;\r
+       player[pn].enti.spt=(TILEWH/(player[pn].enti.speed));   //speed per tile wwww\r
 }\r
index 5e23274d1e405f00497bdf37f17fb40bb7a0c732..f03b337d61970f27fa262916201e969ca90b7216 100755 (executable)
@@ -56,7 +56,7 @@
 #define        MaxPads         2\r
 #define        NumCodes        128\r
 \r
-typedef        byte            ScanCode;\r
+//typedef      byte            ScanCode;\r
 #define        sc_None                 0\r
 #define        sc_Bad                  0xff\r
 #define        sc_Return               0x1c\r
@@ -155,7 +155,8 @@ typedef     enum            {
                                                demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
                                        } Demo;\r
 #endif\r
-typedef        enum            {\r
+//moved to 16_tdef.h\r
+/*typedef      enum            {\r
                                                //ctrl_None,                            // MDM (GAMERS EDGE) - added\r
                                                ctrl_Keyboard,\r
                                                        ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,\r
@@ -216,12 +217,8 @@ typedef    struct
        byte d;         //direction to render sprite!! wwww\r
        byte q;         //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
        byte near pdir; //previous direction~\r
-       //byte near kd[2];      //array of arrow key pressed\r
        word speed;             //player speed!\r
        word spt;               //speed per tile\r
-//0000 planar_buf_t huge *data; //supposively the sprite sheet data\r
-//     planar_buf_t data; //supposively the sprite sheet data\r
-////0000----\r
 #ifdef __WATCOMC__\r
        struct sprite   *spri;  //supposively the sprite sheet data\r
        memptr          gr;\r
@@ -230,12 +227,12 @@ typedef   struct
        bitmap_t        *data;          //supposively the sprite sheet data//old format\r
        bitmap_t        bmp;\r
        sword hp; //hitpoints of the player\r
-       int persist_aniframe;    /* gonna be increased to 1 before being used, so 0 is ok for default */\r
+       int persist_aniframe;    // gonna be increased to 1 before being used, so 0 is ok for default\r
        CursorInfo      info;\r
        ControlType     Controls;\r
 //newer vars\r
        int dx, dy, delta;      //TODO: what is this? ^^\r
-} player_t;\r
+} player_t;*/\r
 \r
 /*\r
 =============================================================================\r
@@ -287,7 +284,7 @@ extern void IN_SetKeyHook(void (*hook)());
 extern void IN_ClearKeysDown();\r
 //static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);\r
 extern void IN_ReadCursor(CursorInfo *info);\r
-extern void near IN_ReadControl(int pn,player_t *player);\r
+extern void near IN_ReadControl(word pn, player_t *player);\r
 extern void IN_SetControlType(word pn,player_t *player,ControlType type);\r
 #if DEMO0\r
 extern boolean IN_StartDemoRecord(word bufsize);\r
index 00ce03a3382804fad477f30645a4193ce665d792..5936022d63140f2aed5b159d062c67857689d4b3 100755 (executable)
@@ -89,7 +89,7 @@ typedef struct {
        char            name[16];\r
 } map_t;\r
 \r
-// tile info\r
+//TODO USE THIS tile info\r
 typedef struct{\r
        word tw;                /* screen width in tiles */\r
        word th;                /* screen height in tiles */\r
@@ -126,6 +126,26 @@ typedef struct {
        sword delta;                    // How much should we shift the page for smooth scrolling\r
 } page_t;\r
 \r
+//new structs\r
+typedef        struct\r
+{\r
+       int x; //entity exact position on the viewable map\r
+       int y; //entity exact position on the viewable map\r
+       int tx; //entity tile position on the viewable map\r
+       int ty; //entity tile position on the viewable map\r
+       int triggerx; //entity's trigger box tile position on the viewable map\r
+       int triggery; //entity's trigger box tile position on the viewable map\r
+       int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x\r
+       int sheetsety; //NOT USED YET! entity sprite sheet set on the image y\r
+       byte d;         //direction to render sprite!! wwww\r
+       byte q;         //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
+       word speed;             //entity speed!\r
+       word spt;               //speed per tile\r
+       struct sprite *spri; // sprite used by entity\r
+       sword hp; //hitpoints of the entity\r
+       int persist_aniframe;    /* gonna be increased to 1 before being used, so 0 is ok for default */\r
+} entity_t;\r
+\r
 //TODO: MAKE THIS WWWW\r
 typedef struct\r
 {\r
@@ -140,6 +160,81 @@ typedef struct
        spri_t *spri;\r
 } vrs_t;\r
 \r
+//from 16_in\r
+//==========================================================================\r
+typedef        byte            ScanCode;\r
+\r
+typedef        enum            {\r
+                                               //ctrl_None,                            // MDM (GAMERS EDGE) - added\r
+                                               ctrl_Keyboard,\r
+                                                       ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,\r
+                                               ctrl_Joystick,\r
+                                                       ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,\r
+                                               ctrl_Mouse,\r
+                                       } ControlType;\r
+typedef        enum            {\r
+                                               motion_Left = -1,motion_Up = -1,\r
+                                               motion_None = 0,\r
+                                               motion_Right = 1,motion_Down = 1\r
+                                       } Motion;\r
+typedef        enum            {\r
+                                               dir_North,//dir_NorthEast,\r
+                                               dir_West,//dir_Nortinest,\r
+                                               dir_None,\r
+                                               dir_East,//,dir_SouthEast,\r
+                                               dir_South,//dir_Soutinest,\r
+                                       } Direction;\r
+typedef        struct          {\r
+                                               boolean near    button0,button1,button2,button3;\r
+                                               int     near            x,y;\r
+                                               Motion  near    xaxis,yaxis;\r
+                                               Direction near  dir;\r
+                                       } CursorInfo;\r
+\r
+typedef        struct          {\r
+                                               ScanCode near   button0,button1,\r
+                                                                       //upleft,\r
+                                                                       up,\r
+                                                                       down,\r
+                                                                       left,\r
+                                                                       right\r
+                                                                       //upright,\r
+                                                                       //downleft,\r
+                                                                       //,downright\r
+                                                                       ;\r
+                                       } KeyboardDef;\r
+typedef        struct          {\r
+                                               word    near    joyMinX,joyMinY,\r
+                                                                       threshMinX,threshMinY,\r
+                                                                       threshMaxX,threshMaxY,\r
+                                                                       joyMaxX,joyMaxY,\r
+                                                                       joyMultXL,joyMultYL,\r
+                                                                       joyMultXH,joyMultYH;\r
+                                       } JoystickDef;\r
+\r
+//==========================================================================\r
+\r
+typedef        struct\r
+{\r
+       entity_t near   enti;\r
+       entity_t *ent;\r
+#ifdef __WATCOMC__\r
+       //struct sprite *spri;  //supposively the sprite sheet data\r
+       memptr          gr;\r
+#endif\r
+       bitmap_t        *data;          //supposively the sprite sheet data//old format\r
+       bitmap_t        bmp;\r
+\r
+       //input\r
+       byte near               pdir;   //previous direction~ used in IN_16 in IN_ReadControl()\r
+       CursorInfo              info;\r
+       ControlType     Controls;\r
+//newer vars\r
+       int dx, dy, delta;      //TODO: what is this? ^^\r
+} player_t;\r
+\r
+//===========================================//\r
+\r
 typedef struct\r
 {\r
        int profilehandle,debughandle,showmemhandle;\r
index dc29677c473373bf29d2c349db6aebcff24b973a..b68c362763ae81c36e275dc8b962558b28d46241 160000 (submodule)
@@ -1 +1 @@
-Subproject commit dc29677c473373bf29d2c349db6aebcff24b973a
+Subproject commit b68c362763ae81c36e275dc8b962558b28d46241
index cab3823fcd33b682d30cd47195a6afe6a08d20dd..51d8137d1d9e55ca8ef43d1ceeb03bea2cd2ced7 100755 (executable)
 */\r
 #include "src/lib/scroll16.h"\r
 \r
-void walk(map_view_t *pip, player_t *player, word pn)\r
+void oldwalk(map_view_t *pip, player_t *player, word pn)\r
 {\r
-       #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
-       //printf("player[%d].d=%d\n", pn, player[pn].d);\r
-       switch(player[pn].d)\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
+       //printf("player[%d].d=%d\n", pn, player[pn].enti.d);\r
+       switch(player[pn].enti.d)\r
        {\r
                //no direction\r
                case 2:\r
@@ -37,10 +37,10 @@ void walk(map_view_t *pip, player_t *player, word pn)
                //right movement\r
                case 3:\r
                        //printf("pip[0].page->tilesw=%d        ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);\r
-                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))      //collision detection!\r
+                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -49,42 +49,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollRight(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollRight(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x+=(player[pn].speed);\r
+                                       player[pn].enti.x+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
                        else\r
                        {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx+1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
 \r
                //left movement\r
                case 1:\r
-                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))    //collision detection!\r
+                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -93,42 +93,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollLeft(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x-=(player[pn].speed);\r
+                                       player[pn].enti.x-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
                        else\r
                        {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx-1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
 \r
                //down movement\r
                case 4:\r
-                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))      //collision detection!\r
+                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -137,42 +137,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollDown(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollDown(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y+=(player[pn].speed);\r
+                                       player[pn].enti.y+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
                        else\r
                        {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty+1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty+1;\r
                break;\r
 \r
                //up movement\r
                case 0:\r
-                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY))    //collision detection!\r
+                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -181,34 +181,34 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollUp(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollUp(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX &&  player[pn].ty-1 == TRIGGY))\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y-=(player[pn].speed);\r
+                                       player[pn].enti.y-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, 0, pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
                        else\r
                        {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty-1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
                break;\r
        }\r
 }\r
@@ -225,8 +225,8 @@ src/lib/scroll16.c: mv->video->r=1;
 \r
 void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
 {\r
-       #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
-       switch(player[pn].d)\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
+       switch(player[pn].enti.d)\r
        {\r
                //no direction\r
                case 2:\r
@@ -234,155 +234,155 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                break;\r
                //right movement\r
                case 3:\r
-                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))      //collision detection!\r
+                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollRight(pip, player, 3, pn);\r
                                        ScrollRight(pip, player, 2, pn);\r
                                        mapScrollRight(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x+=(player[pn].speed);\r
+                                       player[pn].enti.x+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx+1;\r
-                       player[pn].triggery = player[pn].ty;\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(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))    //collision detection!\r
+                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollLeft(pip, player, 3, pn);\r
                                        ScrollLeft(pip, player, 2, pn);\r
                                        mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x-=(player[pn].speed);\r
+                                       player[pn].enti.x-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx-1;\r
-                       player[pn].triggery = player[pn].ty;\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(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))      //collision detection!\r
+                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollDown(pip, player, 3, pn);\r
                                        ScrollDown(pip, player, 2, pn);\r
                                        mapScrollDown(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y+=(player[pn].speed);\r
+                                       player[pn].enti.y+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty+1;\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(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY))    //collision detection!\r
+                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollUp(pip, player, 3, pn);\r
                                        ScrollUp(pip, player, 2, pn);\r
                                        mapScrollUp(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX &&  player[pn].ty-1 == TRIGGY))\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->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
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y-=(player[pn].speed);\r
+                                       player[pn].enti.y-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, 0, pn);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty-1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
                break;\r
        }\r
 }\r
@@ -391,18 +391,18 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
 {\r
 #define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);\r
-       switch(player[pn].d)\r
+       switch(player[pn].enti.d)\r
        {\r
                //right movement\r
                case 3:\r
                        if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].page->tilesw)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dx+=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx++; }\r
                        }\r
                break;\r
 \r
@@ -410,12 +410,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 1:\r
                        if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].page->tilesw)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dx-=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx--; }\r
                        }\r
                break;\r
 \r
@@ -423,12 +423,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 4:\r
                        if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].page->tilesh)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dy+=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty++; }\r
                        }\r
                break;\r
 \r
@@ -436,12 +436,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 0:\r
                        if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].page->tilesh)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dy-=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty--; }\r
                        }\r
                break;\r
        }\r
@@ -614,7 +614,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        word x;//, y;  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dx += player[plid].speed;\r
+       mv[id].page[0].dx += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dx >= mv[id].dxThresh )\r
@@ -629,7 +629,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[id].map->tiles->tileWidth;\r
-       if(player[plid].q%4)\r
+       if(player[plid].enti.q%4)\r
                if(id==0)\r
                        mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page[0].dx);\r
                else\r
@@ -644,7 +644,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
        word x;//,y;  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dx -= player[plid].speed;\r
+       mv[id].page[0].dx -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dx == 0)\r
@@ -659,7 +659,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(player[plid].q%4)\r
+       if(player[plid].enti.q%4)\r
                if(id==0)\r
                        mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page[0].dx);\r
                else\r
@@ -674,7 +674,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dy -= player[plid].speed;\r
+       mv[id].page[0].dy -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dy == 0 )\r
@@ -689,7 +689,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(player[plid].q%3)\r
+       if(player[plid].enti.q%3)\r
                if(id==0)\r
                        mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page[0].dy);\r
                else\r
@@ -703,7 +703,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dy += player[plid].speed;\r
+       mv[id].page[0].dy += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dy >= mv[id].dyThresh )\r
@@ -718,7 +718,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[id].map->tiles->tileHeight;\r
-       if(player[plid].q%3)\r
+       if(player[plid].enti.q%3)\r
                if(id==0)\r
                        mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page[0].dy);\r
                else\r
@@ -732,7 +732,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* increment the pixel position and update the page */\r
-       mv[id].page->dx += player[plid].speed;\r
+       mv[id].page->dx += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dx >= mv[0].dxThresh )\r
@@ -749,7 +749,7 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* decrement the pixel position and update the page */\r
-       mv[id].page->dx -= player[plid].speed;\r
+       mv[id].page->dx -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dx == 0)\r
@@ -766,7 +766,7 @@ void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* decrement the pixel position and update the page */\r
-       mv[id].page->dy -= player[plid].speed;\r
+       mv[id].page->dy -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dy == 0)\r
@@ -783,7 +783,7 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* increment the pixel position and update the page */\r
-       mv[id].page->dy += player[plid].speed;\r
+       mv[id].page->dy += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dy >= mv[0].dxThresh )\r
@@ -802,8 +802,8 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 //default player position on the viewable map\r
 void playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn)\r
 {\r
-       player[pn].tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
-       player[pn].ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
+       player[pn].enti.tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
+       player[pn].enti.ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
 }\r
 //===========================================================================\r
 \r
@@ -948,11 +948,11 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
        }\r
 }\r
 \r
-void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset)\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset)\r
 {\r
        word x;\r
        int i;\r
-       poopoffset%=p[0].speed;\r
+       poopoffset%=player[0].enti.speed;\r
 //printf("y: %d\n", poopoffset);\r
        /* the position within the map array */\r
        i=ty * mv->map->width + tx;\r
@@ -965,11 +965,11 @@ void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word p
        }\r
 }\r
 \r
-void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset)\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
 {\r
        int y;\r
        int i;\r
-       poopoffset%=p[0].speed;\r
+       poopoffset%=player[0].enti.speed;\r
 //printf("x: %d\n", poopoffset);\r
        /* location in the map array */\r
        i=ty * mv->map->width + tx;\r
@@ -1095,15 +1095,27 @@ void shinku(global_game_variables_t *gv)
        }\r
 }\r
 \r
+#ifdef SPRITE\r
+#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32,    PLAYERBMPDATAPTR);\r
+#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#else\r
+#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
+#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
+#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#endif\r
+\r
 void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
 {\r
-       sword x = player[pn].x;\r
-       sword y = player[pn].y;\r
+       sword x = player[pn].enti.x;\r
+       sword y = player[pn].enti.y;\r
        sword bx = x+16;        //buffer's x\r
        sword by = y+16;        //buffer's y\r
        word dire=32; //direction\r
        sword qq; //scroll offset\r
-       word ls = player[pn].persist_aniframe;\r
+       word ls = player[pn].enti.persist_aniframe;\r
 \r
        switch(scrollswitch)\r
        {\r
@@ -1111,22 +1123,22 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
                        qq = 0;\r
                break;\r
                default:\r
-                       qq = ((player[pn].q)*(player[pn].speed));\r
+                       qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
                break;\r
        }\r
        //x-=4;\r
        y-=pip[0].map->tiles->tileHeight;\r
-       switch (player[pn].d)\r
+       switch (player[pn].enti.d)\r
        {\r
                case 0:\r
                        //up\r
-                       dire*=player[pn].d;\r
+                       dire*=player[pn].enti.d;\r
                        y-=qq;\r
                        by-=4;\r
                break;\r
                case 3:\r
                        // right\r
-                       dire*=(player[pn].d-2);\r
+                       dire*=(player[pn].enti.d-2);\r
                        x+=qq;\r
                        bx+=4;\r
                break;\r
@@ -1134,29 +1146,106 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
                break;\r
                case 4:\r
                        //down\r
-                       dire*=(player[pn].d-2);\r
+                       dire*=(player[pn].enti.d-2);\r
                        y+=qq;\r
                        by+=4;\r
                break;\r
                case 1:\r
                        //left\r
-                       dire*=(player[pn].d+2);\r
+                       dire*=(player[pn].enti.d+2);\r
+                       x-=qq;\r
+                       bx-=4;\r
+               break;\r
+       }\r
+\r
+       if(!pageflipflop)\r
+               modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
+       else{\r
+               //copy old bg to page0\r
+               //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0,   20, 36);\r
+               //update buffer\r
+               //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0,   x, y,   20, 36);\r
+       }\r
+//modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height);\r
+       //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36);\r
+       /*modexCopyPageRegion(pip[pip->video->p].page,\r
+ pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/\r
+//     else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40);\r
+       switch(ls)\r
+       {\r
+               case 1:\r
+                       FRAME1\r
+               break;\r
+               case 2:\r
+                       FRAME2\r
+               break;\r
+               case 3:\r
+                       FRAME3\r
+               break;\r
+               case 4:\r
+                       FRAME4\r
+               break;\r
+       }\r
+//     if(2>ls && ls>=1) { FRAME1 }else\r
+//     if(3>ls && ls>=2) { FRAME2 }else\r
+//     if(4>ls && ls>=3) { FRAME3 }else\r
+//     if(5>ls && ls>=4) { FRAME4 }\r
+       //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32);\r
+       //printf("x=%d  y=%d    bx=%d           by=%d\n", x, y, bx, by);\r
+       pip->video->r=1;\r
+}\r
+\r
+void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
+{\r
+       sword x = player[pn].enti.x;\r
+       sword y = player[pn].enti.y;\r
+       sword bx = x+16;        //buffer's x\r
+       sword by = y+16;        //buffer's y\r
+       word dire=32; //direction\r
+       sword qq; //scroll offset\r
+       word ls = player[pn].enti.persist_aniframe;\r
+\r
+       switch(scrollswitch)\r
+       {\r
+               case 0:\r
+                       qq = 0;\r
+               break;\r
+               default:\r
+                       qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
+               break;\r
+       }\r
+       //x-=4;\r
+       y-=pip[0].map->tiles->tileHeight;\r
+       switch (player[pn].enti.d)\r
+       {\r
+               case 0:\r
+                       //up\r
+                       dire*=player[pn].enti.d;\r
+                       y-=qq;\r
+                       by-=4;\r
+               break;\r
+               case 3:\r
+                       // right\r
+                       dire*=(player[pn].enti.d-2);\r
+                       x+=qq;\r
+                       bx+=4;\r
+               break;\r
+               case 2:\r
+               break;\r
+               case 4:\r
+                       //down\r
+                       dire*=(player[pn].enti.d-2);\r
+                       y+=qq;\r
+                       by+=4;\r
+               break;\r
+               case 1:\r
+                       //left\r
+                       dire*=(player[pn].enti.d+2);\r
                        x-=qq;\r
                        bx-=4;\r
                break;\r
        }\r
 \r
-#ifdef SPRITE\r
-#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32,    PLAYERBMPDATAPTR);\r
-#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#else\r
-#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
-#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
-#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#endif\r
        if(!pageflipflop)\r
                modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
        else{\r
@@ -1243,7 +1332,7 @@ boolean ZC_walk2(entity_t *ent, map_view_t *map_v)
 \r
 void player_walk(player_t *player, map_view_t *map_v){\r
        int dx=16, dy=16;\r
-       if(ZC_walk2(player->ent, map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
+       if(ZC_walk2(&(player->enti), map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
        {\r
                mapScroll(map_v, player);\r
                // (Un)load stuff?\r
index 8feb3f48019369282f837ae46768edec5dd90b55..697018758d9eaa388ee316e88d6ee4a4171b3280 100755 (executable)
@@ -87,8 +87,8 @@ typedef struct {
 #define MAPW   40\r
 #define MAPH   30\r
 \r
-       //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8);\r
-       //else printf("\nplayer[0].y: %d\n", player[0].y);\r
+       //if(player[0].enti.hp==0) printf("%d wwww\n", player[0].enti.y+8);\r
+       //else printf("\nplayer[0].enti.y: %d\n", player[0].enti.y);\r
 //     printf("palette offset: %d\n", paloffset/3);\r
 //++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize());\r
 //++++ printf("Total free: %zu\n", GetFreeSize());\r
@@ -102,13 +102,13 @@ typedef struct {
        printf("ty: %d\n", mv[0].ty);\\r
        printf("\n");\\r
        printf("player vars:\n");\\r
-       printf("        x: %d", player[0].x); printf("  y: %d\n", player[0].y);\\r
+       printf("        x: %d", player[0].enti.x); printf("     y: %d\n", player[0].enti.y);\\r
        \\r
-       printf("        tx: %d", player[0].tx); printf("        ty: %d\n", player[0].ty);\\r
-       printf("        triggx: %d", player[0].triggerx); printf("      triggy: %d\n", player[0].triggery);\\r
-       printf("        hp: %d", (player[0].hp));       printf("        q: %d", player[0].q);   printf("        player.info.dir: %d", player[0].info.dir);      printf("        player.d: %d ", player[0].d);\\r
+       printf("        tx: %d", player[0].enti.tx); printf("   ty: %d\n", player[0].enti.ty);\\r
+       printf("        triggx: %d", player[0].enti.triggerx); printf(" triggy: %d\n", player[0].enti.triggery);\\r
+       printf("        hp: %d", (player[0].enti.hp));  printf("        q: %d", player[0].enti.q);      printf("        player.info.dir: %d", player[0].info.dir);      printf("        player.d: %d ", player[0].enti.d);\\r
                printf("        pdir=%d\n", player[0].pdir);\\r
-       printf("        tile data value at player trigger position: %d\n\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]);\\r
+       printf("        tile data value at player trigger position: %d\n\n", mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\\r
 \\r
        printf("Virtual Screen: %dx", gvar.video.page[0].width);        printf("%d      ", gvar.video.page[0].height);\\r
        printf("Screen: %dx", gvar.video.page[0].sw);   printf("%d\n", gvar.video.page[0].sh);\\r
@@ -155,13 +155,14 @@ sword chkmap(map_t *map, word q);
 void mapGoTo(map_view_t *mv, int tx, int ty);\r
 void mapinitmapview(map_view_t *mv, int tx, int ty);\r
 void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);\r
-void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset);\r
-void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset);\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset);\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset);\r
 void mapDrawWRow(map_view_t *mv, int tx, int ty, word y);\r
 void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);\r
 //void qclean();\r
 void shinku(global_game_variables_t *gv);\r
-void near animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scrollswitch);\r
+void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
+void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
 \r
 // Move an entity around. Should actually be in 16_entity\r
 boolean ZC_walk2(entity_t *ent, map_view_t *map_v);\r
index 41de0e12e1dc4a6f1d3763d74c2e36336fb2e460..b6dfa8c38c80dde3e6cf7f5b104220011e766d46 100755 (executable)
@@ -131,9 +131,9 @@ const char *WCPU_cpudetectmesg()
        cput = WCPU_detectcpu();\r
        switch(cput)\r
        {\r
-               case 0: cpus = "8086/8088 or 186/88"; break;\r
-               case 1: cpus = "286"; break;\r
-               case 2: cpus = "386 or newer"; break;\r
+               case 0: cpus = "8086/8088 or 80186/80188"; break;\r
+               case 1: cpus = "80286"; break;\r
+               case 2: cpus = "80386 or newer"; break;\r
                default: cpus = "internal error"; break;\r
        }\r
        return cpus;\r
@@ -141,14 +141,23 @@ const char *WCPU_cpudetectmesg()
 \r
 const char *WCPU_fpudetectmesg()\r
 {\r
-       const char *fpus;\r
+       char *fpus;\r
        unsigned char fput;\r
+       word cput;\r
 \r
        fput = WCPU_detectfpu();\r
+       cput = WCPU_detectcpu();\r
+       switch(cput)\r
+       {\r
+               case 0: cput=80; break;\r
+               case 1: cput=802; break;\r
+               case 2: cput=803; break;\r
+               default: cput=0; break;\r
+       }\r
        switch(fput)\r
        {\r
                case 0: fpus = "none"; break;\r
-               case 1: fpus = "8087"; break;\r
+               case 1: sprintf(fpus, "%d87", cput); break;\r
                default: fpus = "internal error"; break;\r
        }\r
        return fpus;\r
index cfb6ab2e36ea0e68ff231a68a2e2e479a7f55f9a..3b31774517a9008f55274453382df36037b0f39d 100755 (executable)
@@ -121,9 +121,9 @@ void main(int argc, char *argv[])
        IN_initplayer(&player, 0);\r
 \r
 #ifndef        SPRITE\r
-       modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);\r
+       modexClearRegion(mv[0].page, player[0].enti.x, player[0].enti.y-TILEWH, 16, 32, 15);\r
 #else\r
-       modexDrawSpriteRegion(&gvar.video.page[0], player[0].x, player[0].y-TILEWH, 16, 64, 16, 32,     PCXBMPPTR);\r
+       modexDrawSpriteRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y-TILEWH, 16, 64, 16, 32,   PCXBMPPTR);\r
 #endif\r
 \r
        if(!pageflipflop)       VL_ShowPage(mv[1].page, 0, 0);//modexShowPage(mv[1].page);\r
@@ -150,12 +150,12 @@ void main(int argc, char *argv[])
        modexFadeOn(4, gpal);\r
 #endif\r
 #endif\r
-       while(!IN_KeyDown(sc_Escape) && player[0].hp>0)\r
+       while(!IN_KeyDown(sc_Escape) && player[0].enti.hp>0)\r
        {\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 player position data move to the edge of the screen with respect to the direction\r
-       //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\r
+       //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\r
 \r
        //player movement\r
                IN_ReadControl(0, &player);\r
@@ -163,12 +163,12 @@ void main(int argc, char *argv[])
                ZC_walk(&mv, &player, 0);\r
        }else{\r
                PANKEYFUN;//panPageManual(&mv, &player, 0);\r
-               //printf("      player[0].q: %d", player[0].q); printf("        player[0].d: %d\n", player[0].d);\r
+               //printf("      player[0].enti.q: %d", player[0].enti.q);       printf("        player[0].d: %d\n", player[0].d);\r
        }\r
 \r
        //the scripting stuff....\r
-       //if(((player[0].triggerx == TRIGGX && player[0].triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))\r
-       if(((mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))\r
+       //if(((player[0].enti.triggerx == TRIGGX && player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
+       if(((mv[0].map->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))\r
        {\r
                short i;\r
                for(i=800; i>=400; i--)\r
@@ -177,7 +177,7 @@ void main(int argc, char *argv[])
                }\r
                nosound();\r
        }\r
-       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--; }\r
+       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--; }\r
        //debugging binds!\r
 #ifdef MODEX\r
 #ifdef FADE\r
@@ -234,7 +234,7 @@ void main(int argc, char *argv[])
 #endif\r
                if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r\r
 \r
-       if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break;        //incase things go out of sync!\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!\r
        }\r
 \r
        /* fade back to text mode */\r
index 49d716020c3560ecffe535216b8243d561f0ebbf..b85e785945ac1a10f3c3bf44c5f517d0f82f3a90 100755 (executable)
@@ -73,7 +73,6 @@ void main(int argc, char *argv[])
        _DEBUG("Serial debug output started\n"); // NTS: All serial output must end messages with newline, or DOSBox-X will not emit text to log\r
        _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);*/\r
        Startup16(&gvar);\r
-       PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite\r
 \r
        /* save the palette */\r
        //====pal  = modexNewPal();\r
@@ -203,7 +202,7 @@ void main(int argc, char *argv[])
        printf("Project 16 test.exe. This is just a test file!\n");\r
        printf("version %s\n", VERSION);\r
        modexprintmeminfo(&gvar.video);\r
-       printf("tx=%d   ", mv[gvar.video.panp].tx); printf("ty=%d       ", mv[gvar.video.panp].ty); printf("player.d=%d\n", player[0].d);\r
+       printf("tx=%d   ", mv[gvar.video.panp].tx); printf("ty=%d       ", mv[gvar.video.panp].ty); printf("player.d=%d\n", player[0].enti.d);\r
        //IN_Shutdown();\r
        //====modexPalBlack();\r
        //====modexFadeOn(1, pal);\r
index bd3e1da10e49f0b60a3943c5ab287c6b53094e15..b5642de0c71065b7a421cf4a4d0260ce153ae643 100755 (executable)
@@ -31,6 +31,7 @@
 extern boolean dbg_notest;\r
 \r
 static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+static byte palette[768];\r
 \r
 void main()\r
 {\r
@@ -58,8 +59,7 @@ void main()
        Startup16(&gvar);\r
 \r
        // What should be done by read_vrs:\r
-       //sega = (mm.bufferseg);\r
-       //if(\r
+       VL_LoadPalFile("data/spri/chikyuu.pal", &palette);\r
        CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &gvar);//) baka=1; else baka=0;\r
 \r
        // Insert sanity cheks later\r
@@ -127,7 +127,7 @@ void main()
 \r
        while(!IN_KeyDown(sc_Escape))\r
        {\r
-               switch(w)\r
+               /*switch(w)\r
                {\r
                        case 1024:\r
                                modexPalUpdate0(pal);\r
@@ -135,7 +135,7 @@ void main()
                        default:\r
                                w++;\r
                        break;\r
-               }\r
+               }*/\r
 FUNCTIONKEYFUNCTIONS;\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
index ec44168e3258e2b33cbd74d4187792daf99fab0f..0adf27512498889c1dcff970e4853d4852e38960 100755 (executable)
@@ -130,7 +130,7 @@ void main(int argc, char *argv[])
        /*strcpy(global_temp_status_text, "press enter for the loop of zcroll\nescape to quit");\r
        modexprint(&gvar.video.page[0], 144, 72, 1, 7, 0, global_temp_status_text);\r
        while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1);*///wwww\r
-       while(!IN_KeyDown(sc_Escape))// && player[0].hp>0)\r
+       while(!IN_KeyDown(sc_Escape))// && player[0].enti.hp>0)\r
        {\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
@@ -154,7 +154,7 @@ void main(int argc, char *argv[])
                        }\r
                        nosound();\r
                }\r
-               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--; }\r
+               if(player[0].enti.q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].enti.hp--; }\r
 */             //debugging binds!\r
                if(IN_KeyDown(2)){ modexShowPage(mv[0].page); gvar.video.panp=0; }\r
                if(IN_KeyDown(25)){ modexpdump(mv[0].page);\r
@@ -203,8 +203,8 @@ void main(int argc, char *argv[])
 #endif\r
                if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r\r
 \r
-               if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break;        //incase things go out of sync!\r
-               player[0].hp = 0;\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!\r
+               player[0].enti.hp = 0;\r
        }\r
 \r
        /* fade back to text mode */\r
index 47dc411017701138dc389d7a9821a8f649c465c4..6a5fae4e3fd918f9bbf60ed7c83cc5b9a7215290 100755 (executable)
Binary files a/wcpu.exe and b/wcpu.exe differ